Create Promotion

There are two available types of promotion: fixed discount and percent discount. Be sure to look at the example payloads below when creating a new promotion record. For more details, see How promotions work.

post
Create a Promotion

https://api.moltin.com/v2/promotions
Request
Response
Headers
Authorization
required
string
The Bearer token to grant access to the API.
Body Parameters
name
required
string
A general name for the promotion.
description
required
string
A general description for the promotion.
type
required
string
The type should be promotion.
promotion_type
required
string
The type of schema being used for the promotion. (fixed_discount or percent_discount)
enabled
required
string
True or False
start
required
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
required
string
The end time of the promotion datetime (yyy-mm-dd, yyy-mm-ddThh:mm:ss+hh:mm). The simpler format will start the promotion at 00:00 UTC. If time's not provided, it will default to the time at which the request was created.
schema
required
object
See example payloads below.
201: Created
{
"data": {
"type": "promotion",
"id": "15bf00b3-436b-446d-bda9-c021e4e4752b",
"name": "Promo #1",
"description": "Initial Promotion",
"enabled": true,
"promotion_type": "fixed_discount",
"schema": {
"currencies": [
{
"currency": "USD",
"amount": 900
},
{
"currency": "GBP",
"amount": 1100
}
]
},
"start": "2017-05-12T15:04:05Z",
"end": "2019-10-12T15:04:05Z",
"created_at": "2017-11-13T03:00:35.381148442Z",
"updated_at": "2017-11-13T03:00:35.381148514Z"
}
}

Example Payloads

Fixed Discount Request
Percent Discount Request
//Create a Fixed Promotion
curl -X "POST" "https://api.moltin.com/v2/promotions" \
-H 'Content-Type: application/json' \
-H 'Authorization: 1af41d46cb18d11b3abffb66c3cb20944d3452e7' \
-d $'{
"data": {
"schema": {
"currencies": [
{
"currency": "USD",
"amount": 10
}
]
},
"end": "2018-06-12",
"enabled": true,
"start": "2017-05-12",
"promotion_type": "fixed_discount",
"type": "promotion",
"description": "Black Friday",
"name": "BF"
}
}'
//Create a Percent Request
curl -X "POST" "https://api.moltin.com/v2/promotions" \
-H 'Content-Type: application/json' \
-H 'Authorization: 1af41d46cb18d11b3abffb66c3cb20944d3452e7' \
-d $'{
"data": {
"schema": {
"currencies": [
{
"currency": "USD",
"percentage": 10
}
]
},
"end": "2018-06-12T15:04:05+00:00",
"enabled": true,
"start": "2017-05-12T15:04:05+00:00",
"promotion_type": "percent_discount",
"type": "promotion",
"description": "Black Friday",
"name": "BF"
}
}'