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

Get rates

Quote shipping rates for a destination and cart.

Get shipping rates

post

Returns the rates Zapiet would show at checkout for the given destination and cart.

Send Accept: application/json on every request. Without it, validation errors come back as a redirect and rate-limit errors as an HTML page instead of JSON.

If no zone or rate matches and the shop has a fallback rate turned on, the fallback rate is returned. rates is only empty when there is no fallback rate or the shop is not eligible to calculate rates.

Limited to 60 requests per minute per API key and per IP address. Quotes are included in your plan.

Authorizations
AuthorizationstringRequired

Your API key, sent as Authorization: Bearer dbz_...

Body
localestringOptional

Language code for translated rate names and descriptions, for example en or fr.

Default: en
shopstringOptional

Your Shopify domain. If sent, it must match the shop the API key belongs to.

Example: your-store.myshopify.com
Responses
200

Quote calculated. rates may contain a fallback rate, or be empty if nothing is available.

application/json
post/rates
POST /api/v1/rates HTTP/1.1
Host: deliveryratesbyzipcode.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 227

{
  "destination": {
    "address1": "5 Fanthorpe Lane",
    "city": "Louth",
    "province": "Lincolnshire",
    "postal_code": "LN11 0EB",
    "country": "GB"
  },
  "items": [
    {
      "quantity": 2,
      "grams": 1000,
      "price": 5000
    }
  ],
  "locale": "en",
  "shop": "your-store.myshopify.com"
}
{
  "rates": [
    {
      "zone_name": "Lincolnshire",
      "service_name": "Standard Delivery",
      "service_code": "Standard Delivery DBZ#42",
      "total_price": "495",
      "description": "Delivered in 2 to 3 working days",
      "currency": "GBP",
      "phone_required": false
    }
  ]
}

Prices, weights and quantity

Send price and grams per unit. Zapiet multiplies them by quantity. Two items at 50.00 GBP and 1 kg each are one line:

Prices go in and come out in the shop's smallest currency unit (cents, pence), the same unit Shopify uses at checkout. In the response, total_price is a string: "495" with "currency": "GBP" is 4.95 GBP.

Fallback rates

If the shop has a fallback rate turned on, you get it back when:

  • the postal code does not match any zone, or

  • the postal code matches a zone but no rate matches the cart's weight or subtotal.

A fallback rate has an empty zone_name and a null description. Handle both in your UI.

Empty rates

An empty rates array is a successful quote, not an error. It is the same result checkout would show. You get it when:

  • nothing matches and the shop has no fallback rate turned on, or

  • the shop cannot calculate rates, for example because its Zapiet subscription is not active.

Do not treat an empty array as an authentication failure.

The address

Only postal_code is required, because Zapiet matches rates by zip code. Send as much of the address as you have. The more complete it is, the closer the quote matches checkout.