Storefront API
Shopper-facing lookups that power delivery choices on your webstore or app. Fetch the delivery options a shopper can pick, live carrier rates for a route, a per-product delivery promise for product pages, the eligible fulfillment or collection locations near a customer, and phone-number validation. Every call is stateless: none of them creates an order or a shipment.
Storefront
Shopper-facing evaluations for your webstore or app. Given a cart, a product, or a customer location, these lookups return the delivery choices, rates, promises, and pickup or fulfillment locations to show the shopper.
They are stateless: no order or shipment is created. Storefront frontends and headless commerce middleware call them, so they run at higher volume than the per-shipment management endpoints. To manage the delivery options behind these lookups, see the delivery-options endpoints in the Core API.
5 operations · 0 objects
/storefront/shipping-ratesGet shipping rates
Returns live shipping rates from eligible carriers for a future shipment. Stateless: no shipment is created.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| include_errors | boolean | No | Include per-carrier `error_details` for carriers that failed to return a rate. |
| include_breakdown | boolean | No | Include the line-by-line cost `breakdown` in each rate's `estimated_shipping_cost`. |
| include_markup | boolean | No | Include configured markup in the returned rates. |
Headers
| Name | Value | Required | Description |
|---|---|---|---|
| Authorization | Bearer YOUR-ACCESS-TOKEN | Yes | OAuth 2.0 bearer token obtained from `POST /oauth/token`. |
| x-api-key | YOUR-API-KEY | Yes | Your tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`. |
| tenant-id | YOUR-TENANT-ID | Yes | Your Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`. |
| Content-Type | application/json | Yes | Media type of the request body. |
Request body
application/jsonSchema: shipping-rates-requestrequired- Pickup address for the shipment. You can either pass a free-form address or a predefined location. For forward shipments, you must pass a predefined pickup location. Carriyo will copy the contact and address fields from the specified location. To specify the location, you can use Carriyo's internal location ID (
partner_location_id), or your own location code (partner_location_code) as defined when you created the location in Carriyo. For reverse shipments, you can pass the customer's pickup address as a free-form pickup address. - Dropoff address for the shipment. You can either pass a free-form address or a predefined location. For forward shipments, you can pass the customer's dropoff address as a free-form address. For reverse shipments, you must pass a predefined dropoff location. Carriyo will copy the contact and address fields from the specified location. To specify the location, you can use Carriyo's internal location ID (
partner_location_id), or your own location code (partner_location_code) as defined when you created the location in Carriyo.
Responses
Need the full machine-readable spec? Download the OpenAPI document →
/storefront/delivery-optionsGet delivery options
Returns the delivery options that match the supplied cart or order details at checkout time.
Delivery options are configured per merchant in the Carriyo Dashboard. Each option declares the carrier account that fulfils it, a shipping fee, an estimated delivery window, and a set of optional conditions. This endpoint evaluates the configured conditions against the order details you supply inline and returns the matching options, typically rendered to the shopper as the delivery choices on the checkout page.
Both DELIVERY and COLLECTION options can be returned. The shopper has not chosen between
them at this point, so customer represents where the customer is, not where the order is
being delivered. For DELIVERY options the customer's location is also the delivery
destination; for COLLECTION options it's used to find applicable collection points.
Supplying order details
Pass the order details inline in the request body. Only merchant is required; populate the
remaining fields based on which conditions the merchant has configured. This endpoint does
not look up existing orders; all order data must be provided directly in the request.
Restricting by delivery method
Pass delivery_methods to limit the response to only the methods you can render. For
example, send ["DELIVERY"] from a storefront that doesn't support pickup points, or
["COLLECTION"] from a click-and-collect locator screen. Omit the field to receive all
matching methods.
What gets evaluated
Each condition only applies when the merchant has configured it on a delivery option. The corresponding order field is read only if such a condition exists, so callers only need to populate the fields relevant to the rules in use.
| Condition (configured on the option) | Evaluated against |
|---|---|
| Working days / blackout days | order_date (defaults to now); timezone derived from
customer.country |
| Customer geography | customer.{country, state, city, area} |
| Order value range | payment.order_total |
| Weight range | Total order weight: sum of line_items[].weight × quantity (converted to
kg) |
| Payment type | Derived from payment.payment_on_delivery: CASH_ON_DELIVERY when it is
greater than 0, otherwise PRE_PAID |
| Product categories | The line-item categories in the cart. Each category is resolved
request-first (line_items[].category), then from the product catalog by product_id. An
includes rule matches when a listed category is present; an excludes rule matches when none
of the listed categories are present. Matching is case-insensitive |
| Fulfillment location | fulfillment_locations[]. Pass one or more candidate
fulfillment locations. An option matches if at least one of the supplied locations is in the
option's allowlist (or the option has no allowlist). For a configured Carriyo location,
supply either partner_location_code (your own code, recommended for storefront
integrations) or partner_location_id (Carriyo's internal ID); free-form address fields
are also accepted |
Sorting the results
Results are always coverage-banded first. Options that cover all line items come before options that cover only some; within the partial band, options are ordered by how many line items they cover (most first). This keeps the choices a shopper can fully order at the top.
Within each band, sort_by orders the options:
SPEED(default): earliestestimated_arrival_tofirst.COST: lowest shipping fee first.
Collection points for COLLECTION options
For each matching COLLECTION option, Carriyo also returns a list of eligible collection
points (configured Carriyo locations with the collection_location flag enabled) under
customer_collection_locations on the response item. Three pieces of input shape the
result:
customer.coords: when supplied (latitude/longitude), Carriyo computes the distance from the customer to each location and sorts the result nearest-first. Locations without coordinates are excluded from a distance-bound result. When customer coordinates aren't supplied, locations are returned in the merchant-configured order with no distance field.max_collection_distance(request): a client-supplied upper bound on the returned distance. Effective only when customer coordinates are supplied.customer_collection_max_distance(per-option, configured by the merchant): a hard upper bound the merchant authored for this option. Carriyo applies the smaller of this and the request'smax_collection_distancewhen filtering.
The result list is capped at max_collection_locations (defaults to 10 when omitted,
capped server-side at 50).
Stock-aware filtering
Set inventory_check to true to filter delivery options by real-time stock. Filtering is
effective only when all of the following hold:
inventory_checkistruein the request.Inventory management is enabled for the tenant in Carriyo settings.
The line items carry a
product_id(the stock key).
When effective, each delivery option in the response includes:
items— only the line items for which sufficient stock exists at locations eligible for that option. Items without available inventory are excluded.fulfillment_locations— the locations that can fulfill the listed items, as{partner_location_id, partner_location_code, partner_location_name}objects. This is the intersection of the option's configured locations and the locations that hold stock.
Location eligibility honors each location's fulfillment coverage, the same zone and radius
gating described in Get eligible locations. Radius
coverage is matched by distance, so it needs customer.coords in the request. Without
customer coordinates, a radius-covered location is never eligible and its stock is
invisible to this endpoint. Pass customer coordinates whenever the merchant fulfills from
radius-covered locations.
Delivery options that cannot fulfill any of the requested items are omitted entirely from the response.
When stock-aware filtering is not effective (inventory_check is false or omitted,
inventory management is disabled, or no product_id is supplied), the endpoint does not
filter on stock:
itemsechoes back all request line items with a non-blankid.fulfillment_locationsreturns the option's configured fulfillment locations as{partner_location_id, partner_location_code, partner_location_name}objects (or is omitted if none are configured).
Response
An array of matching delivery options, each with its carrier account, computed shipping fee,
and estimated arrival window, coverage-banded then ordered by sort_by. The array is empty
if no configured option matches the supplied order.
Headers
| Name | Value | Required | Description |
|---|---|---|---|
| Authorization | Bearer YOUR-ACCESS-TOKEN | Yes | OAuth 2.0 bearer token obtained from `POST /oauth/token`. |
| x-api-key | YOUR-API-KEY | Yes | Your tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`. |
| tenant-id | YOUR-TENANT-ID | Yes | Your Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`. |
| Content-Type | application/json | Yes | Media type of the request body. |
Request body
application/jsonSchema: delivery-options-requestrequired- The items in the order.
weight.valueis the weight of a single unit; the total weight for a line isweight.value × quantity. The total order weight used for weight range conditions is the sum of those per-line totals, converted to kg. Setproduct_idon each line to make stock-aware filtering effective (seeinventory_check). Setcategoryto drive product-category conditions; when omitted, the category is resolved from the product catalog byproduct_id. - Candidate locations the order could be fulfilled from (origin/warehouse/store). Pass one or more, and Carriyo returns the options whose fulfillment-location allowlist contains at least one of these (options without an allowlist are unconstrained). Per option, the first matching location is used to drive origin-country-based estimated arrival and, for
PASS_THROUGHpricing, the carrier rate quote. Each entry may be a free-form address, or, for a configured Carriyo location, supplypartner_location_code(your own code, recommended) orpartner_location_id(Carriyo's internal ID), and the rest of the address is populated from the location record. - The customer's location. Drives customer-geography conditions and the timezone used for working-day / blackout-day evaluation. Strongly recommended for any non-trivial result. For
DELIVERYoptions this is also the implicit delivery destination. ForCOLLECTIONoptions it's used to find applicable collection points. The shopper has not chosen between the two at this stage; the field captures where the customer is, not where the order is being delivered. - Restrict the response to options of the listed methods. When omitted or empty, all methods are returned. Useful when the storefront has separate UI tabs for delivery and click-and-collect, or when the integration only supports one method (e.g., Shopify's standard Carrier Service API has no pickup-point concept, so the Shopify connector sets this to
["DELIVERY"]). - Client-supplied upper bound on the distance from the customer's location to a returned collection point. The effective cap used by Carriyo is the smaller of this value and any per-option
customer_collection_max_distanceconfigured by the merchant. When the customer's coordinates aren't supplied, this cap can't be enforced and is ignored.
Responses
- The fulfilment method for this option: -
DELIVERY: courier delivers to the customer's address. -COLLECTION: customer collects from a designated location. -DIGITAL: no physical fulfilment. Aligns withFulfillmentOrder.delivery_methodon the order model.Values:COLLECTIONDELIVERYDIGITAL - The line items from the request that this delivery option can fulfill. Each entry identifies a line item and the quantity that can be fulfilled. When stock-aware filtering is effective (
inventory_checkistrue, inventory management is enabled, and the line items carryproduct_id), this field reflects only the items for which sufficient stock exists at the option's eligible fulfillment locations. Items with insufficient stock are excluded. If no items can be fulfilled, the entire option is omitted from the response. When stock-aware filtering is not effective, all request line items with a non-blankidare returned here; no stock filtering is applied. A returned option always lists at least one fulfillable item. If the request has noline_items, the option cannot be matched to any item and is omitted from the response entirely rather than returned with an emptyitemslist. - The locations that can fulfill the items listed in
itemsfor this delivery option, each as a{partner_location_id, partner_location_code, partner_location_name}object. When stock-aware filtering is effective, these are the option's configured fulfillment locations that hold stock for the listeditems. When at least one location can fulfill every listed item, only those shared locations are returned; otherwise the field falls back to the union of locations that can fulfill at least one item. When stock-aware filtering is not effective, this returns the option's configured fulfillment locations. Omitted (null) if the option has no configured fulfillment locations. - Eligible collection points for this option. Populated only when
delivery_methodisCOLLECTION. Sorted nearest-first when the customer's coordinates are supplied; otherwise returned in the merchant-configured order. May be empty if the option has no linked locations or none are within the effective distance cap.
Need the full machine-readable spec? Download the OpenAPI document →
/storefront/validate/phoneValidate a phone number
Validates a customer phone number and returns its parsed parts.
Carriyo parses the number with libphonenumber. Pass the number and, when the number is in national format, the country whose dialling rules apply. Use this at checkout to catch a mistyped number before the shopper places the order.
Headers
| Name | Value | Required | Description |
|---|---|---|---|
| Authorization | Bearer YOUR-ACCESS-TOKEN | Yes | OAuth 2.0 bearer token obtained from `POST /oauth/token`. |
| x-api-key | YOUR-API-KEY | Yes | Your tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`. |
| tenant-id | YOUR-TENANT-ID | Yes | Your Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`. |
| Content-Type | application/json | Yes | Media type of the request body. |
Request body
application/jsonSchema: validate-phone-requestrequiredResponses
validate-phone-responseNeed the full machine-readable spec? Download the OpenAPI document →
/storefront/product-delivery-optionsGet per-product delivery options
Returns the delivery options available for each product in a list, so you can show a delivery promise (for example "Get it in 45 minutes") on a product listing or product detail page.
Unlike Get delivery options, which evaluates one cart as a whole, this endpoint evaluates each product on its own from its own fulfillment location. Send the products and the location each one ships from; Carriyo returns the matching delivery options per product.
Choosing the fulfillment location
Set fulfillment_locations at the top level as the default for every product, and override
it per product under products[].fulfillment_locations. Reference a configured Carriyo
location by partner_location_id or partner_location_code. To find the nearest eligible
locations for a customer first, call Get eligible
locations.
Category and value
Each product's category is resolved request-first (products[].category), then from the
product catalog by product_id. The product's value is unit_price × quantity. Both feed
the same option conditions as the cart endpoint. Options priced PASS_THROUGH (a live
carrier quote) are omitted from this endpoint.
Stock
Set inventory_check to true to return available_quantity per product. It is effective
only when inventory management is enabled for the tenant.
When the check is effective, availability also honors each location's fulfillment coverage
(zones or radius, as described in Get eligible
locations). A location outside coverage reports
available_quantity: 0 and offers no delivery options. Radius coverage is matched by
distance, so it needs customer.coords: pass customer coordinates when working with
radius-covered locations.
Limits
At most 50 products per request.
At most 5 fulfillment locations per product.
Duplicate
product_idvalues are rejected.
Response
A bare array, one entry per (product, resolved fulfillment location) pair — a product with
several resolved locations yields one row per location. Each row carries the resolved
location and its delivery_options sorted by sort_by / sort_direction. Rows whose
delivery_options is empty are kept (for example when a location can't meet the requested
quantity under inventory_check), so every requested product is represented.
Headers
| Name | Value | Required | Description |
|---|---|---|---|
| Authorization | Bearer YOUR-ACCESS-TOKEN | Yes | OAuth 2.0 bearer token obtained from `POST /oauth/token`. |
| x-api-key | YOUR-API-KEY | Yes | Your tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`. |
| tenant-id | YOUR-TENANT-ID | Yes | Your Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`. |
| Content-Type | application/json | Yes | Media type of the request body. |
Request body
application/jsonSchema: product-delivery-options-requestrequiredResponses
product-delivery-options-responseNeed the full machine-readable spec? Download the OpenAPI document →
/storefront/locationsGet eligible locations
Returns the configured Carriyo locations that can serve a customer, so you can find the nearest store or warehouse to fulfill from or offer for collection.
A location is eligible when it is active, the merchant has access to it, and it carries the
requested functions flag. How its geography is checked then depends on the function:
FULFILLMENTlocations are gated by their configured coverage. Zone coverage (fulfillment_zones) qualifies a location when its zones cover the customer's country, state, city, or area terms. Radius coverage (fulfillment_radius) qualifies it when the customer is within the radius; this needs coordinates on both sides, so a location with radius coverage but no coordinates, or a request with nocustomer.coords, is ineligible. A fulfillment location with neither zones nor radius serves everywhere.COLLECTIONlocations are not gated by zones or radius. A location qualifies on its collection flag alone; the only geographic constraint ismax_distance, which caps how far a pickup point can be from the customer.
Distance and selection order
Supply customer.coords to get a distance on each location and nearest-first selection.
The order is fixed: nearest-first when coordinates are supplied, location_code order
otherwise; locations with no computable distance select last. Use max_distance (needs
coordinates) to cap how far out to look.
Filtering and the cap
Filter by location_type (STORE or WAREHOUSE) and by functions (FULFILLMENT,
COLLECTION; defaults to [FULFILLMENT]). One call returns the complete answer, capped by
max_locations (default 10, maximum 50) — there are no pages and no way to fetch "the
rest"; receiving exactly max_locations items means more may exist, so narrow the filters
or raise the cap. page/page_size and sort_by/sort_direction are rejected with
400.
Headers
| Name | Value | Required | Description |
|---|---|---|---|
| Authorization | Bearer YOUR-ACCESS-TOKEN | Yes | OAuth 2.0 bearer token obtained from `POST /oauth/token`. |
| x-api-key | YOUR-API-KEY | Yes | Your tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`. |
| tenant-id | YOUR-TENANT-ID | Yes | Your Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`. |
| Content-Type | application/json | Yes | Media type of the request body. |
Request body
application/jsonSchema: eligible-locations-requestrequired- Cap on returned locations. The response is one complete, capped answer in fixed selection order (nearest-first with
customer.coords,location_codeorder otherwise) — there are no pages. Receiving exactlymax_locationsitems means more may exist; narrow the filters or raise the cap.
Responses
eligible-locations-responseNeed the full machine-readable spec? Download the OpenAPI document →