跳转到内容

控制台 API: tax

本页由 server/api/openapi.yaml 生成,内容为英文,请勿手工修改。

Billing details, invoices and receipts (V3 B2). Handlers: internal/console/tax.

The organisation’s billing details

operationId taxGetBillingProfile · auth: orgSession

Company name, address and tax ID shown on invoices and receipts. An organisation without saved details gets empty fields.

Status Meaning Body
200 OK application/json BillingProfile
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — BillingProfile

  • company_name (string, required)
  • address_line1 (string, required)
  • address_line2 (string, required)
  • city (string, required)
  • state (string, required)
  • postal_code (string, required)
  • country (string, required)
  • tax_id_type (string, required)
  • tax_id (string, required)
  • email (string, required)
  • updated_at (string, required, nullable) — null when nothing was saved yet.

Replace the organisation’s billing details

operationId taxUpdateBillingProfile · auth: orgSession

Every field is replaced. Needs the manage_billing permission. Fails with 400 invalid_billing_profile (the message names the field).

Request body (required) application/json — BillingProfileInput

  • company_name (string, maxLength: 200)
  • address_line1 (string, maxLength: 200)
  • address_line2 (string, maxLength: 200)
  • city (string, maxLength: 200)
  • state (string, maxLength: 200)
  • postal_code (string, maxLength: 20)
  • country (string, maxLength: 2) — ISO 3166-1 alpha-2 code.
  • tax_id_type (string) — One of the names listed by taxListTaxIdTypes.
  • tax_id (string, maxLength: 200)
  • email (string, maxLength: 200) — Address for billing documents; empty uses the owner’s.
Status Meaning Body
200 OK application/json BillingProfile
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — BillingProfile

  • company_name (string, required)
  • address_line1 (string, required)
  • address_line2 (string, required)
  • city (string, required)
  • state (string, required)
  • postal_code (string, required)
  • country (string, required)
  • tax_id_type (string, required)
  • tax_id (string, required)
  • email (string, required)
  • updated_at (string, required, nullable) — null when nothing was saved yet.

Accepted tax ID types

operationId taxListTaxIdTypes · auth: orgSession

Status Meaning Body
200 OK application/json TaxIdTypeList
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — TaxIdTypeList

  • data (array of TaxIdType, required)
    • name (string, required)
    • label (string, required)

GET /api/v1/billing/orders/{order_id}/document

Section titled “GET /api/v1/billing/orders/{order_id}/document”

Invoice or receipt of a paid order

operationId taxGetOrderDocument · auth: orgSession

A card payment links to the hosted invoice of the payment processor (subscription invoices; top-ups when post-payment invoices are enabled). A crypto top-up has a receipt generated by the gateway, downloaded from receipt_url. 404 billing_document_not_found when the order has none.

Parameter In Type Required Description
order_id path string<uuid> yes
Status Meaning Body
200 OK application/json BillingDocument
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/json — BillingDocument

  • kind (“hosted_invoice” | “receipt”, required)
  • hosted_url (string, required, nullable) — The provider’s hosted invoice page (kind hosted_invoice).
  • pdf_url (string, required, nullable) — The provider’s invoice PDF (kind hosted_invoice).
  • receipt_url (string, required, nullable) — Path of the generated receipt PDF on this API (kind receipt).

GET /api/v1/billing/orders/{order_id}/receipt.pdf

Section titled “GET /api/v1/billing/orders/{order_id}/receipt.pdf”

Download the receipt PDF of a crypto top-up

operationId taxDownloadReceipt · auth: orgSession

Parameter In Type Required Description
order_id path string<uuid> yes
Status Meaning Body
200 The receipt application/pdf string<binary>
default Error envelope. The HTTP status follows the error kind. application/json Error

Response 200 application/pdf — string