Coupons
Coupon management APIs for creating and managing coupon templates
POST /api/v1/coupons/createPOST /api/v1/coupons/{id}/updateGET /api/v1/coupons/{id}GET /api/v1/coupons
Create a coupon
POST /api/v1/coupons/create
Creates a new coupon template that can be redeemed in purchases.
The fixed amount to deduct when discount_model is FLAT.
The currency of amount_off when discount_model is FLAT.
Description of the coupon providing business context.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
The duration of the coupon to apply, when duration_typeis CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period_unit.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
Determines how long the coupon's discount remains active after being applied. Possible values:
ONCE: Applies only to the first charge of a subscription or a one-off invoice.CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.INDEFINITELY: Applies to all future charges for the subscription until it is removed.
Time after which the coupon can no longer be redeemed.
A set of string key-value pairs that you can attach to this object for storing additional information.
Name of the coupon.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
Unique request ID specified by the merchant.
true if the coupon is available to be applied to objects. false otherwise.
The fixed amount to deduct when discount_model is FLAT.
Time when the coupon was created.
The currency of amount_off when discount_model is FLAT.
Description of the coupon providing business context.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
The duration of the coupon to apply, when duration_typeis CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
Determines how long the coupon's discount remains active after being applied. Possible values:
ONCE: Applies only to the first charge of a subscription or a one-off invoice.CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.INDEFINITELY: Applies to all future charges for the subscription until it is removed.
Time after which the coupon can no longer be redeemed.
ID of the Coupon object.
A set of string key-value pairs that you can attach to this object for storing additional information.
Name of the coupon.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
The number of times this coupon has been redeemed.
Time when the coupon was updated.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/coupons/create' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "amount_off": 10,> "currency": "USD",> "description": "20% off for Black Friday",> "discount_model": "PERCENTAGE",> "duration": {> "period": 3,> "period_unit": "MONTH"> },> "duration_type": "CUSTOM",> "expires_at": "2026-12-31T23:59:59+0000",> "metadata": {> "campaign": "bf-2026"> },> "name": "Black Friday 20% Off",> "percentage_off": 20,> "request_id": "ee939540-3203-4a2c-9172-89a566485dd9">}'
1{2 "active": true,3 "amount_off": 10,4 "created_at": "<date-time>",5 "currency": "USD",6 "description": "20% off for Black Friday",7 "discount_model": "PERCENTAGE",8 "duration": {9 "period": 3,10 "period_unit": "MONTH"11 },12 "duration_type": "CUSTOM",13 "expires_at": "2026-12-31T23:59:59+0000",14 "id": "coup_abc123",15 "metadata": {16 "campaign": "bf-2026"17 },18 "name": "Black Friday 20% Off",19 "percentage_off": 20,20 "times_redeemed": 0,21 "updated_at": "<date-time>"22}
Update a coupon
POST /api/v1/coupons/{id}/update
Updates a coupon. Before first redemption, all fields can be adjusted; after redemption, only non-billing fields (name, description, expires_at, metadata) can be updated to maintain contractual integrity.
ID of the Coupon object.
Whether the coupon is active and can be redeemed. Set to false to deactivate the coupon.
The fixed amount to deduct when discount_model is FLAT.
This field cannot be updated once the coupon has been redeemed.
The currency of amount_off when discount_model is FLAT.
This field cannot be updated once the coupon has been redeemed.
Description of the coupon providing business context.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off. This field cannot be updated once the coupon has been redeemed.
The duration of the coupon to apply, when duration_typeis CUSTOM. null if duration_type is ONCE or INDEFINITELY.
This field cannot be updated once the coupon has been redeemed.
The number of period_unit.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
Determines how long the coupon's discount remains active after being applied. Possible values:
ONCE: Applies only to the first charge of a subscription or a one-off invoice.CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.INDEFINITELY: Applies to all future charges for the subscription until it is removed. This field cannot be updated once the coupon has been redeemed.
Time after which the coupon can no longer be redeemed.
A set of string key-value pairs that you can attach to this object for storing additional information.
Name of the coupon.
The percentage to deduct when discount_model is PERCENTAGE. This field cannot be updated once the coupon has been redeemed.
true if the coupon is available to be applied to objects. false otherwise.
The fixed amount to deduct when discount_model is FLAT.
Time when the coupon was created.
The currency of amount_off when discount_model is FLAT.
Description of the coupon providing business context.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
The duration of the coupon to apply, when duration_typeis CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
Determines how long the coupon's discount remains active after being applied. Possible values:
ONCE: Applies only to the first charge of a subscription or a one-off invoice.CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.INDEFINITELY: Applies to all future charges for the subscription until it is removed.
Time after which the coupon can no longer be redeemed.
ID of the Coupon object.
A set of string key-value pairs that you can attach to this object for storing additional information.
Name of the coupon.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
The number of times this coupon has been redeemed.
Time when the coupon was updated.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/coupons/coupon_id/update' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "active": true,> "amount_off": 10,> "currency": "USD",> "description": "20% off for Black Friday",> "discount_model": "PERCENTAGE",> "duration": {> "period": 3,> "period_unit": "MONTH"> },> "duration_type": "ONCE",> "expires_at": "2026-12-31T23:59:59+0000",> "metadata": {> "campaign": "bf-2026"> },> "name": "Once Black Friday 20% Off",> "percentage_off": 20>}'
1{2 "active": true,3 "amount_off": 10,4 "created_at": "<date-time>",5 "currency": "USD",6 "description": "20% off for Black Friday",7 "discount_model": "PERCENTAGE",8 "duration": {9 "period": 3,10 "period_unit": "MONTH"11 },12 "duration_type": "CUSTOM",13 "expires_at": "2026-12-31T23:59:59+0000",14 "id": "coup_abc123",15 "metadata": {16 "campaign": "bf-2026"17 },18 "name": "Black Friday 20% Off",19 "percentage_off": 20,20 "times_redeemed": 0,21 "updated_at": "<date-time>"22}
Retrieve a coupon
GET /api/v1/coupons/{id}
Retrieves the coupon details by the ID.
ID of the Coupon object.
true if the coupon is available to be applied to objects. false otherwise.
The fixed amount to deduct when discount_model is FLAT.
Time when the coupon was created.
The currency of amount_off when discount_model is FLAT.
Description of the coupon providing business context.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
The duration of the coupon to apply, when duration_typeis CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
Determines how long the coupon's discount remains active after being applied. Possible values:
ONCE: Applies only to the first charge of a subscription or a one-off invoice.CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.INDEFINITELY: Applies to all future charges for the subscription until it is removed.
Time after which the coupon can no longer be redeemed.
ID of the Coupon object.
A set of string key-value pairs that you can attach to this object for storing additional information.
Name of the coupon.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
The number of times this coupon has been redeemed.
Time when the coupon was updated.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/coupons/coupon_id' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "active": true,3 "amount_off": 10,4 "created_at": "<date-time>",5 "currency": "USD",6 "description": "20% off for Black Friday",7 "discount_model": "PERCENTAGE",8 "duration": {9 "period": 3,10 "period_unit": "MONTH"11 },12 "duration_type": "CUSTOM",13 "expires_at": "2026-12-31T23:59:59+0000",14 "id": "coup_abc123",15 "metadata": {16 "campaign": "bf-2026"17 },18 "name": "Black Friday 20% Off",19 "percentage_off": 20,20 "times_redeemed": 0,21 "updated_at": "<date-time>"22}
Get list of coupons
GET /api/v1/coupons
Get a list of coupons.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
true if the coupon is available to be applied to objects. false otherwise.
Determines how long the coupon's discount remains active after being applied. Possible values:
ONCE: Applies only to the first charge of a subscription or a one-off invoice.CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.INDEFINITELY: Applies to all future charges for the subscription until it is removed.
The start time of expires_at in ISO8601 format (inclusive).
The end time of expires_at in ISO8601 format (exclusive).
The start time of created_at in ISO8601 format (inclusive).
The end time of created_at in ISO8601 format (exclusive).
A bookmark for use in pagination to retrieve either the next page or the previous page of results. You can fetch the value for this identifier from the response of the previous API call. To retrieve the next page of results, pass the value of page_after (if not null) from the response to a subsequent call. To retrieve the previous page of results, pass the value of page_before (if not null) from the response to a subsequent call.
Number of results per page. Defaults to 20.
Paged results.
true if the coupon is available to be applied to objects. false otherwise.
The fixed amount to deduct when discount_model is FLAT.
Time when the coupon was created.
The currency of amount_off when discount_model is FLAT.
Description of the coupon providing business context.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
The duration of the coupon to apply, when duration_typeis CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
Determines how long the coupon's discount remains active after being applied. Possible values:
ONCE: Applies only to the first charge of a subscription or a one-off invoice.CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.INDEFINITELY: Applies to all future charges for the subscription until it is removed.
Time after which the coupon can no longer be redeemed.
ID of the Coupon object.
A set of string key-value pairs that you can attach to this object for storing additional information.
Name of the coupon.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
The number of times this coupon has been redeemed.
Time when the coupon was updated.
The page cursor used for searching after page.
The page cursor used for search before page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/coupons' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "items": [3 {4 "active": true,5 "amount_off": 10,6 "currency": "USD",7 "description": "20% off for Black Friday",8 "discount_model": "PERCENTAGE",9 "duration": {10 "period": 3,11 "period_unit": "MONTH"12 },13 "duration_type": "CUSTOM",14 "expires_at": "2026-12-31T23:59:59+0000",15 "id": "coup_abc123",16 "metadata": {17 "campaign": "bf-2026"18 },19 "name": "Black Friday 20% Off",20 "percentage_off": 20,21 "times_redeemed": 022 }23 ],24 "page_after": "<string>",25 "page_before": "<string>"26}