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
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
format | int | "json" | No | Response data format. By default – json |
activated | bool | true | No | Promo code activation or deactivation |
code | string | "CODE-12345" | Yes | Promotional code |
expire_date | string | "2018-08-25T08:00:00Z" | No | Promo code expire date in RFC 3339 format |
loyalty_id | int | 1 | Yes | Loyalty program ID |
caution
At least one of request options is expected for a successful operation, expiry date change or activation/deactivation.
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"activated": true,
"code": "CODE-12345",
"expire_date": "2018-08-25T08:00:00Z",
"loyalty_id": 1,
"token": "abcdefghijklmnqrstuvwxyz"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<activated>true</activated>
<code>Code-1</code>
<expire_date>2024-08-10T08:00:00Z</expire_date>
<loyalty_id>6</loyalty_id>
</xml>
Response example
- JSON
- XML
{
"data": null,
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data></data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |