The Loyalty Checkout Exchange API enables you to manage loyalty discounts during the checkout process in your Wix site's eCommerce flow. This API allows you to apply rewards and query discount information, enhancing your loyalty program integration with the checkout process.
With the Loyalty Checkout Exchange API, you can:
For more information about managing your site's loyalty program, see the Loyalty API.
It's important to note the following points before starting to code:
The Loyalty Checkout Exchange API works in conjunction with the eCommerce Checkout API. Here's how they interact:
For a complete eCommerce solution, you may need to use both APIs in conjunction. The eCommerce Checkout API provides broader functionality for managing the entire checkout process, while the Loyalty Checkout Exchange API focuses specifically on loyalty program integrations.
LOYALTY_COUPON
discount type.COUPON_REWARD
discount type.DISCOUNT_AMOUNT
discount type when applied at checkout.COUPON_REWARD
discount type if redeemed during the checkout process.LOYALTY_COUPON
discount type if redeemed before checkout and then applied.REFERRAL_REWARD
discount type when applied at checkout.This relationship ensures that the system can track both the type of reward being used and how it's being applied during the checkout process, allowing for accurate point deduction and discount application.
For a complete eCommerce solution with loyalty program integration, you may need to use the following APIs in conjunction with the Loyalty Checkout Exchange API:
These APIs work together to provide a seamless eCommerce experience with integrated loyalty features.
LOYALTY_COUPON
: A coupon that has already been redeemed. This coupon already exists and does not deduct points when applied during checkout.COUPON_REWARD
: A coupon that has not been redeemed but is now being redeemed at checkout. Points are deducted in exchange for this coupon during the checkout process.DISCOUNT_AMOUNT
: A flexible reward type where customers choose how many points to spend for a discount during checkout.REFERRAL_REWARD
: A coupon received when a customer successfully refers a friend.APPLIED
, COMPLETED
, REFUNDED
, or FAILED_TO_REFUND
.APPLIED
, IN_PROGRESS
, COMPLETED
, REFUNDED
, or FAILED_TO_REFUND
.The following table shows field support for filters and sorting for the Loyalty Checkout Discount object:
Field | Query Filter Operators | Sortable |
---|---|---|
checkoutId | $eq , $ne , $hasSome , $startsWith , $in , $nin , $exists | Sortable |
status | $eq , $ne , $hasSome , $in , $nin , $exists | Sortable |
Related content: API Query Language, Query Loyalty Checkout Discounts endpoint
A loyalty checkout discount represents a discount applied to a checkout using loyalty rewards, coupons, or referral rewards.
Loyalty checkout discount ID.
ID of the checkout this discount is applied to.
Current status of the discount.
The type of discount applied.
ID of the loyalty reward used for this discount.
ID of the loyalty coupon used for this discount.
ID of the referral reward used for this discount.
{
"discount": {
"id": "18c7db37-ce9d-4253-bdf7-89d5fd4085b3",
"checkoutId": "0c4c3398-7d64-4513-b3ed-e8033e2c28d6",
"loyaltyCouponId": "97ec5244-1be1-4188-9e38-34598fe0403e",
"status": "IN_PROGRESS",
"discountType": "DISCOUNT_AMOUNT"
}
}
Applies a discount to a checkout.
You can apply one of the following discounts, which are exchanged for loyalty points: reward
, loyaltyCoupon
, or referralReward
.
See the introduction article for more information on the type of rewards.
ID of the checkout to apply the discount to.
Unredeemed loyalty reward discount.
Loyalty coupon discount.
Referral reward discount.
The applied loyalty checkout discount.
curl -X POST \
'https://www.wixapis.com/loyalty-checkout-exchange/v1/loyalty-checkout-discount' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
"checkoutId": "0c4c3398-7d64-4513-b3ed-e8033e2c28d6",
"reward": {
"id": "00000000-0000-0000-0001-000000000000",
"revision": "1",
"pointsToSpend": 10
}
}'
{
"discount": {
"id": "18c7db37-ce9d-4253-bdf7-89d5fd4085b3",
"checkoutId": "0c4c3398-7d64-4513-b3ed-e8033e2c28d6",
"loyaltyCouponId": "97ec5244-1be1-4188-9e38-34598fe0403e",
"status": "IN_PROGRESS",
"discountType": "DISCOUNT_AMOUNT"
}
}
Retrieves a list of loyalty checkout discounts, given the provided paging, filtering, and sorting.
To learn about working with Query methods, see API Query Language, Sorting and Paging, and Field Projection.
Filter object. See API Query Language for more information.
List of loyalty checkout discounts matching the query.
Paging metadata for the response.
curl -X POST \
'https://www.wixapis.com/loyalty-checkout-exchange/v1/loyalty-checkout-discount' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
"query": {}
}'
{
"loyaltyCheckoutDiscounts": [
{
"id": "18c7db37-ce9d-4253-bdf7-89d5fd4085b3",
"checkoutId": "0c4c3398-7d64-4513-b3ed-e8033e2c28d6",
"loyaltyCouponId": "97ec5244-1be1-4188-9e38-34598fe0403e",
"status": "IN_PROGRESS",
"discountType": "DISCOUNT_AMOUNT"
}
],
"pagingMetadata": {
"count": 1,
"cursors": {},
"hasNext": false
}
}