younifyd
Menu

Generate Unique Coupon Codes Sync

Generate unique coupon codes synchronously

POST/coupons/{coupon_id}/generate_sync

Use it in a workflow

  1. Add a step and choose the Recurly connector.
  2. Pick the Generate Unique Coupon Codes Sync action (under unique_coupon_code).
  3. Fill in the fields below, then reference the result from later steps as {{generateUniqueCouponCodesSync.response.data}}.

Request

Path parameters

coupon_idstringrequired

Coupon ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-10off`.

Request body

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

number_of_unique_codesintegerrequired

The quantity of unique coupon codes to generate. A bulk coupon can have up to 100,000 unique codes (or your site's configured limit).

json
{
  "number_of_unique_codes": 0
}

Response

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

objectstring
unique_coupon_codesarray<object>

An array containing the newly generated unique coupon codes.

idstring
objectstring
codestring

The code the customer enters to redeem the coupon.

statestring

Indicates if the unique coupon code is redeemable or why not.

One ofexpiredinactivemaxed_outredeemable

bulk_coupon_idstring

The Coupon ID of the parent Bulk Coupon

bulk_coupon_codestring

The Coupon code of the parent Bulk Coupon

created_atstring (date-time)
updated_atstring (date-time)
redeemed_atstring (date-time)

The date and time the unique coupon code was redeemed.

expired_atstring (date-time)

The date and time the coupon was expired early or reached its `max_redemptions`.

json
{
  "object": "string",
  "unique_coupon_codes": [
    {
      "id": "string",
      "object": "string",
      "code": "string",
      "state": "expired",
      "bulk_coupon_id": "string",
      "bulk_coupon_code": "string",
      "created_at": "2025-01-01T00:00:00Z",
      "updated_at": "2025-01-01T00:00:00Z",
      "redeemed_at": "2025-01-01T00:00:00Z",
      "expired_at": "2025-01-01T00:00:00Z"
    }
  ]
}

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