Sample Flow

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.

Retrieve a Gift Card Balance

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:

  1. 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.

  2. The Wix site sends a Get Balance request to your app with the code, app_instance_id, and optionally location_id.

    Example request:

    Copy
    1
  3. Your app processes the request and returns the current balance and currency of the customer's gift card.

    Example response:

    Copy
    1
  4. 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.

Redeem a Gift Card

Continuing the example from above, the customer continues with the checkout flow:

  1. 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.

  2. 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:

    Copy
    1
  3. Your app processes the request and returns the remaining balance, currency, and transaction ID of the redeem operation.

    Example response:

    Copy
    1
  4. 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.

Void a Transaction

Continuing the example from above, the customer chooses to complete the checkout flow:

  1. After the gift card was redeemed, the customer's credit card payment is processed, and fails.

  2. 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:

    Copy
    1
  3. Your app processes the request and returns the remaining balance and currency of the gift card after the void operation.

    Example response:

    Copy
    1
Was this helpful?
Yes
No