List all prepaid cards of a guest
Provide unique identifier of the guest as guest_id and this api will retrieve the prepaid cards history of the respective guest.
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/guests/{guest_id}/prepaidcards
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| guest_id | string | Yes | Unique identifier of the guest. |
Response
Success (200 OK)
{
"guest_prepaid_cards": [
{
"...": "..."
}
],
"error": {}
}
Response fields
| Field | Type | Description |
|---|---|---|
| guest_prepaid_cards | object[] | |
| guest_prepaid_cards[].prepaid_card_user_id | string | |
| guest_prepaid_cards[].prepaid_card_number | string | |
| guest_prepaid_cards[].invoice | object | |
| guest_prepaid_cards[].center | object | |
| guest_prepaid_cards[].purchase_details | object | |
| guest_prepaid_cards[].expiration_date | string | |
| guest_prepaid_cards[].value | integer | |
| guest_prepaid_cards[].balance | integer | |
| guest_prepaid_cards[].is_closed | boolean | |
| guest_prepaid_cards[].is_one_time_use | boolean | |
| guest_prepaid_cards[].has_open_invoices | integer | |
| guest_prepaid_cards[].sale_receipt_no | object | |
| guest_prepaid_cards[].sale_invoice | object | |
| guest_prepaid_cards[].notes | string | |
| error | object |
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/guests/{guest_id}/prepaidcards' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/guests/{guest_id}/prepaidcards', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/guests/{guest_id}/prepaidcards',
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/guests/{guest_id}/prepaidcards");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/guests/{guest_id}/prepaidcards')
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 |