Add tax to a Stripe Checkout Session
Apply tax to an open Stripe Checkout Session created by your application.
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.
The Stripe Checkout Session id, e.g. cs_test_a1B2c3.
Add tax to a Checkout Session you created yourself. Nothing is stored.
nullPattern: ^acct_The outcome of a tax write, shaped like the invoice endpoint's, plus Stripe's totals after it.
nullnullValidation error.
Missing/invalid API key, or Stripe account not enabled for Sphere tax.
No such account or session.
The session is closed, or Sphere could not calculate tax for the address.
Stripe refused the tax update.
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?