Skip to main content

Create Customer-specific Promotions

Prerequisites

  • Ensure that you use customer ID of the customer in the user field when you add the promotion code to the promotion configuration. For more information, see the Customers section.
note

The default setting for the automatic field is false and you must create the code manually for the promotion to apply. When this value is set true, a code is autogenerated.

Procedure

  1. Create a promotion using one of the following:

  2. Create a promotion code for the customer using one of the following:

  3. Apply the coupon code.

The following code shows an example:

{
"data": {
"type": "promotion_codes",
"codes": [
{
"code": "2021LOYALTY",
"user": "794f8c8a-e073-488d-855d-705eb33fa870",
"uses": 1
},
{
"code": "2021PREFERREDCUSTOMER"
}
]
}
}

Add the X-Moltin-Customer-Token header in the request, so the customer can authenticate to the site to use the promotion. For more information, see the Create Promotion Codes section.