Loyalty
Coupons with monetary value (elsewhere referred to as vouchers) consist of two parts in OIS:
Redeeming coupons
Selling coupons
Coupons are never considered discounts, as a coupon has actual monetary value.
Redeeming coupons
Verification of coupons
In order to allow redeeming of coupons, various steps must to be taken to ensure validity of the coupon and preventing customers from redeeming the same coupon multiple times.
The endpoint that is used to verify coupons can be found here: loyaly/v1/coupons/{code} GET
The response will contain the remaining value, expiration date (if applicable) and whether or not the coupon can be partially redeemed.
In order to prevent customers from redeeming coupons multiple times, perform verification:
Whenever a customer tries to add a coupon to the cart
Whenever a customer that has a coupon in the cart proceeds to the Payment Service Provider in the checkout
Redeeming coupons
When an order has been placed in the webshop that was (partially) paid with a coupon, the amount used must be redeemed immediately. OIS cannot perform this step for the webshop, because of possible delays in sending orders to OIS.
The endpoint that is used to redeem coupons can be found here: loyalty/v1/coupons/{code}/redeem PUT
Adding redeemed coupons to Order POST
When an order has been placed that was (partially) paid with a coupon, the OrderCouponPayment array must be added in the Order POST to OIS with a relevant PaymentOptionId. The Code in this array must be a constant value that is determined during implementation.
Selling coupons
When selling coupons they must be added to orders. More information concerning orders can be found here: Order POST. The loyalty endpoints do not have to be used as the actual coupons are created by OIS and/or ERP.
Both physical and digital coupons are supported.
Although pre-defined coupon values can be sold in the webshop, OIS does not require pre-defined values.
Webhooks
Various webhooks are available for push notifications concerning coupons. More information can be found here: OIS Webhooks