This article shares some typical use cases you can support, as well as an example flow that supports each use case. You're certainly not limited to these use cases, but they can be a helpful jumping off point as you plan your implementation.
When a customer begins the checkout flow on a Wix site for a purchase of $100 USD, and they have a gift card balance of $50 USD:
A customer chooses to use their gift card to pay for their $100 purchase, enters the gift card code in the designated slot, and clicks Apply.
The Wix site sends a Get Balance request to your app with the code
, app_instance_id
, and optionally location_id
.
Example request:
Your app processes the request and returns the current balance and currency of the customer's gift card.
Example response:
The Wix site displays the balance to the customer as part of the price summary at Checkout, as though the gift card is used for the purchase.
Continuing the example from above, the customer continues with the checkout flow:
The customer decides to use their gift card balance toward their purchase, enters credit card details to cover the remaining $50, and clicks Place Order.
The Wix site sends a Redeem Gift Card request to your app with the code
, amount
, order_id
, currency_code
, and optionally location_id
.
Example request:
Your app processes the request and returns the remaining balance, currency, and transaction ID of the redeem operation.
Example response:
The customer's payment is processed, and they receive a confirmation showing that $50 has been deducted from his gift card, leaving a balance of $0.
Continuing the example from above, the customer chooses to complete the checkout flow:
After the gift card was redeemed, the customer's credit card payment is processed, and fails.
The Wix site sends a Void request to your app with the transaction_id
, and optionally location_id
, in order to restore the redeemed amount to the gift card balance.
Example request:
Your app processes the request and returns the remaining balance and currency of the gift card after the void operation.
Example response: