Verify the balance of a gift card
This API helps you to verify the balance of a guest's Zenoti gift card.
If the guest's gift card contains sufficient balance, you can redeem the gift card to collect payment for an invoice.
You must specify appropriate data for the giftcard_number parameter.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
GET /v1/giftcards/{giftcard_number}/balance
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| giftcard_number | string | Yes | Mandatory Unique number of the guest's gift card. |
Response
Success (200 OK)
{
"balance": 9336,
"user_id": "36fa5713-8ea2-4d66-9c22-0423344886b4",
"expiry": "2050-10-17T00:00:00",
"type": "AMOUNT GIFTCARD",
"status": "Available",
"error": {
"code": 436,
"message": "Gift Card Does not exist."
}
}
Response fields
| Field | Type | Description |
|---|---|---|
| balance | integer | |
| user_id | string | |
| expiry | string | |
| type | string | |
| status | string | |
| error | object | |
| error.code | integer | |
| error.message | string |
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/giftcards/{giftcard_number}/balance' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/giftcards/{giftcard_number}/balance', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/giftcards/{giftcard_number}/balance',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
"https://api.zenoti.com/v1/giftcards/{giftcard_number}/balance");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/giftcards/{giftcard_number}/balance')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |