{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Platforms"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"platforms","__idx":0},"children":["Platforms"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["New to the platform layer? Start with the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/platform-path"},"children":["platform integration path"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["companies"]}," (one per office) and each company owns ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Object"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Object"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Id"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Id"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Your id"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Your id"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Company"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["com_..."]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["company.external_id"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Account"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["acc_..."]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["external_id"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Store one platform key per environment, one signing secret per webhook endpoint, and one account id per location."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"get-a-platform-key","__idx":1},"children":["Get a platform key"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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 (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["psk_..."]},", 47 characters) in the platform console at ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://stage.chaching.io/platform"]},", under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Current key expires"]}," when the old key stops working: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Now"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["In 1 hour"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["In 24 hours"]}," (the default) or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/integrating-staging#get-access"},"children":["Get access"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authenticate","__idx":2},"children":["Authenticate"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/platform"]}," routes take ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cc-api-key: psk_..."]}," and no other credential."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Every other route takes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cc-api-key: psk_..."]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Send no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," header (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/api-basics#authentication"},"children":["API Basics"]},")."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl https://stage-api.chaching.io/payment-plans \\\n  -H \"cc-api-key: $CHACHING_PLATFORM_KEY\" \\\n  -H \"Chaching-Account: $CHACHING_ACCOUNT_ID\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Status"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error code"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Error code"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Message"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Message"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"When"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["When"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["no code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Missing apiKey parameter"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cc-api-key"]}," header."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["no code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invalid apiKey format"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The key does not start with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pk_"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sk_"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["psk_"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CHACHING_ACCOUNT_REQUIRED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["This request uses a platform API key: send the Chaching-Account header with the id of the account it acts on."]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An account route without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Chaching-Account"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["no code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invalid apiKey"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The key is unknown, revoked or expired, your platform is inactive, or the key has an ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#ip-allow-list"},"children":["IP allow-list"]}," that does not contain your address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PLATFORM_API_KEY_REQUIRED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["This route requires a platform API key (psk_...)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A publishable or secret account key (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pk_..."]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sk_..."]},") on a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/platform"]}," route."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SECRET_API_KEY_REQUIRED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["This route requires the account secret API key (sk_...)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A publishable key on any route outside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/platform"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ACCOUNT_NOT_FOUND"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Account not found"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Chaching-Account"]}," names no account of your platform, whatever the reason."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["no code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["This route authenticates with cc-api-key only; remove the Authorization header"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The request carries an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: Bearer"]}," header."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ACCOUNT_DEACTIVATED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["This account is deactivated. It accepts reads, payment plan cancellations, external payment plan payments, terminal updates, and resolving, canceling or force-closing terminal sales only."]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A request a deactivated account does not accept. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#deactivate-an-account"},"children":["Deactivate an account"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"key-scopes","__idx":3},"children":["Key scopes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A platform key carries scopes that decide which operations it can call. Choose them when you create the key in the platform console, under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Access"]},": ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Full access"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["*"]},"), or one or more of five classes. Every public operation belongs to exactly one class, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["*"]}," covers all of them."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Scope"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Scope"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Operations"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Operations"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["read"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Every ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/platform/accounts"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/platform/webhook-endpoints"]}," and their details and logs, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/events"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/platform/events"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/platform/webhook-deliveries"]}," and its detail), plus ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /payment-plans/preview"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["operate"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The writes on an account's data: customers, products, invoices (including ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /invoices/{id}/send"]},"), tax rates, prices, subscriptions (including pause and resume), payment methods (attach, detach, set default), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /revenue-recovery"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PATCH /email-settings"]},", payment plans (create, cancel, payments, refunds and their forgiveness, resolve, cancel and force-close of terminal sales, deposits), and Dejavoo terminals (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PATCH"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accounts"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /platform/accounts"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PATCH /platform/accounts/{id}"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /platform/accounts/{id}/deactivate"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /platform/accounts/{id}/reactivate"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["processor_credentials"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /dejavoo/credentials"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /nmi/credentials"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /stripe/credentials"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["webhooks"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Every write on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/webhook-endpoints"]}," and on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/platform/webhook-endpoints"]}," (create, update, delete, enable, disable and rotate-secret), and the two resend operations ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /webhook-deliveries/{id}/resend"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /platform/webhook-deliveries/{id}/resend"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/api"},"children":["API Reference"]},"; any other route answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403 PLATFORM_API_KEY_ROUTE_NOT_ALLOWED"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A key without the scope of an operation answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403 API_KEY_SCOPE_INSUFFICIENT"]},", and the message names the missing scope. This response is from a key with only the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["read"]}," scope calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /platform/accounts"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://stage-api.chaching.io/platform/accounts \\\n  -H \"cc-api-key: $CHACHING_PLATFORM_KEY_READ_ONLY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"external_id\": \"location-7\", \"name\": \"Rosen Family Dental - Main Street\", \"company\": {\"external_id\": \"office-1042\", \"name\": \"Rosen Family Dental\"}}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"statusCode\": 403,\n  \"message\": \"This platform API key lacks the accounts scope required by this operation.\",\n  \"error\": \"API_KEY_SCOPE_INSUFFICIENT\",\n  \"timestamp\": \"2026-11-16T16:10:08.245Z\",\n  \"path\": \"/platform/accounts\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Status"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error code"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Error code"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"When"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["When"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What to do"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["What to do"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_KEY_SCOPE_INSUFFICIENT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The key's scopes include neither ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["*"]}," nor the scope of the operation."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create a key with the scope the message names."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PLATFORM_API_KEY_ROUTE_NOT_ALLOWED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The route is not a public API operation."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Call a documented operation."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ip-allow-list","__idx":4},"children":["IP allow-list"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["At most 50 entries."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An entry is an IPv4 address in dotted decimal without leading zeros, an IPv6 address, or an address with a prefix (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An IPv4-mapped IPv6 address (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["::ffff:..."]},") is refused: write the IPv4 address. Any IPv6 entry inside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["::/8"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["::"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["::1"]},", IPv4-compatible and IPv4-mapped addresses) is refused with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 IP_ALLOWLIST_INVALID"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Duplicate entries are refused. The first entry that fails answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 IP_ALLOWLIST_INVALID"]}," with a message that names the entry."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An IPv4 caller is matched only against IPv4 entries, and an IPv6 caller only against IPv6 entries."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A request from an address outside a key's list answers the generic ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/api-basics#rate-limits"},"children":["Rate limits"]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Status"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error code"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Error code"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"When"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["When"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What to do"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["What to do"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IP_ALLOWLIST_INVALID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An entry of the list is not accepted when you create or edit a key."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Correct the entry the message names."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["no code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The key has a list and the request comes from an address outside it."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Call from a listed address, or edit the list."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-an-account","__idx":5},"children":["Create an account"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST https://stage-api.chaching.io/platform/accounts \\\n  -H \"cc-api-key: $CHACHING_PLATFORM_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: create-account-office-1042-location-7\" \\\n  -d '{\n    \"external_id\": \"location-7\",\n    \"name\": \"Rosen Family Dental - Main Street\",\n    \"company\": {\n      \"external_id\": \"office-1042\",\n      \"name\": \"Rosen Family Dental\"\n    },\n    \"time_zone\": \"America/New_York\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"object\": \"account\",\n  \"id\": \"acc_0c194ca27ec457a2f1b50f1f\",\n  \"external_id\": \"location-7\",\n  \"name\": \"Rosen Family Dental\",\n  \"company\": {\n    \"id\": \"com_1779003a63191104815fd879\",\n    \"external_id\": \"office-1042\",\n    \"name\": \"Rosen Family Dental\"\n  },\n  \"time_zone\": \"America/New_York\",\n  \"status\": \"active\",\n  \"deactivated_at\": null,\n  \"created\": 1794269584\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns the Account object with status ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["201"]},". The company is created on its first use and reused afterwards by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["company.external_id"]},". When an active account of that company already has the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["external_id"]},", the request returns it with status ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},", unchanged: its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time_zone"]}," and the company ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time_zone"]},", see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#update-an-account"},"children":["Update an account"]},"; no route changes its ids or its company."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}," is 1 to 255 characters (Unicode code points); control characters are refused with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]},". It is stored exactly as sent."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time_zone"]}," defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["America/New_York"]},". It accepts an IANA zone whose UTC offset stays between -10:00 and +00:00 all year (the US zones, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Pacific/Honolulu"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UTC"]},"); any other answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 ACCOUNT_TIME_ZONE_INVALID"]},". Payment plan dates are calendar days in this zone; billing runs at 10:00 UTC."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["With an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]},", the rules of ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/integrating-staging#idempotency"},"children":["Idempotency"]}," apply. A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["500"]}," stored under an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]}," replays for 24 hours, so repeat the request with the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["external_id"]}," values and a NEW ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Idempotency-Key"]},": the create is idempotent on those ids and answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]}," with the existing account or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["201"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cancel"]},". Under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cancel"]},", a plan whose customer reaches the outcome stops being charged; change it with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /revenue-recovery"]}," (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/subscription-lifecycle"},"children":["Subscription Lifecycle"]},")."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Status"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error code"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Error code"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"When"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["When"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["no code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A field is missing or invalid, or the body has an unknown field."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ACCOUNT_TIME_ZONE_INVALID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time_zone"]}," is not accepted."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IDEMPOTENCY_KEY_INVALID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The key is not 1 to 255 printable ASCII characters without spaces."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IDEMPOTENCY_KEY_IN_PROGRESS"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The first request with this key is still running."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PLATFORM_ACCOUNT_CREATE_BUSY"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["More than 5 account creations are in progress. Retry after the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Retry-After"]}," seconds (2)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IDEMPOTENCY_KEY_REUSED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The key was used with a different body."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["500"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["no code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The 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."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["502"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IDEMPOTENCY_REQUEST_INCOMPLETE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The first request with this key never completed. Read the account list before you retry with a new key."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"list-and-retrieve-accounts","__idx":6},"children":["List and retrieve accounts"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -G https://stage-api.chaching.io/platform/accounts \\\n  -H \"cc-api-key: $CHACHING_PLATFORM_KEY\" \\\n  -d company_external_id=office-1042 \\\n  -d status=active\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": [\n    {\n      \"object\": \"account\",\n      \"id\": \"acc_0c194ca27ec457a2f1b50f1f\",\n      \"external_id\": \"location-7\",\n      \"name\": \"Rosen Family Dental\",\n      \"company\": {\n        \"id\": \"com_1779003a63191104815fd879\",\n        \"external_id\": \"office-1042\",\n        \"name\": \"Rosen Family Dental\"\n      },\n      \"time_zone\": \"America/New_York\",\n      \"status\": \"active\",\n      \"deactivated_at\": null,\n      \"created\": 1794269584\n    }\n  ],\n  \"meta\": {\n    \"page\": 1,\n    \"take\": 10,\n    \"items_total\": 1,\n    \"pages_total\": 1\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns your platform's accounts, newest first, filtered by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["external_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["company_external_id"]}," (both exact) and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["active"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deactivated"]},"). ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /platform/accounts/{id}"]}," returns one account, deactivated ones included; an id that names no account of your platform answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404 ACCOUNT_NOT_FOUND"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"update-an-account","__idx":7},"children":["Update an account"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X PATCH https://stage-api.chaching.io/platform/accounts/acc_0c194ca27ec457a2f1b50f1f \\\n  -H \"cc-api-key: $CHACHING_PLATFORM_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Rosen Family Dental - Main Street\",\n    \"time_zone\": \"America/Chicago\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"object\": \"account\",\n  \"id\": \"acc_0c194ca27ec457a2f1b50f1f\",\n  \"external_id\": \"location-7\",\n  \"name\": \"Rosen Family Dental - Main Street\",\n  \"company\": {\n    \"id\": \"com_1779003a63191104815fd879\",\n    \"external_id\": \"office-1042\",\n    \"name\": \"Rosen Family Dental\"\n  },\n  \"time_zone\": \"America/Chicago\",\n  \"status\": \"active\",\n  \"deactivated_at\": null,\n  \"created\": 1794269584\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns the Account object with status ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account.updated"]},". The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}," is 1 to 255 characters (Unicode code points); control characters are refused. Deliveries of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account.updated"]}," can arrive out of order: order them by the envelope's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["created"]}," field, and treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /platform/accounts/{id}"]}," as the authoritative current state."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A new ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Status"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error code"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Error code"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"When"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["When"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["no code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A field is not a string, is null, a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}," is not 1 to 255 characters (Unicode code points) or contains a control character, or the body has another field (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["external_id"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["company"]}," included)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ACCOUNT_TIME_ZONE_INVALID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time_zone"]}," is not accepted."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ACCOUNT_NOT_FOUND"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id names no account of your platform."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-a-location","__idx":8},"children":["Set up a location"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run these in order for each new location:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /platform/accounts"]},", and store the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /dejavoo/credentials"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/processor-credentials"},"children":["Processor Credentials"]},". To receive the location's FEED notifications, include ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["feed_signing_key"]}," and give Dejavoo the location's FEED webhook URL; see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/processor-credentials#the-dejavoo-feed-webhook-url"},"children":["The Dejavoo FEED Webhook URL"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /dejavoo/terminals"]}," for each terminal. Before step 2 it answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409 DEJAVOO_NOT_CONFIGURED"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /customers"]},", then the payment plans. Before step 2, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /customers"]}," answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409 PAYMENT_GATEWAY_NOT_CONFIGURED"]}," with the message ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["This account has no payment gateway credentials. Save the payment gateway credentials before creating customers."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Read the credential state of a location with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /dejavoo/credentials"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"platform-webhooks","__idx":9},"children":["Platform webhooks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /platform/webhook-endpoints"]}," registers an endpoint that receives the events of every account of your platform, including accounts created later. The nine ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/platform/webhook-endpoints"]}," operations take the same bodies and answer the same objects as the account-level ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/webhook"},"children":["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 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},"; deduplicate on it."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An account of your platform also sends ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account.updated"]}," when its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time_zone"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each delivery's envelope names the account:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"\"account\": {\n  \"id\": \"acc_9f3a1c7e5b2d4086a1c3e5f7\",\n  \"external_id\": \"location-7\",\n  \"company\": {\n    \"id\": \"com_Hp3sJ6uK9wE2rT5yA8zX1vB4\",\n    \"external_id\": \"office-1042\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Endpoints created with a key keep receiving events after that key is revoked; delete or disable the endpoint to stop them."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /platform/webhook-deliveries"]}," lists the deliveries to your endpoints across all your accounts, each with its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account"]},"; filter by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," and the other delivery filters. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /platform/webhook-deliveries/{id}"]}," answers one with its payload and attempts, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /platform/webhook-deliveries/{id}/resend"]}," sends it again. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /platform/events"]}," lists the events of all your accounts."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"deactivate-an-account","__idx":10},"children":["Deactivate an account"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /platform/accounts/{id}/deactivate"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/reactivate"]}," answer the Account object; repeating one changes nothing. Each state change sends ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account.updated"]},"; its deliveries can arrive out of order, so order them by the envelope's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["created"]}," field and treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /platform/accounts/{id}"]}," as the authoritative current state. While an account is deactivated:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Every ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /payment-plans/{id}/cancel"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PATCH /dejavoo/terminals/{id}"]}," work."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The routes that finish a terminal sale already started work: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /payment-plans/{id}/deposit"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /payment-plans/{id}/deposit/cancel"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /payment-plans/{id}/payments/{payment_id}/resolve"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /payment-plans/{id}/payments/{payment_id}/cancel"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /dejavoo/terminal-attempts/{id}/force-close"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /payment-plans/{id}/payments"]}," works only with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"external\": true"]}," (a payment collected outside ChaChing); a payment on a saved card or on a terminal answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409 ACCOUNT_DEACTIVATED"]},". On a plan in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method"]},"); see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/payment-plans#record-a-deposit-collected-outside-chaching"},"children":["Record a Deposit Collected Outside Chaching"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PATCH /payment-plans/{id}"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"payment_method\": null }"]}," works (it removes the plan's card); naming a card answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409 ACCOUNT_DEACTIVATED"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Every other write answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409 ACCOUNT_DEACTIVATED"]}," and changes nothing, including ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /payment-plans/preview"]},", starting a terminal deposit, credential saves, email settings and webhook endpoint writes."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Scheduled installments, retries and webhooks keep running."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["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."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-does-not-apply-to-a-platform-account","__idx":11},"children":["What does not apply to a platform account"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["No dashboard, no users, no bank account, no ChaChing monthly fee."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The account's own publishable and secret keys do not exist; a key of that kind answers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401 Invalid apiKey"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Hosted checkout and invoice pages: they do not work for a platform account: the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Platform keys are created, rotated and revoked in the platform console, not through the public API. They carry ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#key-scopes"},"children":["scopes"]}," and an optional ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#ip-allow-list"},"children":["IP allow-list"]},", and have their own quotas of 6,000 requests per platform and 600 per account per minute; see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/integrating-staging#rate-limits"},"children":["Rate limits"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"environment","__idx":12},"children":["Environment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The platform layer exists on staging today; every ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/platform"]}," operation carries ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Staging only"]}," in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/developer-guide/api"},"children":["API Reference"]},". Production receives it in a later promotion, with its own platform key."]}]},"headings":[{"value":"Platforms","id":"platforms","depth":1},{"value":"Get a platform key","id":"get-a-platform-key","depth":2},{"value":"Authenticate","id":"authenticate","depth":2},{"value":"Key scopes","id":"key-scopes","depth":2},{"value":"IP allow-list","id":"ip-allow-list","depth":2},{"value":"Create an account","id":"create-an-account","depth":2},{"value":"List and retrieve accounts","id":"list-and-retrieve-accounts","depth":2},{"value":"Update an account","id":"update-an-account","depth":2},{"value":"Set up a location","id":"set-up-a-location","depth":2},{"value":"Platform webhooks","id":"platform-webhooks","depth":2},{"value":"Deactivate an account","id":"deactivate-an-account","depth":2},{"value":"What does not apply to a platform account","id":"what-does-not-apply-to-a-platform-account","depth":2},{"value":"Environment","id":"environment","depth":2}],"frontmatter":{"seo":{"title":"Platforms"}},"lastModified":"2026-11-30T19:15:54.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/developer-guide/platforms","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}