Billing

List invoices

The workspace's invoices, newest first. In a main workspace, workspace=all adds its sub-workspaces' invoices.

GEThttps://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

  • Authorizationstringrequired

    Bearer <your API token>. Tokens start with sm_live_.

  • Workspacestringrequired

    The workspace id to act on (from GET /workspaces or Settings › API tokens). Required on every call except the /workspaces calls; without it: 400 workspace_required.

Query parameters

  • limitintegeroptional1 to 100

    Items per page. Default 25.

  • cursorstringoptional

    The next_cursor from the previous page.

  • workspace"all"optional

    Only in a main workspace: include the invoices of its sub-workspaces.

  • statusenumoptional

    Only invoices with this status.

    One of: open paid failed partly_refunded refunded void

  • order_idstringoptionalat most 64 characters

    Only invoices of this order (ord_...).

  • created_afterstringoptional

    Only invoices made on or after this day (YYYY-MM-DD, UTC).

  • created_beforestringoptional

    Only invoices made before this day (YYYY-MM-DD, UTC).

Response (200)

  • dataobject[]required
    Show child fields
    • idstringrequired

      The invoice id (inv_...).

    • numberstringrequired

      The invoice number printed on the PDF.

    • workspace_idstringrequired

      The workspace it belongs to (org_...). Differs from yours for a sub's invoice.

    • order_idstringoptional

      The order it bills (ord_...). Not on a one-time payment.

    • descriptionstringrequired

      What it is for: the order's products (e.g. Google Inboxes), or for a one-time payment Domain purchase, Domain renewal, Domain purchase + renewal, Credits top-up, Domain Masking, Domain Masking added or One-time payment (Subscription when an order invoice has no lines).

    • statusenumrequired

      open = not paid yet, paid, failed = could not be collected, partly_refunded, refunded, void = cancelled, nothing owed.

      One of: open paid failed partly_refunded refunded void

    • amountnumberrequired

      What the invoice charges, after any promotion code. Paid once status is paid.

    • amount_refundednumberoptional

      Paid back so far. Only on an invoice with a refund.

    • period_startstringoptional

      Start of the period it covers (YYYY-MM-DD). Only on an order invoice.

    • period_endstringoptional

      End of the period it covers (YYYY-MM-DD). Only on an order invoice.

    • hosted_urlstringoptional

      Web page where the invoice can be viewed and paid. Left out when Stripe has none.

    • pdf_urlstringoptional

      Download link for the PDF. Left out when Stripe has none.

    • created_atstringrequired

      When the invoice was made, as a date: YYYY-MM-DD (UTC).

  • has_morebooleanrequired

    true when there is another page.

  • next_cursorstring | nullrequired

    Pass as cursor to get the next page. null on the last page.

Responses

  • 200OK. Always, when the token and workspace are valid.
  • 400Invalid input. limit is not 1 to 100, workspace is not all, status is not in its list, order_id is too long, or created_after / created_before is not a day (invalid_value); or cursor is not from a previous page of this list (invalid_cursor).
  • 403Not allowed. The token can't use the workspace in Workspace (workspace_not_allowed). Or the token's creator is not an owner or admin of this workspace (not_allowed): invoices are for owners and admins only.
  • 422Not a main. workspace=all was sent for a sub-workspace.
  • 429Rate limited. More than 300 read calls in a minute with this token. Wait for the Retry-After seconds.

Like every call, it can also answer 401 (bad key), 400 workspace_required, 403 workspace_not_allowed. See Errors.