Update Promotions

You can re-enable an expired promotion by updating the end date and setting it in the future, in doing so you will clear out any previously attached codes - this is part of the system that prevents duplicate promotion codes existing on different promotions.

Update a Promotion

PUT https://api.moltin.com/v2/promotions/:id

Path Parameters

NameTypeDescription

id

string

The unique promotion identifier

Headers

NameTypeDescription

Authorization

string

Request Body

NameTypeDescription

type

string

"promotion"

id

number

The unique promotion identifier

name

string

The name of your promotion

description

string

A description of your promotion

enabled

boolean

true if enabled, false if not

promotion_type

string

One of: fixed_discount or percent_discount

schema

object

One of: fixed schema, percent schema

start

string

The start 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

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.

{
    "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"
    }
}
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": "Initial Promotion",
        "enabled": true,
        "promotion_type": "fixed_discount",
        "schema":{
          "currencies":[
            {"currency":"USD", "amount":900},
            {"currency":"GBP", "amount":1100}
          ]
        },
        "start":"2017-11-13",
        "end":"2019-11-13"
      }
    }

Last updated