Skip to main content
POST
Preview tax for a cart before checkout

Authorizations

Authorization
string
header
required

API Key Authentication

Use your API key in the Authorization header:

Key Types:

Secret Keys (Server-Side Only):

  • Format: tybrite_sk_live_* (production) or tybrite_sk_test_* (sandbox)
  • Full read/write access to all endpoints
  • ⚠️ NEVER expose in client-side code or public repositories
  • Required for: write operations, authentication, payment verification, AI recommendations

Publishable Keys (Client-Safe):

  • Format: tybrite_pk_live_* (production) or tybrite_pk_test_* (sandbox)
  • Read-only access (GET requests only, plus POST semantic search)
  • ✅ Safe for client-side JavaScript, mobile apps, and public code
  • Allowed for: browsing products, search, CMS content, pricing queries

Endpoint-Specific Requirements:

  • Authentication endpoints (/v1/auth/*): Secret key required
  • Payment verification (POST /v1/payments/verify): Secret key required
  • AI Recommendations (POST /v1/recommendations): Secret key required
  • Semantic Search (POST /v1/search): Both key types allowed (read-only operation)
  • All write operations: Secret key required
  • All read operations: Both key types allowed

Using a publishable key for restricted operations returns 403 Forbidden.

Body

application/json
ship_to
object
required

The shipping destination the tax is calculated for.

lines
object[]
required

The cart lines to estimate tax for.

ship_from
object

The origin the goods ship from. Which jurisdictions may tax a sale depends on where it ships from as well as where it ships to, so send this when fulfilling from a location other than the store's own address. Defaults to the store's address.

customer_code
string

Your identifier for the buyer. Send it when the buyer holds a tax exemption, so the estimate reflects it. Omitted, the cart is priced as an ordinary retail sale.

Example:

"CUST-10432"

doc_code
string

Your own reference for this estimate, echoed back so you can tie it to a cart or quote in your system.

Example:

"QUOTE-10432"

currency
string

ISO 4217 currency code. Defaults to the store currency.

Example:

"USD"

Response

The tax estimate. tax_source is fallback when automatic tax is not configured.

tax_amount
number<float>
Example:

53.08

taxable
number<float>
Example:

598

currency
string
Example:

"USD"

tax_source
enum<string>
Available options:
automatic,
fallback
Example:

"automatic"

breakdown
object[]

Per-jurisdiction detail (present when tax_source is automatic).