Skip to content

Platforms

New to the platform layer? Start with the platform integration path.

A platform is a company that operates ChaChing on behalf of many merchants, for example a practice-management system that serves many dental offices. A platform owns companies (one per office) and each company owns accounts (one per practice location). Each account is a full ChaChing account with its own customers, plans, terminals and credentials; the platform acts on it with one key.

ObjectIdYour id
Companycom_...company.external_id
Accountacc_...external_id

Store one platform key per environment, one signing secret per webhook endpoint, and one account id per location.

Get a platform key

Chaching creates your platform and invites your administrator by email. Your administrator registers through the link (it lasts 24 hours and works once) and creates the platform's keys (psk_..., 47 characters) in the platform console at https://stage.chaching.io/platform, under API keys. Creating or rotating a key takes a 6-digit code that the console emails to the signed-in administrator; the code expires after 10 minutes. The console shows a key once, when it is created or rotated, and Chaching never sees it: store it in your secrets manager at that moment. To replace a key, rotate it and choose under Current key expires when the old key stops working: Now, In 1 hour, In 24 hours (the default) or In 7 days. Both keys work until then, so deploy the new key before that moment; a key that already expires sooner keeps its earlier expiry. Revoking a key stops it from the next request and takes no code. A platform has at most 10 live keys, and a rotated key counts until it expires. See Get access.

Authenticate

  • /platform routes take cc-api-key: psk_... and no other credential.
  • Every other route takes cc-api-key: psk_... and Chaching-Account: acc_..., the id of the account the request acts on. Paths, bodies and responses are the same as for an account's own key.
  • Send no Authorization header (see API Basics).
curl https://stage-api.chaching.io/payment-plans \
  -H "cc-api-key: $CHACHING_PLATFORM_KEY" \
  -H "Chaching-Account: $CHACHING_ACCOUNT_ID"
StatusError codeMessageWhen
400no codeMissing apiKey parameterNo cc-api-key header.
400no codeInvalid apiKey formatThe key does not start with pk_, sk_ or psk_.
400CHACHING_ACCOUNT_REQUIREDThis request uses a platform API key: send the Chaching-Account header with the id of the account it acts on.An account route without Chaching-Account.
401no codeInvalid apiKeyThe key is unknown, revoked or expired, your platform is inactive, or the key has an IP allow-list that does not contain your address.
403PLATFORM_API_KEY_REQUIREDThis route requires a platform API key (psk_...)A publishable or secret account key (pk_... or sk_...) on a /platform route.
403SECRET_API_KEY_REQUIREDThis route requires the account secret API key (sk_...)A publishable key on any route outside /platform.
404ACCOUNT_NOT_FOUNDAccount not foundChaching-Account names no account of your platform, whatever the reason.
409no codeThis route authenticates with cc-api-key only; remove the Authorization headerThe request carries an Authorization: Bearer header.
409ACCOUNT_DEACTIVATEDThis account is deactivated. It accepts reads, payment plan cancellations, external payment plan payments, terminal updates, and resolving, canceling or force-closing terminal sales only.A request a deactivated account does not accept. See Deactivate an account.

When a request has several faults, the answer reports one of them, and which one depends on the route: on some routes a publishable key is refused before the key is looked up, on others after. Fix the fault reported and send the request again.

Key scopes

A platform key carries scopes that decide which operations it can call. Choose them when you create the key in the platform console, under Access: Full access (*), or one or more of five classes. Every public operation belongs to exactly one class, and * covers all of them.

ScopeOperations
readEvery GET operation (customers, payment methods, products, transactions, invoices and their document and hosted link, tax rates, prices, subscriptions, balance, revenue recovery, payment plans and their installments and payments, Dejavoo terminals and terminal attempts, webhook endpoints, deliveries and logs, events, email settings, the three credential states, /platform/accounts, /platform/webhook-endpoints and their details and logs, /events, /platform/events, /platform/webhook-deliveries and its detail), plus POST /payment-plans/preview.
operateThe writes on an account's data: customers, products, invoices (including POST /invoices/{id}/send), tax rates, prices, subscriptions (including pause and resume), payment methods (attach, detach, set default), PUT /revenue-recovery, PATCH /email-settings, payment plans (create, cancel, payments, refunds and their forgiveness, resolve, cancel and force-close of terminal sales, deposits), and Dejavoo terminals (POST and PATCH).
accountsPOST /platform/accounts, PATCH /platform/accounts/{id}, POST /platform/accounts/{id}/deactivate and POST /platform/accounts/{id}/reactivate.
processor_credentialsPUT /dejavoo/credentials, PUT /nmi/credentials and PUT /stripe/credentials.
webhooksEvery write on /webhook-endpoints and on /platform/webhook-endpoints (create, update, delete, enable, disable and rotate-secret), and the two resend operations POST /webhook-deliveries/{id}/resend and POST /platform/webhook-deliveries/{id}/resend.

The scopes of a key cannot be changed after the key is created. To change them, create a new key; rotating a key copies its scopes and its IP allow-list to the replacement. A platform key can call only the operations of the API Reference; any other route answers 403 PLATFORM_API_KEY_ROUTE_NOT_ALLOWED.

A key without the scope of an operation answers 403 API_KEY_SCOPE_INSUFFICIENT, and the message names the missing scope. This response is from a key with only the read scope calling POST /platform/accounts:

curl -X POST https://stage-api.chaching.io/platform/accounts \
  -H "cc-api-key: $CHACHING_PLATFORM_KEY_READ_ONLY" \
  -H "Content-Type: application/json" \
  -d '{"external_id": "location-7", "name": "Rosen Family Dental - Main Street", "company": {"external_id": "office-1042", "name": "Rosen Family Dental"}}'
{
  "statusCode": 403,
  "message": "This platform API key lacks the accounts scope required by this operation.",
  "error": "API_KEY_SCOPE_INSUFFICIENT",
  "timestamp": "2026-11-16T16:10:08.245Z",
  "path": "/platform/accounts"
}
StatusError codeWhenWhat to do
403API_KEY_SCOPE_INSUFFICIENTThe key's scopes include neither * nor the scope of the operation.Create a key with the scope the message names.
403PLATFORM_API_KEY_ROUTE_NOT_ALLOWEDThe route is not a public API operation.Call a documented operation.

IP allow-list

A key can carry an IP allow-list: the addresses it can be used from. An empty list accepts every address. Set the list in the platform console when you create the key, or edit it later on the key's row with the 6-digit code the console emails to the signed-in administrator; the change applies from the next request.

  • At most 50 entries.
  • An entry is an IPv4 address in dotted decimal without leading zeros, an IPv6 address, or an address with a prefix (203.0.113.0/24). The prefix is 24 to 32 for IPv4 and 48 to 128 for IPv6, and the address of a range is its network address.
  • An IPv4-mapped IPv6 address (::ffff:...) is refused: write the IPv4 address. Any IPv6 entry inside ::/8 (::, ::1, IPv4-compatible and IPv4-mapped addresses) is refused with 400 IP_ALLOWLIST_INVALID.
  • Duplicate entries are refused. The first entry that fails answers 400 IP_ALLOWLIST_INVALID with a message that names the entry.
  • An IPv4 caller is matched only against IPv4 entries, and an IPv6 caller only against IPv6 entries.

A request from an address outside a key's list answers the generic 401 Invalid apiKey, the same answer as for an unknown key. The console shows the last refused IP address and its time on the key's row. Repeated refusals count toward the refusals limit of Rate limits.

StatusError codeWhenWhat to do
400IP_ALLOWLIST_INVALIDAn entry of the list is not accepted when you create or edit a key.Correct the entry the message names.
401no codeThe key has a list and the request comes from an address outside it.Call from a listed address, or edit the list.

Create an account

curl -X POST https://stage-api.chaching.io/platform/accounts \
  -H "cc-api-key: $CHACHING_PLATFORM_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-account-office-1042-location-7" \
  -d '{
    "external_id": "location-7",
    "name": "Rosen Family Dental - Main Street",
    "company": {
      "external_id": "office-1042",
      "name": "Rosen Family Dental"
    },
    "time_zone": "America/New_York"
  }'
{
  "object": "account",
  "id": "acc_0c194ca27ec457a2f1b50f1f",
  "external_id": "location-7",
  "name": "Rosen Family Dental",
  "company": {
    "id": "com_1779003a63191104815fd879",
    "external_id": "office-1042",
    "name": "Rosen Family Dental"
  },
  "time_zone": "America/New_York",
  "status": "active",
  "deactivated_at": null,
  "created": 1794269584
}

Returns the Account object with status 201. The company is created on its first use and reused afterwards by company.external_id. When an active account of that company already has the same external_id, the request returns it with status 200, unchanged: its name, time_zone and the company name are not updated, and a deactivated account stays deactivated. Two concurrent creates of the same account return one account. To change an account's name or time_zone, see Update an account; no route changes its ids or its company.

  • name is 1 to 255 characters (Unicode code points); control characters are refused with 400. It is stored exactly as sent.
  • time_zone defaults to America/New_York. It accepts an IANA zone whose UTC offset stays between -10:00 and +00:00 all year (the US zones, Pacific/Honolulu, UTC); any other answers 400 ACCOUNT_TIME_ZONE_INVALID. Payment plan dates are calendar days in this zone; billing runs at 10:00 UTC.
  • With an Idempotency-Key, the rules of Idempotency apply. A 500 stored under an Idempotency-Key replays for 24 hours, so repeat the request with the same external_id values and a NEW Idempotency-Key: the create is idempotent on those ids and answers 200 with the existing account or 201.

A new account starts with payment plans enabled, customer emails and owner copies off (your platform sends every notice from webhooks), and the revenue-recovery retries 1, 3, 5 and 7 days with the outcome cancel. Under cancel, a plan whose customer reaches the outcome stops being charged; change it with PUT /revenue-recovery (see Subscription Lifecycle).

StatusError codeWhen
400no codeA field is missing or invalid, or the body has an unknown field.
400ACCOUNT_TIME_ZONE_INVALIDtime_zone is not accepted.
400IDEMPOTENCY_KEY_INVALIDThe key is not 1 to 255 printable ASCII characters without spaces.
409IDEMPOTENCY_KEY_IN_PROGRESSThe first request with this key is still running.
429PLATFORM_ACCOUNT_CREATE_BUSYMore than 5 account creations are in progress. Retry after the Retry-After seconds (2).
422IDEMPOTENCY_KEY_REUSEDThe key was used with a different body.
500no codeThe outcome is unknown: the account may or may not exist. Repeat the request with the same external_id values (company and account) and a new Idempotency-Key: it returns the existing account or creates it. A billing-engine record created during a failed attempt can remain behind.
502IDEMPOTENCY_REQUEST_INCOMPLETEThe first request with this key never completed. Read the account list before you retry with a new key.

List and retrieve accounts

curl -G https://stage-api.chaching.io/platform/accounts \
  -H "cc-api-key: $CHACHING_PLATFORM_KEY" \
  -d company_external_id=office-1042 \
  -d status=active
{
  "data": [
    {
      "object": "account",
      "id": "acc_0c194ca27ec457a2f1b50f1f",
      "external_id": "location-7",
      "name": "Rosen Family Dental",
      "company": {
        "id": "com_1779003a63191104815fd879",
        "external_id": "office-1042",
        "name": "Rosen Family Dental"
      },
      "time_zone": "America/New_York",
      "status": "active",
      "deactivated_at": null,
      "created": 1794269584
    }
  ],
  "meta": {
    "page": 1,
    "take": 10,
    "items_total": 1,
    "pages_total": 1
  }
}

Returns your platform's accounts, newest first, filtered by external_id, company_external_id (both exact) and status (active or deactivated). GET /platform/accounts/{id} returns one account, deactivated ones included; an id that names no account of your platform answers 404 ACCOUNT_NOT_FOUND.

Update an account

curl -X PATCH https://stage-api.chaching.io/platform/accounts/acc_0c194ca27ec457a2f1b50f1f \
  -H "cc-api-key: $CHACHING_PLATFORM_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Rosen Family Dental - Main Street",
    "time_zone": "America/Chicago"
  }'
{
  "object": "account",
  "id": "acc_0c194ca27ec457a2f1b50f1f",
  "external_id": "location-7",
  "name": "Rosen Family Dental - Main Street",
  "company": {
    "id": "com_1779003a63191104815fd879",
    "external_id": "office-1042",
    "name": "Rosen Family Dental"
  },
  "time_zone": "America/Chicago",
  "status": "active",
  "deactivated_at": null,
  "created": 1794269584
}

Returns the Account object with status 200. Only the fields you send change; a field you leave out keeps its value, and a body with no field, or with the values the account already has, returns the account unchanged. Works on a deactivated account. When a value changes, ChaChing sends account.updated. The name is 1 to 255 characters (Unicode code points); control characters are refused. Deliveries of account.updated can arrive out of order: order them by the envelope's created field, and treat GET /platform/accounts/{id} as the authoritative current state.

A new time_zone applies to payment plans you create afterwards (their default start date and their down-payment due date) and to the dates ChaChing renders; plans that already exist keep their dates. It accepts the zones the create accepts.

StatusError codeWhen
400no codeA field is not a string, is null, a name is not 1 to 255 characters (Unicode code points) or contains a control character, or the body has another field (external_id and company included).
400ACCOUNT_TIME_ZONE_INVALIDtime_zone is not accepted.
404ACCOUNT_NOT_FOUNDThe id names no account of your platform.

Set up a location

Run these in order for each new location:

  1. POST /platform/accounts, and store the id.
  2. PUT /dejavoo/credentials with Chaching-Account: the location's iPOSpays e-commerce TPN, API key, secret key and e-commerce token (all four required; the FEED signing key and Google Pay merchant id are optional). On staging use iPOSpays UAT credentials. See Processor Credentials. To receive the location's FEED notifications, include feed_signing_key and give Dejavoo the location's FEED webhook URL; see The Dejavoo FEED Webhook URL.
  3. POST /dejavoo/terminals for each terminal. Before step 2 it answers 409 DEJAVOO_NOT_CONFIGURED.
  4. POST /customers, then the payment plans. Before step 2, POST /customers answers 409 PAYMENT_GATEWAY_NOT_CONFIGURED with the message This account has no payment gateway credentials. Save the payment gateway credentials before creating customers.

Read the credential state of a location with GET /dejavoo/credentials.

Platform webhooks

POST /platform/webhook-endpoints registers an endpoint that receives the events of every account of your platform, including accounts created later. The nine /platform/webhook-endpoints operations take the same bodies and answer the same objects as the account-level webhook endpoint operations; your platform holds at most 16 endpoints. An event of an account goes to that account's own endpoints and to your platform's endpoints with the same event id; deduplicate on it.

An account of your platform also sends account.updated when its name, time_zone or status changes (an update, a deactivation, a reactivation, or a time-zone change made by ChaChing). The event's data is the Account object after the change.

Each delivery's envelope names the account:

"account": {
  "id": "acc_9f3a1c7e5b2d4086a1c3e5f7",
  "external_id": "location-7",
  "company": {
    "id": "com_Hp3sJ6uK9wE2rT5yA8zX1vB4",
    "external_id": "office-1042"
  }
}

Endpoints created with a key keep receiving events after that key is revoked; delete or disable the endpoint to stop them.

GET /platform/webhook-deliveries lists the deliveries to your endpoints across all your accounts, each with its account; filter by account, status and the other delivery filters. GET /platform/webhook-deliveries/{id} answers one with its payload and attempts, and POST /platform/webhook-deliveries/{id}/resend sends it again. GET /platform/events lists the events of all your accounts.

Deactivate an account

POST /platform/accounts/{id}/deactivate and /reactivate answer the Account object; repeating one changes nothing. Each state change sends account.updated; its deliveries can arrive out of order, so order them by the envelope's created field and treat GET /platform/accounts/{id} as the authoritative current state. While an account is deactivated:

  • Every GET, POST /payment-plans/{id}/cancel and PATCH /dejavoo/terminals/{id} work.
  • The routes that finish a terminal sale already started work: POST /payment-plans/{id}/deposit, POST /payment-plans/{id}/deposit/cancel, POST /payment-plans/{id}/payments/{payment_id}/resolve, POST /payment-plans/{id}/payments/{payment_id}/cancel and POST /dejavoo/terminal-attempts/{id}/force-close.
  • POST /payment-plans/{id}/payments works only with "external": true (a payment collected outside ChaChing); a payment on a saved card or on a terminal answers 409 ACCOUNT_DEACTIVATED. On a plan in awaiting_deposit, it records the deposit the practice collected at its front desk and activates the plan; on a deactivated account it is recorded only without a card (no payment_method); see Record a Deposit Collected Outside Chaching.
  • PATCH /payment-plans/{id} with { "payment_method": null } works (it removes the plan's card); naming a card answers 409 ACCOUNT_DEACTIVATED.
  • Every other write answers 409 ACCOUNT_DEACTIVATED and changes nothing, including POST /payment-plans/preview, starting a terminal deposit, credential saves, email settings and webhook endpoint writes.
  • Scheduled installments, retries and webhooks keep running.
  • To cancel a plan whose terminal sale is still open, first resolve or cancel the sale (or force-close a stuck attempt), then cancel the plan.

What does not apply to a platform account

  • No dashboard, no users, no bank account, no ChaChing monthly fee.
  • The account's own publishable and secret keys do not exist; a key of that kind answers 401 Invalid apiKey.
  • Hosted checkout and invoice pages: they do not work for a platform account: the hosted_invoice_url of its invoices and the checkout address of its prices open on "Invalid or expired token — The requested item could not be found." (observed on staging, 2026-11-10). Collect payments on a platform account through the API and your own pages.
  • Platform keys are created, rotated and revoked in the platform console, not through the public API. They carry scopes and an optional IP allow-list, and have their own quotas of 6,000 requests per platform and 600 per account per minute; see Rate limits.

Environment

The platform layer exists on staging today; every /platform operation carries Staging only in the API Reference. Production receives it in a later promotion, with its own platform key.