For the complete documentation index, see llms.txt. This page is also available as Markdown.

Add tax to a Stripe invoice

Calculate and write tax to a draft Stripe invoice.

Add tax to a Stripe invoice

post
/stripe/calculate_invoice_tax

Calculates tax for a draft Stripe invoice and writes it onto the invoice's line items, replacing the sequence of Stripe calls you would otherwise make yourself. Hold the draft (auto_advance: false) before calling, and finalize it once this returns. Safe to retry: an invoice that already carries the same calculation comes back as unchanged.

Authorizations
X-API-KEYstringRequired
Body

Request body for adding Sphere tax to a Stripe invoice.

external_idstring · min: 1 · max: 255Required
stripe_account_idstring · min: 1 · max: 255 · nullableOptionalDefault: null
Responses
200Success
application/json

The outcome of a tax write. Amounts are deliberately absent: the tax is on the Stripe invoice, and finalizing it returns the updated totals.

external_idstringRequired
stripe_account_idstringRequired
statusstring · enumRequiredPossible values:
reasonstringRequired
calculation_idstring · nullableOptionalDefault: null
post/stripe/calculate_invoice_tax
POST /v1/stripe/calculate_invoice_tax HTTP/1.1
Host: api.getsphere.com
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 49

{
  "external_id": "text",
  "stripe_account_id": "text"
}
{
  "external_id": "text",
  "stripe_account_id": "text",
  "status": "applied",
  "reason": "text",
  "calculation_id": "text"
}

Last updated

Was this helpful?