Add a credit/debit card for a guest
POST
https://api.zenoti.com/v1/guests/{guest_id}/accounts
Add a credit/debit card for a guest
On this page
Before you begin
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
POST /v1/guests/{guest_id}/accounts
Base URL: https://api.zenoti.com
Request
Path parameters
Request body
Response
Success (201 Created)
{
"success": true,
"error": {},
"hosted_payment_uri": "https://secure-payment.zenoti.com/add-card?token=550e8400-e29b-41d4-a716-446655440124&redirect=https%3A%2F%2Fexample.com%2Fcard-added-success",
"token_id": "550e8400-e29b-41d4-a716-446655440124"
}
Response fields
Example
curl --request POST \
--url 'https://api.zenoti.com/v1/guests/{guest_id}/accounts' \
--header 'Authorization: bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"center_id": "string",
"redirect_uri": "string",
"source": "1",
"host": "string",
"avs_source": "string",
"billing_info": {
"first_name": "string",
"last_name": "string",
"email": "string",
"country": "string",
"name": "string",
"address": "string",
"state": "string",
"zipcode": "string",
"city": "string",
"phone": "string",
"house_number": "string",
"address2": "string"
}
}'
const response = await fetch('https://api.zenoti.com/v1/guests/{guest_id}/accounts', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
center_id: 'string',
redirect_uri: 'string',
source: '1',
host: 'string',
avs_source: 'string',
billing_info: {
first_name: 'string',
last_name: 'string',
email: 'string',
country: 'string',
name: 'string',
address: 'string',
state: 'string',
zipcode: 'string',
city: 'string',
phone: 'string',
house_number: 'string',
address2: 'string'
}
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/v1/guests/{guest_id}/accounts',
headers={
'Authorization': 'bearer {{access_token}}',
},
json={'center_id': 'string', 'redirect_uri': 'string', 'source': '1', 'host': 'string', 'avs_source': 'string', 'billing_info': {'first_name': 'string', 'last_name': 'string', 'email': 'string', 'country': 'string', 'name': 'string', 'address': 'string', 'state': 'string', 'zipcode': 'string', 'city': 'string', 'phone': 'string', 'house_number': 'string', 'address2': 'string'}}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
JsonSerializer.Serialize(new {
center_id = "string",
redirect_uri = "string",
source = "1",
host = "string",
avs_source = "string",
billing_info = new {
first_name = "string",
last_name = "string",
email = "string",
country = "string",
name = "string",
address = "string",
state = "string",
zipcode = "string",
city = "string",
phone = "string",
house_number = "string",
address2 = "string"
}
}),
Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.zenoti.com/v1/guests/{guest_id}/accounts", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/guests/{guest_id}/accounts')
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 = { center_id: 'string', redirect_uri: 'string', source: '1', host: 'string', avs_source: 'string', billing_info: { first_name: 'string', last_name: 'string', email: 'string', country: 'string', name: 'string', address: 'string', state: 'string', zipcode: 'string', city: 'string', phone: 'string', house_number: 'string', address2: 'string' } }.to_json
response = http.request(request)
data = JSON.parse(response.body)
Error codes