Add a payment to an invoice

POST https://api.zenoti.com/v1/invoices/{invoice_id}/payments

Records a payment against an open invoice. Supports cash, card, gift card, loyalty points, and custom payment methods.

Before you begin

Permission: Manage API Keys (under Administrator) — Required to access Zenoti APIs.

Endpoint

POST /v1/invoices/{invoice_id}/payments

Base URL: https://api.zenoti.com

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Path parameters

Parameter Type Required Description
invoice_id string (GUID) Yes Invoice identifier

Request body

Field Type Required Description
payment_mode integer Yes 0=Cash, 1=Card, 2=GiftCard, 3=LoyaltyPoints, 4=Custom
amount decimal Yes Payment amount
gift_card_code string No Gift card code (required when payment_mode=2)
transaction_reference string No External transaction reference for card payments

Response

Success (200 OK)

{
  "transaction_id": "00000000-0000-0000-0000-2e6c5e7c7449",
  "remaining_balance": 0.00,
  "error": null
}

Response fields

Field Type Description
transaction_id string (GUID) Payment transaction identifier
remaining_balance decimal Remaining invoice balance after payment

Example

curl --request POST \
  --url 'https://api.zenoti.com/v1/invoices/a2b3c4d5-e6f7-8901-bcde-f23456789012/payments' \
  --header 'Authorization: bearer {{access_token}}' \
  --header 'Content-Type: application/json' \
  --data '{ "payment_mode": 0, "amount": 130.80 }'
const response = await fetch('https://api.zenoti.com/v1/invoices/{invoice_id}/payments', {
  method: 'POST',
  headers: {
    'Authorization': 'bearer {{access_token}}',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ payment_mode: 0, amount: 130.8 })
});
const data = await response.json();
import requests

response = requests.post(
    'https://api.zenoti.com/v1/invoices/{invoice_id}/payments',
    headers={
        'Authorization': 'bearer {{access_token}}',
    },
    json={'payment_mode': 0, 'amount': 130.8}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
    JsonSerializer.Serialize(new { paymentMode = 0, amount = 130.8 }),
    Encoding.UTF8, "application/json");
var response = await client.PostAsync(
    "https://api.zenoti.com/v1/invoices/{invoice_id}/payments", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/invoices/{invoice_id}/payments')
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 = { payment_mode: 0, amount: 130.8 }.to_json
response = http.request(request)
data = JSON.parse(response.body)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.zenoti.com/v1/invoices/{invoice_id}/payments');
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(['payment_mode' => 0, 'amount' => 130.8]));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);

Error codes

Status Description
400 Bad request — invalid or missing required fields
401 Unauthorized — invalid or expired access token
429 Too many requests — rate limit exceeded (60/min)
418 Invoice not found
419 Amount exceeds invoice balance