Redeem a gift card
POST
https://api.zenoti.com/v1/gift_cards/{gift_card_id}/redeem
Redeems a specified amount from a gift card against an invoice.
Before you begin
Permission: Manage API Keys (under Administrator ) — Required to access Zenoti APIs.
Endpoint
POST /v1/gift_cards/{gift_card_id}/redeem
Base URL: https://api.zenoti.com
Request
Path parameters
Request body
Response
Success (200 OK)
{
"is_redeemed": true,
"remaining_balance": 50.00,
"transaction_id": "00000000-0000-0000-0000-06958da2f43e",
"error": null
}
Response fields
Example
curl --request POST \
--url 'https://api.zenoti.com/v1/gift_cards/b3c4d5e6-f7a8-9012-cdef-345678901234/redeem' \
--header 'Authorization: bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"amount": 25.00,
"invoice_id": "a2b3c4d5-e6f7-8901-bcde-f23456789012",
"center_id": "a3614939-16c0-4a7b-bc33-a69b106d855c"
}'
const response = await fetch('https://api.zenoti.com/v1/gift_cards/{gift_card_id}/redeem', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({ amount: 25, invoice_id: 'a2b3c4d5-e6f7-8901-bcde-f23456789012', center_id: 'a3614939-16c0-4a7b-bc33-a69b106d855c' })
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/v1/gift_cards/{gift_card_id}/redeem',
headers={
'Authorization': 'bearer {{access_token}}',
},
json={'amount': 25, 'invoice_id': 'a2b3c4d5-e6f7-8901-bcde-f23456789012', 'center_id': 'a3614939-16c0-4a7b-bc33-a69b106d855c'}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
JsonSerializer.Serialize(new { amount = 25, invoiceId = "a2b3c4d5-e6f7-8901-bcde-f23456789012", centerId = "a3614939-16c0-4a7b-bc33-a69b106d855c" }),
Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.zenoti.com/v1/gift_cards/{gift_card_id}/redeem", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/gift_cards/{gift_card_id}/redeem')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
request['Content-Type'] = 'application/json'
request.body = { amount: 25, invoice_id: 'a2b3c4d5-e6f7-8901-bcde-f23456789012', center_id: 'a3614939-16c0-4a7b-bc33-a69b106d855c' }.to_json
response = http.request(request)
data = JSON.parse(response.body)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.zenoti.com/v1/gift_cards/{gift_card_id}/redeem');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: bearer {{access_token}}',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['amount' => 25, 'invoice_id' => 'a2b3c4d5-e6f7-8901-bcde-f23456789012', 'center_id' => 'a3614939-16c0-4a7b-bc33-a69b106d855c']));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
Error codes