Retrieve the saved credit/debit cards of a guest
This API helps you to retrieve the saved credit/debit cards of a guest at the specified center.
You must specify appropriate details for the parameters in the API request. For more information, refer to the Request Parameters table.
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 /Guests/{GuestId}/CreditCardsOnFile
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| guestid | string | Yes | Unique identifier of a guest. |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| CenterId | string | Yes | — | Mandatory Unique 32-character identifier of the center. |
| TransactionFrom | enum () | No | — | Optional Indicates the source of the transaction: Web = 1, WebStore = 2, CheckWeb = 4, Mobile = 8, MobilePOS = 16. |
Response
Success (200 OK)
{
"Error": {},
"CreditCardsOnFile": [
{
"...": "..."
}
],
"HasExpiredCards": false
}
Response fields
| Field | Type | Description |
|---|---|---|
| Error | object | |
| CreditCardsOnFile | object[] | |
| CreditCardsOnFile[].Id | string | |
| CreditCardsOnFile[].CardBrand | integer | |
| CreditCardsOnFile[].CardType | integer | |
| CreditCardsOnFile[].LastFour | string | |
| CreditCardsOnFile[].ExpirationMonth | integer | |
| CreditCardsOnFile[].ExpirationYear | integer | |
| CreditCardsOnFile[].ExtParams | object | |
| CreditCardsOnFile[].IsSupportedCardType | boolean | |
| CreditCardsOnFile[].ProcessorId | string | |
| CreditCardsOnFile[].ProcessorName | string | |
| HasExpiredCards | boolean |
Example
curl --request GET \
--url 'https://api.zenoti.com/Guests/{GuestId}/CreditCardsOnFile?CenterId={{CenterId}}' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/Guests/{GuestId}/CreditCardsOnFile', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/Guests/{GuestId}/CreditCardsOnFile',
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/Guests/{GuestId}/CreditCardsOnFile");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/Guests/{GuestId}/CreditCardsOnFile')
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 |