---
title: "Generate coupon codes"
method: POST
path: "/api-offers/coupon/generate-codes"
tags: ["Coupon"]
---

# Generate coupon codes

`POST /api-offers/coupon/generate-codes`

## Request

- Base URL: `https://live.copilot.fabric.inc`
- URL: `https://live.copilot.fabric.inc/api-offers/coupon/generate-codes`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/fabric/apis/offers-v2/docs/api-offers/coupon/generate-codes/post.ts> (a function with typed inputs; its response is checked against the schema)

Enables you to generate coupon codes based on given parameters

## Headers

- `x-site-context` string, required

## Request body

- GenerateCouponCodeRequest
  - `prefix` string, required: Prefix string to generate the coupon
  - `start` number, required: Initial number to begin generating the coupon codes
  - `count` number, required: Number of coupon codes to be generated

## Response `200`

OK

- GenerateCouponCodeResponse
  - `codes` string[]: List of generated coupon codes

## Other responses

- `400`: Bad Request
- `500`: Internal Server Error

---

[API](https://skmtc.dev/fabric/apis/offers-v2.md) - [All operations](https://skmtc.dev/fabric/apis/offers-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/fabric/apis/offers-v2/revisions/da2bd742b9bc?raw)
