Billing
List invoices
The workspace's invoices, newest first. In a main workspace, workspace=all adds its sub-workspaces' invoices.
https://api.scaledmail.com/v2/invoices- Rate limit
- Read: 300 calls per minute per token
A sub-workspace's purchases are charged to the main's card, but the invoice belongs to the sub.
Headers
AuthorizationstringrequiredBearer <your API token>. Tokens start withsm_.live_ WorkspacestringrequiredThe workspace id to act on (from
GET /workspacesor Settings › API tokens). Required on every call except the/workspacescalls; without it:400workspace_.required
Query parameters
limitintegeroptional1 to 100Items per page. Default 25.
cursorstringoptionalThe
next_from the previous page.cursor workspace"all"optionalOnly in a main workspace: include the invoices of its sub-workspaces.
statusenumoptionalOnly invoices with this status.
One of:
openpaidfailedpartly_refundedrefundedvoidorder_idstringoptionalat most 64 charactersOnly invoices of this order (
ord_).. . . created_afterstringoptionalOnly invoices made on or after this day (
YYYY-MM-DD, UTC).created_beforestringoptionalOnly invoices made before this day (
YYYY-MM-DD, UTC).
Response (200)
dataobject[]requiredShowHide child fields
idstringrequiredThe invoice id (
inv_).. . . numberstringrequiredThe invoice number printed on the PDF.
workspace_idstringrequiredThe workspace it belongs to (
org_). Differs from yours for a sub's invoice.. . . order_idstringoptionalThe order it bills (
ord_). Not on a one-time payment.. . . descriptionstringrequiredWhat it is for: the order's products (e.g.
Google Inboxes), or for a one-time paymentDomain purchase,Domain renewal,Domain purchase + renewal,Credits top-up,Domain Masking,Domain Masking addedorOne-time payment(Subscriptionwhen an order invoice has no lines).statusenumrequiredopen= not paid yet,paid,failed= could not be collected,partly_,refunded refunded,void= cancelled, nothing owed.One of:
openpaidfailedpartly_refundedrefundedvoidamountnumberrequiredWhat the invoice charges, after any promotion code. Paid once
statusispaid.amount_refundednumberoptionalPaid back so far. Only on an invoice with a refund.
period_startstringoptionalStart of the period it covers (
YYYY-MM-DD). Only on an order invoice.period_endstringoptionalEnd of the period it covers (
YYYY-MM-DD). Only on an order invoice.hosted_urlstringoptionalWeb page where the invoice can be viewed and paid. Left out when Stripe has none.
pdf_urlstringoptionalDownload link for the PDF. Left out when Stripe has none.
created_atstringrequiredWhen the invoice was made, as a date:
YYYY-MM-DD(UTC).
has_morebooleanrequiredtruewhen there is another page.next_cursorstring | nullrequiredPass as
cursorto get the next page.nullon the last page.
Responses
- 200OK. Always, when the token and workspace are valid.
- 400Invalid input.
limitis not 1 to 100,workspaceis notall,statusis not in its list,order_is too long, orid created_/after created_is not a day (before invalid_); orvalue cursoris not from a previous page of this list (invalid_).cursor - 403Not allowed. The token can't use the workspace in
Workspace(workspace_). Or the token's creator is not an owner or admin of this workspace (not_ allowed not_): invoices are for owners and admins only.allowed - 422Not a main.
workspace=allwas sent for a sub-workspace. - 429Rate limited. More than 300 read calls in a minute with this token. Wait for the
Retry-Afterseconds.
Like every call, it can also answer 401 (bad key), 400 workspace_, 403 workspace_. See Errors.
