← API reference

Billing API

Subscription, payment methods, and invoices (accept.blue). Dual auth: Bearer or dashboard session. Billing is for organization owners and admins: an API key sees it only while the user who created it is an owner or admin of the key's organization (a platform super-admin creator counts as an owner), checked on every request. Any other key is refused with 403 BILLING_ROLE_REQUIRED.

GET /billing/subscription

Get current subscription

Auth: API key (Authorization: Bearer). Scopes: billing:read, billing:manage.

Returns the org's current subscription and plan snapshot.

Requires one of the following scopes: billing:read, billing:manage. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Responses

200 Success

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required

Current subscription + plan snapshot.

data.plan_typestring
data.plan_namestring
data.billing_intervalstring

Example monthly

data.price_monthlynumber
data.statusstring

Example active

data.current_period_startstring (date-time) | null
data.current_period_endstring (date-time) | null
data.pending_plan_changestring | null
data.pending_plan_change_atstring (date-time) | null
data.payment_providerstring | null
data.has_payment_methodboolean

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

POST /billing/subscription/upgrade

Upgrade plan

Auth: API key (Authorization: Bearer). Scope: billing:manage.

Upgrades the plan. Only monthly billing is available (annual was removed).

Requires the billing:manage scope. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Request body application/json required

FieldTypeDescription
planstring required
intervalstring

Always monthly · Default monthly

expected_charge_centsinteger | null

What the caller states it disclosed to the customer, in cents — the disclosed_charge_cents returned by POST /billing/subscription/upgrade-preview.

Optional for Bearer callers, until tax applies. An API client has no page, so omitting the field skips the comparison and the upgrade proceeds — unless the upgrade carries sales tax (California, from 2027-01-01), which is never charged undisclosed: that request is refused 409 disclosure_required with the taxed total in error.details.charge_amount_cents. Not refused this way: a same-day retry of an upgrade that already charged (it completes on that charge) or a sandbox gateway; if an earlier upgrade charge may still be in flight the request is refused with a prior-attempt error instead.

Required in practice of a browser. A session-authenticated request that omits it is answered 409 disclosure_required: every dashboard path previews first, so a session request carrying no figure is a page cached from before that shipped, and charging it would charge a card an amount nobody was shown.

The value is never charged. It is only compared against the server's own recomputed proration; if they differ the upgrade is refused with 409 amount_changed and nothing is charged — so a wrong value can only refuse its own upgrade. 0 is a disclosure ("no charge today"), not an absence.

Responses

200 Upgraded

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required

Accepts any keys

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

409 Refused before the gateway; nothing was charged by this request and no subscription row was touched. - disclosure_required — a session-authenticated (browser) request omitted expected_charge_cents. The page is stale: reload it, re-read the price, and retry. From 2027-01-01 a Bearer request that omits it is also refused this way when the upgrade carries sales tax: error.details.charge_amount_cents is the taxed total and error.details.tax_cents the tax — show the customer that total, then retry sending it as expected_charge_cents. Not refused this way: a same-day retry of an upgrade that already charged (it completes on that charge) or a sandbox gateway; if an earlier upgrade charge may still be in flight the request is refused with a prior-attempt error instead. - amount_changed — the disclosed figure no longer matches the server's recomputed proration. error.details.charge_amount_cents carries the current figure; re-disclose it before retrying. When the only difference is sales tax added to a pre-tax figure, error.details.tax_cents carries the tax. The code is in error.code.

Response fields
FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring

Which refusal fired. Both are refused before the gateway.

One of: disclosure_required, amount_changed

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

POST /billing/subscription/upgrade-preview

Preview an upgrade

Auth: API key (Authorization: Bearer). Scope: billing:manage.

Answers "what happens if I upgrade to this plan, and what does it cost me today" without charging or writing anything.

The sentence and the figure come back together, from one server-side decision, so a caller cannot show one number and send another: echo disclosed_charge_cents back as expected_charge_cents on POST /billing/subscription/upgrade and the server refuses to charge anything else.

Always 200, including for a refusal. disclose: false is a successful answer to the question — render message and keep the confirm control disabled.

POST rather than GET because it reads an org's billing state and so is CSRF-protected for the browser path. Requires the billing:manage scope.

Request body application/json required

FieldTypeDescription
planstring required

Target plan key.

intervalstring

Always monthly · Default monthly

Responses

200 The disclosure to show before offering the upgrade.

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.discloseboolean required

false means do not offer the upgrade at all: show message and keep the confirm control off.

data.reasonstring | null

Why the upgrade was refused, or null when disclose is true. An operator/log code whose vocabulary is not part of this contract — render message, never the code, and do not switch on it.

data.messagestring required

The complete sentence to show the customer. True whether or not the upgrade can proceed.

data.disclosed_charge_centsinteger | null required

Exactly what message states will be charged today. 0 is a real answer ("no charge today"). null only when disclose is false, i.e. there is nothing to echo back. Send this as expected_charge_cents.

data.charge_labelstring | null

disclosed_charge_cents formatted for display.

data.monthly_labelstring | null

The plan's recurring monthly price, formatted.

data.plan_namestring | null

Display name for the target plan. null for a key we do not sell — never the raw key, so a modal cannot ask a customer to confirm a plan name we invented.

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

POST /billing/subscription/downgrade

Downgrade plan

Auth: API key (Authorization: Bearer). Scope: billing:manage.

Requires the billing:manage scope. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Request body application/json required

FieldTypeDescription
planstring required

Responses

200 Downgrade scheduled/applied

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required

Accepts any keys

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

POST /billing/subscription/cancel

Cancel subscription

Auth: API key (Authorization: Bearer). Scope: billing:manage.

Requires the billing:manage scope. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Request body application/json

FieldTypeDescription
reasonstring

Responses

200 Cancelled

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required

Accepts any keys

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

GET /billing/payment-methods

List payment methods

Auth: API key (Authorization: Bearer). Scopes: billing:read, billing:manage.

Payment methods belong to the org's billing account (shared across member orgs). Only active methods are listed. A key with billing:read but not billing:manage gets each row without billing_address_line1 and billing_address_line2; city, state and ZIP are still returned.

Requires one of the following scopes: billing:read, billing:manage. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Responses

200 Success

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataarray of object required
data[].idinteger
data[].typestring

One of: card, ach

data[].is_defaultboolean | integer
data[].card_brandstring | null
data[].card_last_fourstring | null
data[].card_exp_monthinteger | string | null
data[].card_exp_yearinteger | string | null
data[].bank_namestring | null
data[].bank_last_fourstring | null
data[].billing_namestring | null
data[].statusstring
data[].created_atstring (date-time)
data[].billing_address_line1string | null

Omitted when the calling API key does not hold billing:manage.

data[].billing_address_line2string | null

Omitted when the calling API key does not hold billing:manage.

data[].billing_address_citystring | null
data[].billing_address_statestring | null
data[].billing_address_zipstring | null
data[].address_problemobject | null

Set when the billing address needs fixing, otherwise null.

data[].address_problem.codestring
data[].address_problem.messagestring
data[].is_expiredboolean
data[].can_make_defaultboolean

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

POST /billing/payment-methods

Add a payment method

Auth: API key (Authorization: Bearer). Scope: billing:manage.

Requires the billing:manage scope. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Request body application/json required

FieldTypeDescription
payment_tokenstring required
methodstring

One of: card, bank · Default card

billing_namestring
card_brandstring
card_last_fourstring
card_exp_monthinteger
card_exp_yearinteger
bank_namestring
bank_last_fourstring
billing_address_line1string required

Street address. PO boxes are refused (po_box).

max length 200

billing_address_line2string

Optional second address line.

max length 100

billing_address_citystring required

max length 100

billing_address_statestring required

Two-letter US state, DC, territory or military (AA, AE, AP) code. Stored upper-case.

billing_zipstring required

Billing ZIP code. Note the name: the create body uses billing_zip; responses and the update body use billing_address_zip.

set_defaultboolean

Make this the default payment method. The first payment method on the account is always the default.

Responses

201 Payment method added

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required

A short summary of the stored method, not the full PaymentMethod row. No Location header is sent.

data.idinteger required
data.typestring required

ach when the request sent method = bank, otherwise card.

One of: card, ach

data.is_defaultboolean required
data.card_brandstring | null required
data.card_last_fourstring | null required
data.existingboolean

Present only when the card was already on file and that row was updated instead of a new one being created. id is then the existing method's id.

Always true

data.address_pendingboolean required

true when the billing address was accepted but its tax location is still awaiting review.

data.address_problemobject

Present only when the card was stored but its billing address has a problem to fix. Never sent together with existing.

data.address_problem.codestring
data.address_problem.messagestring

400 Refused. error.code is one of: - an address code (street_required, street_invalid, street_too_long, po_box, line2_invalid, line2_too_long, city_required, city_invalid, city_too_long, state_required, state_invalid, zip_required, zip_invalid), or another reason code when the address cannot be matched to a tax location. Nothing was stored. - billing_email_required: the account has no billing email. Add one, then retry. - billing_email_unavailable: the billing email could not be loaded. Retry. - card_not_recorded: the card could not be saved, or the processor's answer was not known. Check GET /billing/payment-methods before retrying. - bad_request: anything else, for example a payment_token that does not start with nonce-, tkn-, pm- or ref- ("Invalid payment token").

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

PATCH /billing/payment-methods/{id}

Update a payment method

Auth: API key (Authorization: Bearer). Scope: billing:manage.

Edits a saved card's cardholder name, expiry or billing address. The card number cannot be changed. Only the fields present in the body are touched. Sending any address field re-validates the whole address, merged with the stored one. A body with no recognised change returns 400 "Nothing to update"; make_default on its own counts as no change. An unknown id returns 400 "Payment method not found", not 404. The key's creator must be an organization owner or admin (403 BILLING_ROLE_REQUIRED).

Requires the billing:manage scope. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Parameters

NameInTypeDescription
idpathinteger required

Payment method id

Request body application/json required

FieldTypeDescription
billing_namestring

Cardholder name. Trimmed; must not be empty. Cut to 255 characters.

card_exp_monthinteger

min 1 · max 12

card_exp_yearinteger

The resulting month and year must not be in the past. A missing half is taken from the stored card.

min 2000 · max 2099

billing_address_line1string

max length 200

billing_address_line2string

max length 100

billing_address_citystring

max length 100

billing_address_statestring
billing_address_zipstring

Note the name: the create body uses billing_zip.

make_defaultboolean

Must be exactly true to have any effect. The card becomes the default only if it is not already the default, is stored at the payment processor, is not expired, its address was not refused, and the account has no other working default. Otherwise it is ignored without an error; read is_default in the response.

Responses

200 Payment method updated

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.idinteger
data.billing_namestring | null
data.card_exp_monthinteger | string | null
data.card_exp_yearinteger | string | null
data.billing_address_zipstring | null
data.billing_address_line1string | null
data.billing_address_line2string | null
data.billing_address_citystring | null
data.billing_address_statestring | null
data.address_pendingboolean

true when the address's tax location is awaiting review.

data.is_defaultboolean

400 Refused. A refused address carries its own error.code (street_required, street_invalid, street_too_long, po_box, line2_invalid, line2_too_long, city_required, city_invalid, city_too_long, state_required, state_invalid, zip_required, zip_invalid, or another reason code when the address cannot be matched to a tax location). Every other refusal has code bad_request and one of these messages: "Payment method not found", "Cardholder name is required", "Expiry month must be between 1 and 12", "Expiry year is not valid", "That expiry date has already passed", "Nothing to update", "This card was just changed somewhere else. Please reload and try again.", "Could not save those changes", or the payment processor's own error text.

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

DELETE /billing/payment-methods/{id}

Remove a payment method

Auth: API key (Authorization: Bearer). Scope: billing:manage.

Requires the billing:manage scope. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Parameters

NameInTypeDescription
idpathinteger required

Payment method id

Responses

204 Removed

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

PATCH /billing/payment-methods/{id}/default

Set default payment method

Auth: API key (Authorization: Bearer). Scope: billing:manage.

Requires the billing:manage scope. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Parameters

NameInTypeDescription
idpathinteger required

Payment method id

Responses

200 Default set

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.idinteger

400 Invalid request (validation errors under error.details.validation_errors).

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

GET /billing/invoices

List invoices

Auth: API key (Authorization: Bearer). Scopes: billing:read, billing:manage.

Invoices for the org's billing account. Pagination is returned inside data (items/total/limit/offset), not the top-level meta.

Requires one of the following scopes: billing:read, billing:manage. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Parameters

NameInTypeDescription
limitqueryinteger

Max items to return (1-100).

Default 25 · min 1 · max 100

offsetqueryinteger

Number of items to skip.

Default 0 · min 0

Responses

200 Success

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.itemsarray of object
data.items[].idinteger
data.items[].invoice_numberstring | null
data.items[].statusstring

One of: draft, pending, paid, failed, void, refunded

data.items[].reversal_kindstring | null

How the invoice was reversed. null when no reversal is recorded.

One of: refund, void, null

data.items[].sourcestring | null
data.items[].created_by_admininteger | null
data.items[].period_startstring (date) | null
data.items[].period_endstring (date) | null
data.items[].subtotal_centsinteger | null
data.items[].tax_centsinteger | null
data.items[].total_centsinteger | null
data.items[].reversed_total_centsinteger | null

Cents reversed on this invoice. null when no reversal is recorded.

data.items[].currencystring | null
data.items[].paid_atstring (date-time) | null
data.items[].due_datestring (date) | null
data.items[].created_atstring (date-time)
data.items[].line_itemsarray of object

Only on the single-invoice GET.

data.totalinteger
data.limitinteger
data.offsetinteger
data.account_idinteger

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

POST /billing/invoices/pay

Pay the oldest open invoice

Auth: API key (Authorization: Bearer). Scope: billing:manage.

Charges the oldest open invoice on the organization's billing account. It never charges any other invoice. invoice_id and amount_cents confirm what the caller was shown; they do not select an invoice. If either is missing, or they do not match the oldest open invoice's id and total_cents, nothing is charged and the request fails with amount_changed. If the account owes nothing the result is nothing_due, whatever the body holds.

This operation has its own limit of 3 requests per minute and 10 per hour per organization, for Bearer and session callers alike. Over it the response is 429 with a Retry-After header and the body {"success": false, "error": "Rate limit exceeded. Try again in N seconds.", "retry_after": N}, which is not the usual error envelope.

The key's creator must be an organization owner or admin (403 BILLING_ROLE_REQUIRED).

Requires the billing:manage scope. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Request body application/json

FieldTypeDescription
invoice_idinteger

Id of the invoice the caller expects to pay. Needed for any charge to run.

amount_centsinteger

The invoice's total_cents as the caller last read it. Needed for any charge to run.

Responses

200 Paid, or nothing was owed. Read state.

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.statestring required

paid: the invoice was charged and the balance is clear. partially_paid: the invoice was charged and another invoice is still open. nothing_due: there was no open balance; nothing was charged.

One of: paid, partially_paid, nothing_due

data.messagestring required

Customer-facing text.

data.reinstatedboolean required

true when this request restored a paused service. Always false for partially_paid.

data.invoice_numberstring

The invoice charged. Not sent for nothing_due.

data.amount_centsinteger

The amount charged. Not sent for nothing_due.

data.balance_unreadboolean

Only for partially_paid. true when the balance could not be re-read after the charge, so whether another invoice is open is not known.

400 Not paid. error.code is the outcome and error.message is customer-facing text; no details are sent. - amount_changed: invoice_id and amount_cents were missing or no longer match the oldest open invoice, or the invoice was reissued with sales tax. Nothing was charged. Re-read the invoice and retry. - declined: the card was declined. - no_payment_method: there is no usable payment method on file. - needs_billing_address: the payment method needs a billing address before it can be charged. - in_flight: a payment for this invoice is already in progress. - unrecorded: the card WAS charged but the payment is not recorded yet. Do not pay again. - gateway_unavailable: the payment processor could not be reached. - account_closed: the billing account is closed. - no_account: no billing account was found for the organization. - error: the payment could not be completed for another reason; see error.message.

Response fields
FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring

One of: amount_changed, declined, no_payment_method, needs_billing_address, in_flight, unrecorded, gateway_unavailable, account_closed, no_account, error

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded. This operation's own limit (3 per minute, 10 per hour per organization) answers with the first body shape, where error is a plain string; the per-key limit answers with the usual envelope.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorstring required

Human-readable message, for example Rate limit exceeded. Try again in 42 seconds.

retry_afterinteger required

Seconds to wait before retrying. Same value as the Retry-After header.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

GET /billing/invoices/{id}

Get an invoice

Auth: API key (Authorization: Bearer). Scopes: billing:read, billing:manage.

Returns the full invoice with its decoded line_items.

Requires one of the following scopes: billing:read, billing:manage. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Parameters

NameInTypeDescription
idpathinteger required

Invoice id

Responses

200 Success

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required

A billing invoice. List responses return the summary columns below; the single-invoice GET returns the full row plus a decoded line_items array.

data.idinteger
data.invoice_numberstring | null
data.statusstring

One of: draft, pending, paid, failed, void, refunded

data.reversal_kindstring | null

How the invoice was reversed. null when no reversal is recorded.

One of: refund, void, null

data.sourcestring | null
data.created_by_admininteger | null
data.period_startstring (date) | null
data.period_endstring (date) | null
data.subtotal_centsinteger | null
data.tax_centsinteger | null
data.total_centsinteger | null
data.reversed_total_centsinteger | null

Cents reversed on this invoice. null when no reversal is recorded.

data.currencystring | null
data.paid_atstring (date-time) | null
data.due_datestring (date) | null
data.created_atstring (date-time)
data.line_itemsarray of object

Only on the single-invoice GET.

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

404 Resource not found (also returned for cross-tenant ids to avoid existence leaks).

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

GET /billing/tokenization-config

Get hosted-tokenization config

Auth: API key (Authorization: Bearer). Scopes: billing:read, billing:manage.

Frontend config for accept.blue hosted card tokenization (script URL + public tokenization key). Use this to collect a payment_token for POST /billing/payment-methods.

Requires one of the following scopes: billing:read, billing:manage. Session authentication also works for browser (dashboard) contexts; this operation documents the Bearer path.

Responses

200 Success

Headers: X-Request-ID, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-API-Key-Expires-At, X-API-Key-Expires-In-Days

Response fields
FieldTypeDescription
successboolean required

Always true

dataobject required
data.providerstring
data.tokenization_keystring
data.public_keystring
data.script_urlstring
data.modestring
data.configuredboolean

401 Missing or invalid API key.

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

403 Authenticated but not permitted (insufficient scope uses the auth envelope with code INSUFFICIENT_SCOPE; policy/plan denials use the router envelope).

Headers: X-Request-ID

Response fields

Shape 1 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.codestring required

e.g. MISSING_AUTH, INVALID_API_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT_EXCEEDED.

error.messagestring required
error.retry_afterinteger

Seconds; present on 429 only.

Shape 2 of 2

FieldTypeDescription
successboolean required

Always false

errorobject required
error.messagestring required
error.codestring required

Machine-readable error code, e.g. bad_request, not_found.

error.detailsobject | null

Optional; validation failures put field errors under details.validation_errors.

Accepts any keys

429 Rate limit exceeded.

Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Request-ID

Ready to build on Vosy?

API access is included with the Business and Enterprise plans. Sign up, choose a plan with API access, and create your own keys from the Vosy API page in your account. Compare plans

Get Started