Skip to content

Shipping and delivery

A shipping profile is a set of delivery zones and their rates for some of your products. Every store has a default profile, made the first time anyone asks, so checkout offers delivery with no set-up. Products without a profile of their own ship under the default.

GET /v1/shipping_profiles answers each profile with its zones and their rates, the default first.

Terminal window
curl -sS "https://api.tuppence.ai/v1/shipping_profiles" \
-H "Authorization: Bearer $TUPPENCE_SECRET_KEY"
Rate kindPriced by
flatOne amount
weight_bandbands of grams, each with its amount
price_bandbands of the basket’s goods in minor units
carrier_calculatedThe carrier’s quote at checkout, plus your markup. fallback_amount shows if the carrier doesn’t answer in time
local_delivery, collectionFrom one of your locations (location)

free_over makes a rate free when the goods reach that amount.

GET /v1/shipping_profiles/preview answers the checkout’s delivery options for an address: each with its price and dates, and what is refused and why.

Terminal window
curl -sS "https://api.tuppence.ai/v1/shipping_profiles/preview?country=GB&postcode=LS1%205HN&weight_grams=800" \
-H "Authorization: Bearer $TUPPENCE_SECRET_KEY"
Parameter
countryTwo letters: GB, US. Required
regionA subdivision: TX, SCT
postcodeA postcode or ZIP code
weight_gramsThe goods’ weight (500 when left out). The package is added as at checkout
subtotalThe goods in minor units, for free_over

POST /v1/shipping_profiles/{id}/zones/{zone}/rates/{rate} changes a rate’s name, price, bands or service and answers the whole profile. Shoppers see it at checkout straight away.

Terminal window
curl -sS -X POST "https://api.tuppence.ai/v1/shipping_profiles/shpr_123/zones/shz_123/rates/shrt_123" \
-H "Authorization: Bearer $TUPPENCE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 395}'

Zones, new rates and packages have their own routes under /v1/shipping_profiles and /v1/shipping_packages. GET /v1/shipping_services lists the services a rate can name.

ToolDoes
get_shipping_profilesReads the profiles, zones and rates
preview_delivery_optionsWhat a shopper at an address is offered. Agents quote it; they never make up a price or a date
update_shipping_rateA rate’s name, price, free-over amount, fallback price or whether it’s offered. What shoppers pay is a price, so a person approves it every time, and it can be undone from your change history

Docs assistant

Open as a page
Loading the assistant…