Create Loyalty Coupon
Use this method to create coupon codes on the fly to be used with a loyalty program.
Important: Loyalty coupons are only valid for 15 minutes.
The type of coupons available for this functionality are of type cart fixed and cart percentage discounts.
Authorizations:
Request Body schema: application/json
A loyalty request
Array of objects (voucher) | |||||||||||||||
Array
|
Responses
Request samples
- Payload
{- "vouchers": [
- {
- "voucherId": "37e6476f-a124-495d-acd7-3ba4e3b0a739",
- "name": "fixed amount discount - 2000 points",
- "discount": 50,
- "type": "Fixed",
- "level": "Cart",
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 50
}
], - "consumers": [
- "2dbb6700-d847-11ed-afa1-0242ac120002",
- "3c8eb0de-d847-11ed-afa1-0242ac120002"
]
}
]
}
Response samples
- 201
- 400
- 500
{- "codes": [
- "CODE1",
- "CODE2",
- "CODE3"
], - "warnings": [
- {
- "code": "voucher_mismatch",
- "ref": "37e6476f-a124-495d-acd7-3ba4e3b0a739",
- "kind": "voucher",
- "message": "there's a mismatch between the voucher ID and the name of the voucher"
}
]
}