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

Add tax to a Stripe Checkout Session

Apply tax to an open Stripe Checkout Session created by your application.

Add tax to a Stripe Checkout Session

post
/stripe/checkout_sessions/{external_id}/tax

Use this when you create the Checkout Session yourself: Sphere reads the cart from the session, calculates tax for the buyer's address, and attaches the tax rates. The session must still be open. Nothing is stored.

Authorizations
X-API-KEYstringRequired
Path parameters
external_idstringRequired

The Stripe Checkout Session id, e.g. cs_test_a1B2c3.

Body

Add tax to a Checkout Session you created yourself. Nothing is stored.

stripe_account_idstring · nullableOptionalDefault: nullPattern: ^acct_
Responses
200Success
application/json

The outcome of a tax write, shaped like the invoice endpoint's, plus Stripe's totals after it.

external_idstringRequired
stripe_account_idstringRequired
statusstring · enumRequiredPossible values:
reasonstringRequired
tax_calculation_idstring · nullableOptionalDefault: null
taxability_reasonstring · nullableOptionalDefault: null
post/stripe/checkout_sessions/{external_id}/tax
POST /v1/stripe/checkout_sessions/{external_id}/tax HTTP/1.1
Host: api.getsphere.com
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 330

{
  "stripe_account_id": "text",
  "shipping_address": {
    "line1": "text",
    "line2": "text",
    "city": "text",
    "state": "text",
    "postal_code": "text",
    "country": "text"
  },
  "billing_address": {
    "line1": "text",
    "line2": "text",
    "city": "text",
    "state": "text",
    "postal_code": "text",
    "country": "text"
  },
  "tax_ids": [
    {
      "value": "text",
      "country": "text",
      "tax_id_type": "text"
    }
  ]
}
{
  "external_id": "text",
  "stripe_account_id": "text",
  "status": "applied",
  "reason": "text",
  "tax_calculation_id": "text",
  "taxability_reason": "text",
  "stripe": {
    "currency": "text",
    "amount_subtotal": 1,
    "amount_discount": 1,
    "amount_tax": 1,
    "amount_total": 1,
    "tax_lines": [
      {
        "amount": 1,
        "taxable_amount": 1,
        "taxability_reason": "text",
        "display_name": "text",
        "percentage": 1,
        "inclusive": true,
        "jurisdiction": "text",
        "country": "text",
        "state": "text",
        "tax_type": "text"
      }
    ]
  }
}

Last updated

Was this helpful?