Create Fulfillment

🔒

Requires write_order access scope. More access scope

The Create Fulfillment API creates a fulfillment for specific order items and updates their shipping details.

This API is especially useful for:

  1. Managing the fulfillment process for order line items.
  2. Updating tracking details for shipments.
  3. Splitting or combining order items for different fulfillments.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Path Parameters

FieldTypeRequiredDescription
order_idstringYesOrder's unique identifier.

Body Parameters

FieldTypeRequiredExampleDescription
line_item_idsarray of stringsNo["line_item_1", "line_item_2"]IDs of the line items to fulfill. Use when splitting quantity across fulfillments.
line_itemsarray of objectsNo-Details of line items and their quantities. Used when fulfilling items in specific quantities.
line_items[].idstringYesed8af005-1f4e-42d1-859d-99b0fd420781Line item ID.
line_items[].ship_quantityint32Yes1Quantity to fulfill. 0 means all items will be fulfilled together.
tracking_numberstringYesDHL1231232113Tracking number for the shipment.
tracking_companystringNoDHLName of the shipping company.
tracking_company_codestringNodhlCode of the shipping company.
tracking_urlstringNohttps://tracking.dhl.comTracking URL for the shipment.

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response


Field Type Description Example
fulfillmentobjectFulfillment details.-
fulfillment.
id
stringUnique ID of the fulfillment.51c7dd5d-8f49-40c3-b2c1-5dfdeef9946d
fulfillment.
order_id
stringOrder ID associated with the fulfillment.633130-00000007
fulfillment.
status
stringStatus of the fulfillment (shipped, pending, etc.).shipped
fulfillment.
tracking_company
stringName of the shipping company.燕文物流
fulfillment.
tracking_number
stringTracking number for the shipment.11111111111
fulfillment.
tracking_company_code
stringCode of the shipping company.DJ-11343
fulfillment.
tracking_url
stringURL for tracking the shipment.https://tracking.example.com
fulfillment.
created_at
stringTimestamp of creation in ISO-8601 format.2024-04-22T08:37:12Z
fulfillment.
updated_at
stringTimestamp of the last update in ISO-8601 format.2024-04-22T08:37:12Z
fulfillment.
line_items
array of objectsList of fulfilled line items.-
fulfillment.
line_items[].
id
stringLine item ID.ed8af005-1f4e-42d1-859d-99b0fd420781
fulfillment.
line_items[].
product_id
stringProduct ID.a1a88be0-a1d4-47e4-a2f2-ba6e131cf447
fulfillment.
line_items[].
variant_id
stringVariant ID of the product.a7175820-36b3-4fc6-9baf-51e3035242ba
fulfillment.
line_items[].
variant_title
stringTitle of the product variant.L-blue-T
fulfillment.
line_items[].
product_title
stringTitle of the product.shirt
fulfillment.
line_items[].
product_handle
stringHandle of the product.shirt
fulfillment.
line_items[].
quantity
integerQuantity of the product fulfilled.1
fulfillment.
line_items[].
note
stringNote associated with the line item.Special instructions
fulfillment.
line_items[].
fulfillment_status
stringFulfillment status for the line item.shipped
fulfillment.
line_items[].
sku
stringSKU of the product.T-M-L-blue-T-A001008
fulfillment.
line_items[].
weight_unit
stringUnit for the weight of the product.kg
fulfillment.
line_items[].
weight
stringWeight of the product.1.10
fulfillment.
line_items[].
vendor
stringVendor or supplier of the product.shoplazza
fulfillment.
line_items[].
product_url
stringURL of the product page./products/shirt
fulfillment.
line_items[].
image
stringURL of the product image.//cdn.shoplazza.com/image.jpg
fulfillment.
line_items[].
price
stringPrice of the product per unit.81.00
fulfillment.
line_items[].
total
stringTotal price for the fulfilled quantity.81.00
fulfillment.
line_items[].
compare_at_price
stringOriginal (compare at) price of the product.97.00
fulfillment.
line_items[].
properties
array of objectsCustom properties of the line item.[{ "name": "size", "value": "L" }]
fulfillment.
line_items[].
refund_quantity
integerQuantity refunded from this line item.0
fulfillment.
line_items[].
refund_total
stringTotal refunded amount for this line item.0.00
fulfillment.
line_items[].
taxable
booleanIndicates whether the product is taxable.true
fulfillment.
line_items[].
requires_shipping
booleanIndicates if shipping is required for the product.true
fulfillment.
line_items[].
shipping_quantity
integerQuantity being shipped in this fulfillment.1

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsArray[ "invalid line_item id"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
422Unprocessable Entityline_item is invalid or not providedinvalid line_item id
invalid status of the orderShipment not allowed under current status.
fulfillment quantity is insufficientThe fulfill failed due to insufficient remaining fulfillment quantity
ShipQuantity is not providedShipQuantity is required

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!