POST

Get Balance


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 retrieves gift card data from your app. Wix calls this method when a customer applies a gift card as a payment method at checkout.

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

Gift card code.


appInstanceIdstringdeprecatedformat GUID

App ID of the Gift Card provider. Deprecated.


locationIdstringmaxLength 50

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

Response Object
balancenumberminimum 0maximum 999999999.99

Current balance.


currencyCodestringformat CURRENCY

Currency code.


externalIdstringminLength 1maxLength 50

External ID in the gift card provider's system. Used for integration and tracking across different platforms.

Get Balance

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/balance' \ -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", }'
Response
JSON
{ "balance": 100.0, "currencyCode": "USD" }
Errors
GiftCardNotFoundobjectstatus code: 404
GiftCardDisabledobjectstatus code: 428
GiftCardExpiredobjectstatus code: 428
Did this help?