Menu
Create Rule Promotion Codes
Create Rule Promotion Codes
POST
/v2/rule-promotions/{promotionID}/codesUse it in a workflow
- Add a step and choose the Elastic Path connector.
- Pick the Create Rule Promotion Codes action (under Promotions Builder).
- Fill in the fields below, then reference the result from later steps as
{{createRulePromotionCodes.response.data}}.
Request
Path parameters
Headers
Request body
Enter the body as JSON in the step's Body field.
{
"data": {
"type": "string",
"codes": [
{
"code": "string",
"uses": 0,
"user": "string",
"consume_unit": "per_application",
"max_uses_per_shopper": {
"max_uses": 0,
"includes_guests": false
},
"is_for_new_shopper": false
}
]
}
}
Response
Returns 201 with an object. Read it in later steps with {{createRulePromotionCodes.response.data.<field>}}.
{
"data": [
{
"id": "00000000-0000-0000-0000-000000000000",
"type": "string",
"code": "string",
"uses": 0,
"user": "string",
"consume_unit": "per_application",
"max_uses": 0,
"max_uses_per_shopper": {
"max_uses": 0,
"includes_guests": false
},
"is_for_new_shopper": false
}
],
"messages": [
{
"source": {
"type": "string",
"codes": [
"spring2024"
]
},
"title": "Duplicate code names",
"description": "Code names duplicated in other promotions"
}
]
}
Need more? See the Elastic Path guide for connection setup and behaviour shared by every action.
Was this page helpful?