Payments
Money received from clients (the revenues ledger), credits included.
The payment object
Every payment record carries these fields in this order, after object, which is always "payment".
| Field | Type | Description |
|---|---|---|
id | integer | |
client_id | integer | The client (see Clients). |
revenue_amount | decimal | In the account currency, 2 decimals. Negative for a debit; may be 0.00 on a package payment. |
revenue_date | string, up to 15 characters | The day the money was received, YYYY-MM-DD. |
revenue_credit | integer | 0 = regular payment, 1 = credit, 2 = debit, 3 = package payment. |
revenue_source | string, up to 255 characters | How the money was received: credit_card, cash, check, crypto, direct_debit, other, or one of the account's own sources. A credit or a debit is created with other. |
revenue_note | text | |
package_id | integer | The package this payment bought (see Packages); 0 when it bought none. |
Example
{
"object": "payment",
"id": 42,
"client_id": 7,
"revenue_amount": 25.5,
"revenue_date": "2026-01-15",
"revenue_credit": 1,
"revenue_source": "text",
"revenue_note": "An example note.",
"package_id": 7
} List payments
Parameters
| Parameter | In | Description |
|---|---|---|
limit | query | Records per page, 1 to 1000 (default 100). |
offset | query | Records to skip (default 0). |
client_id | query | Only payments of this client. |
Returns
A list envelope of payment records (see Pagination).
Request
curl "https://www.bizstim.com/api/v1/payments" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Accept: application/json"<?php
$ch = curl_init('https://www.bizstim.com/api/v1/payments');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-KEY: YOUR_API_KEY', 'Accept: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);const response = await fetch('https://www.bizstim.com/api/v1/payments', {
headers: { 'X-API-KEY': 'YOUR_API_KEY', 'Accept': 'application/json' }
});
const data = await response.json();Response
{
"object": "list",
"total": 2,
"limit": 100,
"offset": 0,
"has_more": false,
"data": [
{
"object": "payment",
"id": 42,
"client_id": 7,
"revenue_amount": 25.5,
"revenue_date": "2026-01-15",
"revenue_credit": 1,
"revenue_source": "text",
"revenue_note": "An example note.",
"package_id": 7
},
{
"object": "payment",
"id": 43,
"client_id": 7,
"revenue_amount": 25.5,
"revenue_date": "2026-01-15",
"revenue_credit": 1,
"revenue_source": "text",
"revenue_note": "An example note.",
"package_id": 7
}
]
} Retrieve a payment
Parameters
| Parameter | In | Description |
|---|---|---|
id | path | The record's id. |
Returns
One payment record, or 404 not_found when no record with that id exists on your account.
Request
curl "https://www.bizstim.com/api/v1/payments/42" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Accept: application/json"<?php
$ch = curl_init('https://www.bizstim.com/api/v1/payments/42');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-KEY: YOUR_API_KEY', 'Accept: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);const response = await fetch('https://www.bizstim.com/api/v1/payments/42', {
headers: { 'X-API-KEY': 'YOUR_API_KEY', 'Accept': 'application/json' }
});
const data = await response.json();Response
{
"object": "payment",
"id": 42,
"client_id": 7,
"revenue_amount": 25.5,
"revenue_date": "2026-01-15",
"revenue_credit": 1,
"revenue_source": "text",
"revenue_note": "An example note.",
"package_id": 7
} Record a payment
Request body
A JSON object (Content-Type: application/json) with these fields.
| Field | Type | Required | Description |
|---|---|---|---|
client_id | integer | yes | A client of the account, any status (active, inactive or prospect). |
revenue_amount | number, 2 decimals | yes | From 0.01 to 99999999.99 (a package payment may be 0.00). A debit is stored negative whatever the sign sent; a negative payment or credit is refused. |
revenue_date | string, YYYY-MM-DD | no | The day the money was received. Default today, in the account's time zone. |
revenue_credit | integer | no | The type: 0 payment (default), 1 credit, 2 debit, 3 package payment (only while the account is in package mode; package_id is then required). |
revenue_source | string | no | How the money was received: credit_card (default), cash, check, crypto, direct_debit, other, or one of the account's own sources (Payments > Sources in the app), spelled as listed there. A credit or a debit is always stored as other. |
revenue_note | string | no | A note on the payment. HTML is cleaned on save. |
package_id | integer | with revenue_credit 3 | The package bought: an active or secret package of the account (see Packages). Only taken with revenue_credit 3. |
send_email | boolean | no | E-mail the client a receipt, as the app's add page offers. Default false. |
check_unpaid_invoices | boolean | no | Mark the client's unpaid invoices paid, oldest first, for each one the amount covers, as the app's add page offers. Payments and credits only (revenue_credit 0 or 1). Default false. |
Returns
201 with the new payment record. The client's balance is brought up to date, as when a payment is added in the app. 400 invalid_request names the field to fix; 409 conflict when package_id is not an active or secret package of the account.
Request
curl -X POST "https://www.bizstim.com/api/v1/payments" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"client_id": 52,
"revenue_amount": 120.5,
"revenue_date": "2026-10-11",
"revenue_source": "cash"
}'<?php
$ch = curl_init('https://www.bizstim.com/api/v1/payments');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"client_id": 52,
"revenue_amount": 120.5,
"revenue_date": "2026-10-11",
"revenue_source": "cash"
}',
CURLOPT_HTTPHEADER => ['X-API-KEY: YOUR_API_KEY', 'Accept: application/json', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);const response = await fetch('https://www.bizstim.com/api/v1/payments', {
method: 'POST',
headers: { 'X-API-KEY': 'YOUR_API_KEY', 'Accept': 'application/json', 'Content-Type': 'application/json' },
body: JSON.stringify({
"client_id": 52,
"revenue_amount": 120.5,
"revenue_date": "2026-10-11",
"revenue_source": "cash"
})
});
const data = await response.json();Response (201)
{
"object": "payment",
"id": 42,
"client_id": 7,
"revenue_amount": 25.5,
"revenue_date": "2026-01-15",
"revenue_credit": 1,
"revenue_source": "text",
"revenue_note": "An example note.",
"package_id": 7
} Update a payment
Parameters
| Parameter | In | Description |
|---|---|---|
id | path | The record's id. |
Request body
A JSON object (Content-Type: application/json) with these fields.
| Field | Type | Required | Description |
|---|---|---|---|
revenue_amount | number, 2 decimals | no | As on create. A debit is stored negative. |
revenue_date | string, YYYY-MM-DD | no | The day the money was received. |
revenue_credit | integer | no | The type: 0 payment, 1 credit, 2 debit, changed among each other outside package mode only. |
revenue_source | string | no | One of the sources listed on create, or the value the payment already holds. Unlike create, a credit or a debit keeps the source sent. |
revenue_note | string | no | A note on the payment ("" clears it). HTML is cleaned on save. |
Returns
200 with the updated payment record. Fields left out keep their values; the client and the package cannot be changed. A payment taken by card through Stripe takes revenue_date and revenue_note only: a different amount, type or source answers 409 (refund it in the app). In package mode the type cannot be changed, and a package payment can be edited only in package mode (409). 400 invalid_request names the field to fix; 404 not_found.
Request
curl -X PATCH "https://www.bizstim.com/api/v1/payments/42" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"revenue_amount": 95,
"revenue_note": "Paid at the front desk."
}'<?php
$ch = curl_init('https://www.bizstim.com/api/v1/payments/42');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => '{
"revenue_amount": 95,
"revenue_note": "Paid at the front desk."
}',
CURLOPT_HTTPHEADER => ['X-API-KEY: YOUR_API_KEY', 'Accept: application/json', 'Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);const response = await fetch('https://www.bizstim.com/api/v1/payments/42', {
method: 'PATCH',
headers: { 'X-API-KEY': 'YOUR_API_KEY', 'Accept': 'application/json', 'Content-Type': 'application/json' },
body: JSON.stringify({
"revenue_amount": 95,
"revenue_note": "Paid at the front desk."
})
});
const data = await response.json();Response
{
"object": "payment",
"id": 42,
"client_id": 7,
"revenue_amount": 25.5,
"revenue_date": "2026-01-15",
"revenue_credit": 1,
"revenue_source": "text",
"revenue_note": "An example note.",
"package_id": 7
} Delete a payment
Parameters
| Parameter | In | Description |
|---|---|---|
id | path | The record's id. |
Returns
200 with {"id", "object": "payment", "deleted": true}; the client's balance is brought up to date. 404 not_found; 409 conflict for a payment taken by card through Stripe (refund it in the app), and for a package payment whose sessions are already used, as in the app.
Request
curl -X DELETE "https://www.bizstim.com/api/v1/payments/42" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Accept: application/json"<?php
$ch = curl_init('https://www.bizstim.com/api/v1/payments/42');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['X-API-KEY: YOUR_API_KEY', 'Accept: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);const response = await fetch('https://www.bizstim.com/api/v1/payments/42', {
method: 'DELETE',
headers: { 'X-API-KEY': 'YOUR_API_KEY', 'Accept': 'application/json' }
});
const data = await response.json();Response
{
"id": 42,
"object": "payment",
"deleted": true
}