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

NameTypeRequiredDescription
codestringYesTenant-unique delivery option code.
delivery_methodstringYesDIGITAL clears carrier_account_id; non-COLLECTION methods clear customer_collection_locations and customer_collection_max_distance (server-side normalisation). Values: DELIVERY, COLLECTION, DIGITAL.
merchantstringYes
namestringYes
tenantIdstringYes
carrier_account_idstringNo
customerobjectNo
customer_collection_locationsarrayNoCOLLECTION 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_distanceobjectNo
delivery_estimationobjectNo
descriptionstringNo
fulfillment_locationsarrayNoLocation IDs eligible to fulfil this delivery option.
image_urlstringNo
item_product_categoriesobjectNoItem-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_valueobjectNo
payment_typeobjectNo
product_categoriesobjectNoOrder-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.
scheduleobjectNo
shipping_feeobjectNoShipping fee configuration. PASS_THROUGH without a carrier_account_id on the delivery option is silently downgraded to FREE_OF_COST by the backend.
statusstringNoDefaults to ACTIVE. Values: ACTIVE, INACTIVE.
weightobjectNo

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"
)

Notes

The backend normalizes the payload server-side:

  • 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 enabled as a customer collection location, otherwise the request is rejected. An empty customer_collection_locations list means any eligible collection-enabled location.