Dynamic Coupon API Generation:

This API endpoint facilitates the generation of dynamic discount coupons based on specific templates: AUTO_ALLOCATE and AUTO_ACCEPT flag set during template generation.

Basic Auth:

POST {API_URL}/subscription/discount-coupon-template/generate-user-coupon

Enter API-KEY and API-Secret as username and password respectively.

Request Body

NameTypeDescription

couponName*

String

Unique identifier for the coupon name.

clientId*

String

Unique identifier for the client.

quantity*

Integer

Number of coupons to be generated.

couponCodes *

Array of Strings

Predefined coupon codes provided by the client.

Details of the generated coupons including identifiers and metadata are provided in the response.

{
  "couponName": "Test Dynamic Coupon",
  "clientId": "YOUR_CLIENT_ID",
  "quantity": 10
}
Rules and Constraints:

Functionality of AUTO_ALLOCATE and AUTO_ACCEPT templates are exclusive:

AUTO_ALLOCATE: Automatic generation in specified quantity.

AUTO_ACCEPT: Generation based on client-provided couponCodes.

The quantity parameter is ignored for AUTO_ACCEPT, and couponCodes for AUTO_ALLOCATE.

couponCodes must be unique and follow format/validation rules of the template.

Quantity Limitation: The quantity of coupons requested in an AUTO_ALLOCATE template cannot exceed the maximum quantity set for that template in the dashboard during template creation. Attempts to generate coupons beyond this limit will result in an error

Error Handling: Error messages and codes for scenarios like invalid template IDs, missing fields, or invalid coupon codes. Specific errors will be returned if the requested quantity exceeds the template's maximum limit.

Last updated