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

Create a Stripe Checkout Session

Create a Stripe Checkout Session with Sphere tax applied.

Create a Stripe Checkout Session with Sphere tax applied

post
/stripe/checkout_sessions

Send Stripe's Checkout parameters under stripe, and the buyer Sphere needs to price under sphere. Sphere calculates tax, expresses it as Tax Rate objects in your account, creates the Checkout Session with those rates and returns it. Redirect to url (hosted) or mount client_secret (embedded) exactly as you do today. When the session completes, call the complete endpoint (or let Sphere's webhook do it) so renewals are taxed by Sphere.

Authorizations
X-API-KEYstringRequired
Body

Stripe's Checkout parameters and Sphere's pricing inputs, kept apart.

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

Stripe's session and Sphere's tax, kept apart as on the way in.

stripe_account_idstringRequired
post/stripe/checkout_sessions
POST /v1/stripe/checkout_sessions HTTP/1.1
Host: api.getsphere.com
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 880

{
  "stripe_account_id": "text",
  "stripe": {
    "mode": "subscription",
    "currency": "text",
    "line_items": [
      {
        "price": "text",
        "quantity": 1,
        "adjustable_quantity": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      }
    ],
    "customer_id": "text",
    "customer_email": "text",
    "success_url": "text",
    "cancel_url": "text",
    "return_url": "text",
    "metadata": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    },
    "subscription_data": {
      "metadata": {
        "ANY_ADDITIONAL_PROPERTY": "text"
      }
    },
    "allow_promotion_codes": true,
    "ui_mode": "hosted",
    "client_reference_id": "text",
    "locale": "text"
  },
  "sphere": {
    "variant": "merchant_supplied",
    "customer_name": "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"
      }
    ],
    "locale": "text"
  }
}
{
  "stripe_account_id": "text",
  "stripe": {
    "id": "text",
    "url": "text",
    "client_secret": "text",
    "status": "text",
    "amount_subtotal": 1,
    "amount_tax": 1,
    "amount_total": 1
  },
  "sphere": {
    "tax_calculation_id": "text",
    "tax_rate_ids": [
      "text"
    ],
    "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?