Create a B2B company account
Authorizations
A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.
Headers
A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.
Body
CONVERGENCE PAST THE IDEMPOTENCY WINDOW DEPENDS ON external_id. A company created WITH one is protected by a UNIQUE (store_id, external_id) index, so a nightly sync re-running an interrupted push gets 409 external_id_taken rather than a second account for one customer. A company created WITHOUT one has no natural key, so a retry past the window mints a duplicate. Reconcile by listing with ?external_id=, or send your own key. Locations and contacts are created through their own nested routes and are refused here by name.
Required and must not be blank. The account's legal or trading name. Not unique: a merchant may hold two accounts under one name.
YOUR key from the ERP or CRM that owns this list, not ours. Unique per store when present, which is what makes a re-run of an interrupted sync converge. A blank or whitespace value is normalised to absent rather than stored, so an empty spreadsheet cell does not occupy the index and collide with the next such row.
Optional, defaults to active. inactive is the REVERSIBLE withdrawal: it stops an account trading and is undone with one PATCH, which is why an account-sync integration never needs the delete qualifier.
active, inactive Your own free-form bag. It REPLACES wholesale rather than merging, so a client can delete a key. Send {} to empty it: null is refused, because the column is NOT NULL and accepting null would be a second spelling of the same act.
Response
Created
