Skip to main content
POST

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

Input for a shipping fee calculation. Provide either GPS coordinates (latitude + longitude) or a place_name to geocode.

latitude
number<double>
required

Customer's GPS latitude

Required range: -90 <= x <= 90
Example:

-1.106583

longitude
number<double>
required

Customer's GPS longitude

Required range: -180 <= x <= 180
Example:

37.013954

order_total
number<float>

Total order value (before shipping)

Required range: x >= 0
Example:

5000

address_to
object

A shipping address for live carrier rating. Supplied alongside a parcel to ALSO get live carrier rates from a connected carrier account (returned as rates[]).

address_from
object

A shipping address for live carrier rating. Supplied alongside a parcel to ALSO get live carrier rates from a connected carrier account (returned as rates[]).

parcel
object

Parcel dimensions + weight for live carrier rating.

Response

Shipping fee calculated successfully

Calculated delivery fee based on customer location and order total

fee
number<float>

Calculated delivery fee

Required range: x >= 0
Example:

100

zone_name
string | null

Name of delivery zone if customer is in a zone

Example:

null

tier_name
string | null

Name of pricing tier if distance-based pricing was applied

Example:

"Within Manhattan"

distance_meters
number<float> | null

Distance from store to customer in meters (null if zone-based)

Example:

29556.31

is_free
boolean

Whether delivery is free due to order threshold

Example:

false

reason
string

Human-readable explanation of the fee

Example:

"29.6 km away"

applied_rule
enum<string>

Pricing rule that was applied:

  • zone: Customer is within a custom delivery zone
  • distance: Distance-based tier pricing was used
  • default: Fallback pricing (no zone or tier matched)
Available options:
zone,
distance,
default
Example:

"distance"

coordinates
object

Customer coordinates (geocoded if place_name was provided)

rate_source
enum<string>

Which source produced the result — the store's delivery zone/tier rules, live carrier shippo rates, a custom carrier the store has connected, or none (unconfigured).

Available options:
zone,
tier,
shippo,
custom,
none
Example:

"shippo"

rates
object[]

Live multi-carrier rate options, present only when the store has carrier shipping connected AND a destination address + parcel were supplied. Each entry is a real carrier quote; pass a chosen rate_id to buy a label or place an order with that rate.