create_delivery_option

Updated September 30, 20263 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; non-DELIVERY methods clear customer_delivery_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; non-DELIVERY methods clear customer_delivery_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_distanceobjectNoCOLLECTION only. Maximum straight-line distance from the customer to a collection location; collection points further away are not offered. Enforced only when the storefront request supplies the customer's coordinates; without them the option's collection points are returned unfiltered.
customer_delivery_max_distanceobjectNoDELIVERY only. Offered only when one of its fulfillment_locations (any active fulfillment location if none are listed) is within this straight-line distance of the customer's coords. Hidden when the customer has no coords.
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.
  • Non-DELIVERY methods clear customer_delivery_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.