create_delivery_option
Updated September 9, 20262 min read
Create a delivery option via POST /delivery-options. Requires code, name, delivery_method and merchant; status defaults to ACTIVE. Server-side normalisations: DIGITAL clears carrier_account_id; non-COLLECTION methods clear customer_collection_locations and customer_collection_max_distance; a PASS_THROUGH shipping fee without carrier_account_id silently downgrades to FREE_OF_COST; for COLLECTION, every listed collection location must already be collection-enabled, and an empty customer_collection_locations list means any eligible collection location.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Tenant-unique delivery option code. |
delivery_method | string | Yes | DIGITAL clears carrier_account_id; non-COLLECTION methods clear customer_collection_locations and customer_collection_max_distance (server-side normalisation). Values: DELIVERY, COLLECTION, DIGITAL. |
merchant | string | Yes | — |
name | string | Yes | — |
tenantId | string | Yes | — |
carrier_account_id | string | No | — |
customer | object | No | — |
customer_collection_locations | array | No | COLLECTION only. Every listed location must already be enabled as a customer collection location (collection_location: true), otherwise the backend rejects it. An empty list means any eligible collection-enabled location. |
customer_collection_max_distance | object | No | — |
delivery_estimation | object | No | — |
description | string | No | — |
fulfillment_locations | array | No | Location IDs eligible to fulfil this delivery option. |
image_url | string | No | — |
item_product_categories | object | No | Item-level category condition, evaluated per cart item rather than for the whole cart. includes = the option applies only to items in these categories; excludes = items in these categories cannot use it. Non-matching items are returned with availability NONE, and the option is omitted entirely when no item matches. |
order_value | object | No | — |
payment_type | object | No | — |
product_categories | object | No | Order-level category condition: the option applies to the whole cart only when the cart matches. includes = the cart must contain at least one item in these categories; excludes = the option is skipped when any item is in these categories. |
schedule | object | No | — |
shipping_fee | object | No | Shipping fee configuration. PASS_THROUGH without a carrier_account_id on the delivery option is silently downgraded to FREE_OF_COST by the backend. |
status | string | No | Defaults to ACTIVE. Values: ACTIVE, INACTIVE. |
weight | object | No | — |
Returns
The created delivery option record, including its generated id.
Example agent prompt
"Set up a click & collect delivery option for ACME."
create_delivery_option(
tenantId="…",
merchant="ACME",
code="click-collect",
name="Click & Collect",
delivery_method="COLLECTION"
)
Related tools
list_delivery_optionsget_delivery_optionedit_delivery_optionget_locations— use thecollection_locationfilter to find eligible collection locations.
Notes
The backend normalizes the payload server-side:
DIGITALclearscarrier_account_id.- Non-
COLLECTIONmethods clearcustomer_collection_locationsandcustomer_collection_max_distance. - A
PASS_THROUGHshipping fee withoutcarrier_account_idsilently downgrades toFREE_OF_COST. - For
COLLECTION, every listed collection location must already be enabled as a customer collection location, otherwise the request is rejected. An emptycustomer_collection_locationslist means any eligible collection-enabled location.