Using Discount Codes
Retrieve Available Discount Codes
bash
curl --location --globoff '{clientToken}/special_offer_codes?sale=%2F{clientToken}%2Fsales%2F{saleId}'This request retrieves any pre-existing discount codes for a given sale. It’s optional and only useful if you want to promote them to your contact.
Add a Discount Code
bash
curl --location --globoff '{clientToken}/sale_special_offer_codes' \
--data '{
"code" : "1234",
"sale" : "/{clientToken}/sales/12345"
}'| Parameter | Description | Example |
|---|---|---|
code | The discount code | 1234 |
sale | The IRI of the sale | /{clientToken}/sales/12345 |
This endpoint allows you to add a promotional code to a sale. Be sure to check the response code to confirm whether the addition was successful.
Retrieve the Updated Sale
To ensure the discount was correctly applied and to get the updated (reduced) amounts, retrieve the sale again.