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_numberstringNoDHL1231232113Tracking 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

FieldTypeExampleDescription
fulfillmentobject-Fulfillment details.
fulfillment.idstring51c7dd5d-8f49-40c3-b2c1-5dfdeef9946dUnique ID of the fulfillment.
fulfillment.order_idstring633130-00000007Order ID associated with the fulfillment.
fulfillment.statusstringshippedStatus of the fulfillment (shipped, pending, etc.).
fulfillment.tracking_companystring燕文物流Name of the shipping company.
fulfillment.tracking_numberstring11111111111Tracking number for the shipment.
fulfillment.tracking_company_codestringDJ-11343Code of the shipping company.
fulfillment.tracking_urlstringhttps://tracking.example.comURL for tracking the shipment.
fulfillment.created_atstring2024-04-22T08:37:12ZTimestamp of creation in ISO-8601 format.
fulfillment.updated_atstring2024-04-22T08:37:12ZTimestamp of the last update in ISO-8601 format.
fulfillment.line_itemsarray of objects-List of fulfilled line items.
fulfillment.line_items[].idstringed8af005-1f4e-42d1-859d-99b0fd420781Line item ID.
fulfillment.line_items[].product_idstringa1a88be0-a1d4-47e4-a2f2-ba6e131cf447Product ID.
fulfillment.line_items[].variant_idstringa7175820-36b3-4fc6-9baf-51e3035242baVariant ID of the product.
fulfillment.line_items[].variant_titlestringL-blue-TTitle of the product variant.
fulfillment.line_items[].product_titlestringshirtTitle of the product.
fulfillment.line_items[].product_handlestringshirtHandle of the product.
fulfillment.line_items[].quantityinteger1Quantity of the product fulfilled.
fulfillment.line_items[].notestringSpecial instructionsNote associated with the line item.
fulfillment.line_items[].fulfillment_statusstringshippedFulfillment status for the line item.
fulfillment.line_items[].skustringT-M-L-blue-T-A001008SKU of the product.
fulfillment.line_items[].weight_unitstringkgUnit for the weight of the product.
fulfillment.line_items[].weightstring1.10Weight of the product.
fulfillment.line_items[].vendorstringshoplazzaVendor or supplier of the product.
fulfillment.line_items[].product_urlstring/products/shirtURL of the product page.
fulfillment.line_items[].imagestring//cdn.shoplazza.com/image.jpgURL of the product image.
fulfillment.line_items[].pricestring81.00Price of the product per unit.
fulfillment.line_items[].totalstring81.00Total price for the fulfilled quantity.
fulfillment.line_items[].compare_at_pricestring97.00Original (compare at) price of the product.
fulfillment.line_items[].propertiesarray of objects[{ "name": "size", "value": "L" }]Custom properties of the line item.
fulfillment.line_items[].refund_quantityinteger0Quantity refunded from this line item.
fulfillment.line_items[].refund_totalstring0.00Total refunded amount for this line item.
fulfillment.line_items[].taxablebooleantrueIndicates whether the product is taxable.
fulfillment.line_items[].requires_shippingbooleantrueIndicates if shipping is required for the product.
fulfillment.line_items[].shipping_quantityinteger1Quantity being shipped in this fulfillment.

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!