Collect payment for a class booking by using the guest's saved credit/debit card
This API helps you to collect payment for the class booking by using the guest's saved credit/debit card.
You must specify appropriate details for the parameters in the API request body. For more information, refer to the Request Body 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
POST /Catalog/Payments/Invoice/IntializeCloudPayment
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| transactionDetails | object | No | — | Object that contains various transaction-related elements. For more information, refer to the transactionDetails Object table. |
| billingInfo | object | No | — | Object that contains various billing-related elements. For more information, refer to the billingInfo Object table. |
| shippingInfo | object | No | — | Object that contains various shipping-related elements. For more information, refer to the shippingInfo Object table. |
| paymentDetails | object | No | — | Object that contains various payment-related elements. For more information, refer to the paymentDetails Object table. |
Response
Success (201 Created)
{
"InvoiceTransactionId": "95cdc4fc-9697-45b2-ac47-7626a5d3b2c7",
"PrintReciept": false,
"TransactionId": "853600952732259G",
"RequireSignature": false,
"success": true,
"ToastMessage": {},
"Error": {},
"HostedPaymentURL": {},
"TokenFK": {},
"ProcessingMessage": {}
}
Response fields
| Field | Type | Description |
|---|---|---|
| InvoiceTransactionId | string | |
| PrintReciept | boolean | |
| TransactionId | string | |
| RequireSignature | boolean | |
| success | boolean | |
| ToastMessage | object | |
| Error | object | |
| HostedPaymentURL | object | |
| TokenFK | object | |
| ProcessingMessage | object |
Example
curl --request POST \
--url 'https://api.zenoti.com/Catalog/Payments/Invoice/IntializeCloudPayment' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/Catalog/Payments/Invoice/IntializeCloudPayment', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/Catalog/Payments/Invoice/IntializeCloudPayment',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.PostAsync(
"https://api.zenoti.com/Catalog/Payments/Invoice/IntializeCloudPayment");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/Catalog/Payments/Invoice/IntializeCloudPayment')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.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 |