---
title: "Create coupons asynchronously"
method: POST
path: "/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async"
tags: ["Coupons"]
---

# Create coupons asynchronously

`POST /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async`

## Request

- Base URL: `https://yourbaseurl.talon.one`
- URL: `https://yourbaseurl.talon.one/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/talon/apis/management-api/docs/v1/applications/:applicationId/campaigns/:campaignId/coupons_async/post.ts> (a function with typed inputs; its response is checked against the schema)

> [!note] Management API endpoints are **not** meant to be used in real-time integrations that directly serve your end users. Rate limit: 3 requests per second.

Create up to 5,000,000 coupons asynchronously. You should typically use this enpdoint when you create at least 20,001 coupons. You receive an email when the creation is complete.

If you want to create less than 20,001 coupons, you can use the [Create coupons](https://docs.talon.one/management-api#tag/Coupons/operation/createCoupons) endpoint.

## Path parameters

- `applicationId` integer, required
- `campaignId` integer, required

## Request body

- NewCouponCreationJob
  - `usageLimit` integer, required: The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply.
  - `discountLimit` number: The total discount value that the code can give. Typically used to represent a gift card value.
  - `reservationLimit` integer: The number of reservations that can be made with this coupon code.
  - `startDate` string, date-time: Timestamp at which point the coupon becomes valid.
  - `expiryDate` string, date-time: Expiration date of the coupon. Coupon never expires if this is omitted.
  - `numberOfCoupons` integer, required: The number of new coupon codes to generate for the campaign.
  - `couponSettings` CodeGeneratorSettings
    - `validCharacters` string[], required: List of characters used to generate the random parts of a code.
    - `couponPattern` string, required: The pattern used to generate codes, such as coupon codes, referral codes, and loyalty cards. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set.
  - `attributes` object, required: Arbitrary properties associated with coupons.
  - `isReservationMandatory` boolean: An indication of whether the code can be redeemed only if it has been reserved first.

## Response `200`

OK

- AsyncCouponCreationResponse
  - `batchId` string, required: The batch ID that all coupons created by the request will have.

---

[API](https://skmtc.dev/talon/apis/management-api.md) - [All operations](https://skmtc.dev/talon/apis/management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talon/apis/management-api/revisions/7ef1b9504c3a?raw)
