custom_promotion_rules
Create a custom promotion rule
Changed onCreate a custom promotion rule
post/custom_promotion_rules
Request
- Base URLhttps://{your_organization_slug}.commercelayer.io/api
- URLhttps://{your_organization_slug}.commercelayer.io/api/custom_promotion_rules
- AuthHTTP bearer
Request body
Example request
{
"data": {
"attributes": {
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
},
"filters": {
"status_eq": "pending",
"line_items_sku_code_eq": "AAA"
}
},
"relationships": {
"promotion": {
"data": {
"id": "XAyRWNUzyN",
"attributes": {
"name": "Personal promotion",
"type": "percentage_discount_promotions",
"currency_code": "EUR",
"exclusive": true,
"priority": 2,
"starts_at": "2018-01-01T12:00:00.000Z",
"expires_at": "2018-01-02T12:00:00.000Z",
"total_usage_limit": 5,
"total_usage_count": 2,
"active": true,
"status": "pending",
"weight": 112,
"coupons_count": 2,
"disabled_at": "2018-01-01T12:00:00.000Z",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
},
"percentage": 10
},
"relationships": {
"market": {
"data": {
"id": "XAyRWNUzyN"
}
},
"promotion_rules": {
"data": {
"id": "XAyRWNUzyN"
}
},
"order_amount_promotion_rule": {
"data": {
"id": "XAyRWNUzyN"
}
},
"sku_list_promotion_rule": {
"data": {
"id": "XAyRWNUzyN"
}
},
"coupon_codes_promotion_rule": {
"data": {
"id": "XAyRWNUzyN"
}
},
"custom_promotion_rule": {
"data": {
"id": "XAyRWNUzyN"
}
},
"sku_list": {
"data": {
"id": "XAyRWNUzyN"
}
},
"coupons": {
"data": {
"id": "XAyRWNUzyN"
}
},
"attachments": {
"data": {
"id": "XAyRWNUzyN"
}
},
"events": {
"data": {
"id": "XAyRWNUzyN"
}
},
"tags": {
"data": {
"id": "XAyRWNUzyN"
}
},
"event_stores": {
"data": {
"id": "XAyRWNUzyN"
}
},
"skus": {
"data": {
"id": "XAyRWNUzyN"
}
}
}
}
}
}
}
}Response
The created custom promotion rule object
Changes
- info
endpoint added
- info