Skip to main content

Update promo code

Description

Updates promo code expiry date, activates or deactivates a promo code.

Request URL

Method: POST

https://example.com/api/v1.1/promocodes/update

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatint"json"NoResponse data format.
By default – json
activatedbooltrueNoPromo code activation or deactivation
codestring"CODE-12345"YesPromotional code
expire_datestring"2018-08-25T08:00:00Z"NoPromo code expire date in RFC 3339 format
loyalty_idint1YesLoyalty program ID
caution

At least one of request options is expected for a successful operation, expiry date change or activation/deactivation.

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"activated": true,
"code": "CODE-12345",
"expire_date": "2018-08-25T08:00:00Z",
"loyalty_id": 1,
"token": "abcdefghijklmnqrstuvwxyz"
}

Response example

{
"data": null,
"error": 0,
"error_text": "Successful operation"
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text