younifyd
Menu

Create Coupons Async

Create coupons asynchronously

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

Use it in a workflow

  1. Add a step and choose the Talon.One connector.
  2. Pick the Create Coupons Async action (under management).
  3. Fill in the fields below, then reference the result from later steps as {{createCouponsAsync.response.data}}.

Request

Path parameters

applicationIdinteger (int64)required

The ID of the Application. It is displayed in your Talon.One deployment URL.

campaignIdinteger (int64)required

The ID of the campaign. It is displayed in your Talon.One deployment URL.

Request body

Enter the body as JSON in the step's Body field.

usageLimitinteger (int64)required

The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply.

discountLimitnumber

The total discount value that the code can give. Typically used to represent a gift card value.

reservationLimitinteger (int64)

The number of reservations that can be made with this coupon code.

startDatestring (date-time)

Timestamp at which point the coupon becomes valid.

expiryDatestring (date-time)

Expiration date of the coupon. Coupon never expires if this is omitted.

numberOfCouponsinteger (int64)required

The number of new coupon codes to generate for the campaign.

couponSettingsobject
validCharactersarray<string>required

List of characters used to generate the random parts of a code.

couponPatternstringrequired

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.

attributesobjectrequired

Arbitrary properties associated with coupons.

isReservationMandatoryboolean

An indication of whether the code can be redeemed only if it has been reserved first.

Default false

json
{
  "usageLimit": 100,
  "numberOfCoupons": 200000,
  "attributes": {},
  "discountLimit": 30,
  "reservationLimit": 45,
  "startDate": {},
  "expiryDate": {},
  "couponSettings": {
    "couponPattern": "SUMMER-####-####",
    "validCharacters": [
      "A",
      "B",
      "C",
      "D",
      "E",
      "F",
      "G",
      "H",
      "I",
      "J",
      "K",
      "L",
      "M",
      "N",
      "O",
      "P",
      "Q",
      "R",
      "S",
      "T",
      "U",
      "V",
      "W",
      "X",
      "Y",
      "Z",
      "0",
      "1",
      "2",
      "3",
      "4",
      "5",
      "6",
      "7",
      "8",
      "9"
    ]
  },
  "isReservationMandatory": false
}

Response

Returns 200 with an object. Read it in later steps with {{createCouponsAsync.response.data.<field>}}.

batchIdstring

The batch ID that all coupons created by the request will have.

json
{
  "batchId": "tqyrgahe"
}

Need more? See the Talon.One guide for connection setup and behaviour shared by every action.