POST

Redeem


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

This method requests that a transaction be created by your app. Wix calls this method when a customer completes a purchase that includes a gift card as a payment method at checkout.

Endpoint
POST
{DEPLOYMENT-URI}/v1/redeem
Body Params
codestringminLength 8maxLength 20

Gift card code.


appInstanceIdstringdeprecatedformat GUID

App ID of the Gift Card provider. Deprecated.


amountnumberminimum 0maximum 999999999.99

Amount to redeem from the gift card.


orderIdstringformat GUID

Order ID the gift card transaction is applied to. Order details can be collected from eCommerce Search Orders.


currencyCodestringformat CURRENCY

Currency code.


locationIdstringmaxLength 50

Physical location ID. Can be based on the Locations API or an external provider.

Response Object
remainingBalancenumberminimum 0maximum 999999999.99

Remaining balance on the Gift Card after the redemption.


currencyCodestringformat CURRENCY

Currency code.


transactionIdstringminLength 1maxLength 100

Transaction ID.

Redeem Gift Card

The data payload will include the following object as an encoded JWT. For the purposes of this example, we show the request and response objects decoded.

Request
cURL
curl -X POST \ 'http://provider.example.com/v1/redeem' \ -H 'user-agent: Wix' \ -H 'accept-encoding: gzip, deflate' \ -H 'content-type: text/plain; charset=utf-8' \ -d '{ "code": "GIFT-CARD-CODE-123", "appInstanceId":"044667f4-c13f-46c2-8506-de9e42293896", "amount": 20.00, "currencyCode": "USD", "orderId": "00000000-0000-0000-0000-000000000001" }'
Response
JSON
{ "remainingBalance": 80.00, "currencyCode": "USD", "transactionId: "00000000-0000-0000-0000-000000000001" }
Errors
GiftCardNotFoundobjectstatus code: 404
GiftCardDisabledobjectstatus code: 428
GiftCardExpiredobjectstatus code: 428
InsufficientFundsobjectstatus code: 428
AlreadyRedeemedobjectstatus code: 409
CurrencyNotSupportedobjectstatus code: 400
Did this help?