Developers
Basics

Testing

A test company gives you a sandbox with the same API, real books and no outside effects.

There is no separate test host and no second kind of API key. The line between test and production is the company a key is bound to: an admin creates a company and ticks test company (sandbox) — a choice made once, at creation, and never changed. A key bound to that company behaves exactly like any other key, inside books that belong to nobody real.

POST /api/partner/v1/invoices HTTP/1.1
Authorization: Bearer ab_…   ← a key bound to the test company

What is different in a test company

  • Mail is simulated. send: true, POST /invoices/{id}/send and the dunning schedule set the status, sent_at and the webhooks as always — no mail leaves the house.
  • Nothing is ever filed with the tax authorities.
  • Every answer carries AlphaCount-Sandbox: true. Check it once at startup and you can never point your production service at the wrong key — or your test service at the real one, which would issue real invoices.
  • Every webhook envelope carries livemode: false (envelope); a real company's events say livemode: true.

Everything else is real: number ranges count, invoices get booked, PDFs and e-invoices are rendered, payments and cancellations behave exactly as they will in production. What you test is the production code path, not a mock.

Set it up

  1. An admin creates the test company in the app (Organization → add company, tick test company).
  2. Create an API key bound to that one company, with the same scopes your production key will have.
  3. Point your staging environment at it. When you go live, swap the key — nothing else changes.

A test company is cleaned up like any other: close or delete it in the app when you are done.

On this page