younifyd
Menu

Create Coupons

Create coupons

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

Use it in a workflow

  1. Add a step and choose the Talon.One connector.
  2. Pick the Create Coupons action (under management).
  3. Fill in the fields below, then reference the result from later steps as {{createCoupons.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.

Query parameters

silentstring

Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles.

Default "yes"

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.

limitsarray<object>

Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured.

actionstringrequired

The limitable action to which this limit applies. For example: - `setDiscount` - `setDiscountEffect` - `redeemCoupon` - `createCoupon`

limitnumberrequired

The value to set for the limit.

periodstring

The period on which the budget limit recurs.

One ofdailyweeklymonthlyyearly

entitiesarray<string>required

The entity that this limit applies to.

numberOfCouponsinteger (int64)required

The number of new coupon codes to generate for the campaign. Must be at least 1.

uniquePrefixstring

**DEPRECATED** To create more than 20,000 coupons in one request, use [Create coupons asynchronously](https://docs.talon.one/management-api#tag/Coupons/operation/createCouponsAsync) endpoint.

attributesobject

Arbitrary properties associated with this item.

recipientIntegrationIdstring

The integration ID for this coupon's beneficiary's profile.

validCharactersarray<string>

List of characters used to generate the random parts of a code. By default, the list of characters is equivalent to the `[A-Z, 0-9]` regular expression.

couponPatternstring

The pattern used to generate coupon codes. The character `#` is a placeholder and is replaced by a random character from the `validCharacters` set.

isReservationMandatoryboolean

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

Default false

implicitlyReservedboolean

An indication of whether the coupon is implicitly reserved for all customers.

json
{
  "usageLimit": 100,
  "numberOfCoupons": 1,
  "discountLimit": 30,
  "reservationLimit": 45,
  "startDate": {},
  "expiryDate": {},
  "limits": [
    {
      "period": "yearly",
      "entities": [
        "Coupon"
      ],
      "limit": 1000,
      "action": "createCoupon"
    }
  ],
  "uniquePrefix": "",
  "attributes": {
    "venueId": 12
  },
  "recipientIntegrationId": "URNGV8294NV",
  "validCharacters": [
    "A",
    "B",
    "G",
    "Y"
  ],
  "couponPattern": "SUMMER-#####"
}

Response

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

totalResultSizeinteger (int64)
dataarray<object>
idinteger (int64)required

The internal ID of the coupon.

createdstring (date-time)required

The time the coupon was created.

campaignIdinteger (int64)required

The ID of the campaign that owns this entity.

valuestringrequired

The coupon code.

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.

limitsarray<object>4 fields

Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured.

usageCounterinteger (int64)required

The number of times the coupon has been successfully redeemed.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

reservationCounternumber

The number of times this coupon has been reserved.

attributesobject

Custom attributes associated with this coupon.

referralIdinteger (int64)

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger (int64)

The ID of the Import which created this coupon.

reservationboolean

Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code.

Default true

batchIdstring

The id of the batch the coupon belongs to.

isReservationMandatoryboolean

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

Default false

implicitlyReservedboolean

An indication of whether the coupon is implicitly reserved for all customers.

json
{
  "totalResultSize": 1,
  "data": [
    {
      "recipientIntegrationId": "URNGV8294NV",
      "implicitlyReserved": false,
      "created": {},
      "campaignId": 211,
      "usageLimit": 100,
      "referralId": 326632952,
      "usageCounter": 10,
      "batchId": "32535-43255",
      "discountCounter": 10,
      "expiryDate": {},
      "importId": 4,
      "reservationLimit": 45,
      "reservationCounter": 1,
      "reservation": false,
      "attributes": "{}",
      "id": 6,
      "value": "XMAS-20-2021",
      "discountLimit": 30,
      "startDate": {},
      "limits": [
        {
          "period": "yearly",
          "entities": [
            "Coupon"
          ],
          "limit": 1000,
          "action": "createCoupon"
        },
        {
          "period": "yearly",
          "entities": [
            "Coupon"
          ],
          "limit": 1000,
          "action": "createCoupon"
        }
      ],
      "discountRemainder": 5,
      "isReservationMandatory": false
    }
  ]
}

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