Overview
ThePOST /v1/accounts endpoint accepts the full account onboarding graph in a single request. All children (addresses, contacts, payment methods, tags) are written in one database transaction. Any child failure rolls back the parent account and every already-inserted child — you get a complete record or nothing.
The 201 response includes all children hydrated inline; no follow-up GET calls are needed.
Minimal create
Onlyname and account_type are required.
Full B2B onboarding graph
One POST creates the account, 3 addresses, 2 contacts, a payment method, and 2 tags.Address field aliases
The endpoint accepts Stripe-style field names as aliases for the internal column names:
Both sets of names are accepted; canonical names (
line1, state, zip) are returned in all responses.
Default billing and shipping flags
- Exactly one billing address may have
is_default_billing: true. - Exactly one shipping address may have
is_default_shipping: true. - If no address explicitly sets the flag, the first address of each type is auto-defaulted.
- Sending more than one
is_default_billing: true(oris_default_shipping: true) returns 422.
Contact role vs title
Therole field in the API payload is stored internally as title. Both field names are accepted in
the request body; title is returned in responses.
Payment methods: test mode
In test mode, use Stripe test card tokens:pm_card_visa— Visa, succeedspm_card_mastercard— Mastercard, succeedspm_card_visa_chargeDeclined— always fails
payment_methods[] will
return an error; omit the array if you are testing without Stripe.
Credit limit
credit_limit is a JS number (float) in the response, never a Postgres NUMERIC string.
credit_balance on a new account equals credit_limit (no outstanding AR yet).
Tags: auto-create
Tags supplied by name are auto-created for the entity if they do not exist. The name is slugified (lowercased, non-alphanumeric chars replaced by_) to form the slug. Applying
the same tag name twice in tags[] is idempotent.
Error envelope
All errors follow the canonical envelope:Idempotency
SupplyIdempotency-Key: <unique-string> to safely retry creates without duplicating records.
The key is honored for 24 hours.
Related endpoints
GET /v1/accounts/:id?expand[]=addresses,contacts— retrieve with children expandedPOST /v1/accounts/:id/addresses— add an address to an existing accountPOST /v1/accounts/:id/contacts— add a contact to an existing accountPOST /v1/accounts/:id/payment-methods— attach a payment method to an existing accountPOST /v1/accounts/:id/merge— merge two accounts

