Update a shipment
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/shipments/v2-shipment-update.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
PUT/
Changes a shipment's number, shipping type, address, receiver contact, brand profile, packer and notes. Send only what you change; returns the shipment.
This doesn't change the shipment's status (use Change the status of a shipment), its lines, packages or totals. A shipment that is Completed or has labels can still be edited.
Business rules
- An id of 0 or below is refused: "Choose a valid shipping address." (and the same for the other ids).
- Only the listed fields can be cleared with null; elsewhere null means "not sent".
- On a shipment linked to Shopify, changes are refused with 422
shopify_managed_shipment_locked,shopify_fulfilled_shipment_lockedorshopify_broken_link_shipment_locked; on an order deleted in Shopify withshopify_order_deleted_externally. - On a Shopify order the address and receiver contact can't change: 422
shopify_shipment_snapshot_update_boundary. - An externally synced shipment on a draft order can't be updated: "Publish this order before updating an externally synced shipment."
- Choosing Fulfill By Shopify on a shipment not managed by Shopify: 422
shopify_system_shipping_type_read_only. - Ids are not checked against your records: an address, contact, brand profile, user or shipping type that isn't yours (or isn't the order customer's) is saved as given. Read them from the order's customer and your settings first.
Side effects
- Saves the fields; no totals change. Open Admin Portal pages refresh, and so do Customer Portal pages the order's customer has open. No webhook or email is sent.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
The shipment's
id(a hash id), as its answers show it. Its unique key (shp_...) also works, but API answers don't include it.- Example
MQyJUnd3oty75h
- Example
Request body
application/json, required.
customer_idstringIgnored: the shipment's customer is always the order's.
customer_profile_idstring | nullThe brand profile whose details print on the documents. Null clears it.
delivery_notesstring | nullNotes for delivery. Null clears them.
internal_notesstring | nullInternal notes. Null clears them.
packed_bystring | nullThe user who packed it. Null clears it.
receiver_contact_idstring | nullThe receiver contact. Null clears it.
scoped_idstringThe shipment number without the
SHIP-prefix, as a string. Not checked for duplicates. Don't echo theSHIP-...value you read.shipping_address_idstring | nullThe ship-to address. Null clears it.
shipping_type_idstringThe shipping type. Can't be cleared. Fulfill By Shopify is reserved for Shopify shipments.
Response
200Successful response.
A shipment.
Child fields (40)
billable_fee_totaldecimal pairShipping cost lines (what is billed), at the stored scale (4 decimal places). A decimal pair: the amount is
value÷ 10^dp({ "value": 1250, "dp": 2 }is 12.50). Readdpevery time: it can differ between fields and records.- See Money and quantities.
cost_totaldecimal pairShipping cost lines (the cost), at the stored scale (4 decimal places). A decimal pair: the amount is
value÷ 10^dp({ "value": 1250, "dp": 2 }is 12.50). Readdpevery time: it can differ between fields and records.- See Money and quantities.
customerobject | nullThe customer (the full customer record).
customer_due_datestring (date-time) | nullThe order's customer due date. ISO 8601 with offset, or null.
customer_idstring | nullThe customer.
customer_po_numberstring | nullcustomer_profile_idstring | nullThe brand profile printed on the documents.
delivery_notesstring | nullexternal_idsarray of objectsThe shipment's links to external systems (a Shopify fulfillment); usually empty.
external_mutation_sourcestringWho may change a Shopify shipment:
shopifymeans it is managed in Shopify and locked here;unknownon non-Shopify orders.- One of:
"shopify","yoprint","broken_link","unknown"
- One of:
external_typestring | nullfrom_legacybooleanidstringThe shipment.
internal_notesstring | nullis_externalboolean | integer | nullis_validbooleanHas lines, a shipping type, an address, and the order's customer.
last_sync_sourcestring | nulllock_versionintegerorder_external_idsarray of objectsThe order's links to external systems.
order_external_typestring | nullorder_idstringThe order.
order_object_typestring | nullorder_quotebooleanorder_scoped_idstring | nullThe order number.
packed_bystring | nullWho packed it.
pdfarray of objectsThe packing slip and the shipment label in Letter, 4" x 6" and 1" x 2-1/8" sizes (
is_customabsent), then one entry per enabled custom shipment PDF template (label,type,description,url, theshow_in_*flags,is_custom: true).Fields of each item (5)
descriptionstringis_custombooleanTrue on custom template entries.
labelstringobject_typestringurlstringA download link with its own access token.
ready_to_shipbooleanEvery job of its lines is in a Completed status.
receiver_contact_idstring | nullThe receiver contact.
scoped_idstringThe shipment number with its prefix. Update a shipment takes only the digits.
ship_due_datestring (date-time) | nullThe order's ship-by date. ISO 8601 with offset, or null.
ship_to_statusstring- One of:
"okay","empty","diff_from_order","diff_from_customer"
- One of:
shipping_addressobject | nullShip To, the full address, always included (null when none).
Child fields (10)
address1string | nulladdress2string | nullcitystring | nullcountrystring | nullcountry_codestring | nullidstringThe address.
labelstring | nullpostcodestring | nullstatestring | nullstate_codestring | null
shipping_address_idstring | nullShip To.
shipping_type_idstring | nullThe shipping type.
shopify_syncanyShopify sync state, for Shopify shipments.
statusobject | nullThe shipment status, always included.
Child fields (9)
colorstring | nullHex color.
customer_labelstringidstringThe status.
labelstringpipeline_idstringOnly on the statuses of a task preset (
rolepipeline): the task preset. Absent on other statuses.positionintegerIts place in the team's list: sort by it to find the next status.
rolestringWhich list it belongs to:
jobfor job statuses,pipelinefor the statuses of a task preset.- One of:
"order","quote","job","purchase_order","shipment","customer_message","pipeline"
- One of:
trashedbooleanThe status was deleted.
typestringThe kind of status:
start(Pending),pre_productionandin_progress(In Progress),end(Completed).- One of:
"start","pre_production","in_progress","end"
- One of:
status_idstring | nullThe shipment status.
typestring | nullversioninteger
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.- When
- Your role can't edit this order.
- Fix
- Ask the team owner to adjust your role or assign you to the order.
404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.- When
- The shipment isn't your team's.
- Fix
- Check the id.
422The request was refused and changed nothing.
validation_failedlists what to fix inerror.fields; other codes name a business rule, explained inerror.message. A few checks answer with only{"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answerconnect_timeout("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.- When
- Validation (
validation_failed) or a Shopify rule (see rules). - Fix
- Fix the named field or make the change in Shopify.
Related
- GETGet a shipment
/v2/ api/ store/ {team_slug}/ v2/ shipment/ {unique_key} - PUTChange the status of a shipment
/v2/ api/ store/ {team_slug}/ v2/ sales_order/ {hash_id}/ shipment/ {id}/ status - GETList shipping methods
/v1/ api/ store/ {team_slug}/ setting/ shipping_type
