Update Promotions
note
You can re-enable an expired promotion by updating the end date and setting it in the future. These actions clear out any previously attached codes. This is part of the system that prevents duplicate promotion codes existing on different promotions.
PUT
Update a Promotion
https://api.moltin.com/v2/promotions/:id
Path Parameters:
Name | Required | Type | Description |
---|---|---|---|
id | Required | string | The unique promotion identifier. |
Headers:
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token to grant access to the API. |
Body:
Name | Required | Type | Description |
---|---|---|---|
type | Required | string | "promotion". |
id | Required | number | The unique promotion identifier. |
name | Optional | string | The name of your promotion. |
description | Optional | string | A description of your promotion. |
enabled | Optional | boolean | true if enabled, false if not. |
start | Optional | string | The end time of the promotion datetime (yyyy-mm-dd, yyyy-mm-ddThh:mm:ss+hh:mm). The simpler format will start the promotion at 00:00 UTC of the datetime specified. If time is not specified, it will default to the time at which the request was created. |
end | Optional | string | The end time of the promotion date and time (yyyy-mm-dd, yyyy-mm-ddThh:mm:ss+hh:mm). The simpler format starts the promotion at 00:00 UTC of the date and time specified. If time is not specified, it defaults to the time at which the request was created. |
200 OK
{
"data": {
"type": "promotion",
"id": "7005b249-300b-4cf6-964e-e663278af218",
"name": "Promo #1",
"description": "Initial Promotion",
"enabled": true,
"promotion_type": "fixed_discount",
"schema": {
"currencies": [
{
"currency": "USD",
"amount": 900
},
{
"currency": "GBP",
"amount": 1100
}
]
},
"start": "2017-11-13T00:00:00Z",
"end": "2019-11-13T00:00:00Z",
"created_at": "2018-05-10T15:25:21.164Z",
"updated_at": "2018-05-10T15:26:18.203942092Z"
}
}
The following sample request extends the life of a promotion.
curl -X PUT https://api.moltin.com/v2/promotions/:id \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"type":"promotion",
"id": "PROMOTION_ID",
"name": "Promo #1",
"description": "Promotion (extended)",
"enabled": true,
"start":"2020-09-01",
"end":"2020-12-31"
}