Create Fixed Bundle Discount Promotions
POST
Create Fixed Bundle Discount Promotions
https://api.moltin.com/v2/promotions/
Line-item discounts are only supported by the line calculation method. For more information about this method, see the Calculation Method section. Hierarchy-based promotions are not supported for fixed bundle discount promotions. To promote a bundle, create the bundle in EP PXM, and then create a promotion for that bundle. For more informatiom, see Bundles in Product Experience Manager (EP PXM).
Parameters
Headers
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token required to get access to the API. |
Body
Name | Required | Type | Description |
---|---|---|---|
type | Required | string | Specifies the type of the resource. The type of resource for promotions is, promotion . |
name | Required | string | Specifies a name for the promotion. |
description | Required | string | Specifies a description for the promotion. |
enabled | Required | boolean | Specifies whether the promotion is enabled. The options are true or false , and the default setting is false . |
automatic | Required | boolean | Specifies whether the promotion is applied automatically to the cart or a code is required to apply the promotion. The default setting is false . When this value is set to true , a code is autogenerated. If this value is set to false , you must create the code manually. For more information about creating codes, see the Create Promotion Codes section. |
promotion_type | Required | string | Specifies the type of the promotion. Use bundle_fixed_discount for bundle promotions. |
max_applications_per_cart | Optional | integer | Specifies the maximum number of application of the promotion per cart. |
min_cart_value | Optional | array | Specifies an array of currency-value objects, min_cart_value[].currency and min_cart_value[].amount , that provide the minimum cart value required for the promotion to apply. You can add one or several value specifications in different currencies. |
schema | Required | object | Specifies the bundle requirements and currencies. In bundle requirements, specify the product SKUs and required quantity of products to apply bundle promotion. |
start | Required | string | Specifies the start date and time of the promotion or the start date of the promotion. You can provide a specific time in the HH:MM format. For example, "start": "2000-01-01 12:00" . If no time is specified, the default start and end time is set to 00:00 . |
end | Required | string | Specifies the end date and time of the promotion or the end date of the promotion. |
The schema
object
Name | Required | Type | Description |
---|---|---|---|
schema.requirements.targets | Required | array [string] | Specifies an array of required product SKUs or IDs for the bundle discount promotion. For example, for requirements: [{quantity: 1, targets: ["a", "b"]}, {quantity: 1, targets: ["c", "d"]}] , this means the promotion requires one of either SKU a or b and one of either SKU c or d in the cart to qualify for the bundle discount. |
schema.requirements.quantity | Required | integer | Specifies the quantities of products to be applied for the promotion. |
schema.currencies[].amount | Required | integer | Specifies the bundle price amount when cart items are qualified for the promotion. For example, when a shopper buys 1 SKU a and 1 sku c in the cart, the amount is $100. This means $100 is the total amount for both SKUs in the cart. |
schema.currencies[].currency | Required | string | Specifies a three-letter currency code. For example, USD. |
schema.target_catalogs | Optional | array [string] | Specifies the unique identifiers of the catalogs to be applied for this promotion. If you do not set this parameter, promotion will be applied to all catalogs. |
Request Example
curl -X POST 'https://api.moltin.com/v2/promotions' \
'{
"data": {
"type": "promotion",
"name": "Fixed bundle promotion example",
"description": "SKU1 and SKU2 for $150",
"enabled": true,
"automatic": true,
"promotion_type": "bundle_fixed_discount",
"max_applications_per_cart":1,
"schema": {
"requirements": [
{
"targets": [
"SKU1"
],
"quantity": 1
},
{
"targets": [
"SKU2"
],
"quantity": 1
}
],
"currencies": [
{
"amount": 15000,
"currency": "USD"
}
],
"target_catalogs": ["09b9359f-897f-407f-89a2-702e167fe781"]
},
"start": "2000-01-01",
"end": "2100-01-01"
}
}'
Response Example
201 Created
{
"data": {
"type": "promotion",
"id": "cb7f218f-bb02-43f3-a05b-88cad8e34339",
"name": "Fixed bundle promotion example",
"description": "SKU1 and SKU2 for $150",
"enabled": true,
"automatic": true,
"promotion_type": "bundle_fixed_discount",
"max_applications_per_cart": 1,
"schema": {
"requirements": [
{
"targets": ["SKU1"],
"quantity": 1
},
{
"targets": ["SKU2"],
"quantity": 1
}
],
"currencies": [
{
"currency": "USD",
"amount": 15000
}
],
"target_catalogs": ["09b9359f-897f-407f-89a2-702e167fe781"]
},
"start": "2000-01-01T00:00:00Z",
"end": "2100-01-01T00:00:00Z",
"created_by": "seller@elasticpath.com",
"updated_by": "another_seller@elasticpath.com",
"meta": {
"timestamps": {
"created_at": "2021-06-30T17:30:01.662Z",
"updated_at": "2021-06-30T17:30:01.662Z"
}
}
}
}