Change and delete packages at once
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/shipment-packages/v2-shipment-package-bulk.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.
POST/
Changes the status of, or deletes, several packages of one shipment in one transaction: all of them, or none. Deletes run first and void Shippo labels as Delete a package does. Returns only the packages you touched, each with its bid and action_performed (UPDATED or DELETED).
Business rules
- One action per package: a second is 422
cart_item_validation_errorwitherror.context.reasonduplicate_item_actionanderror.bid. A package not on this shipment: the same code with reasonitem_not_available. - The draft rule and the Shopify lock rules of Delete a package apply to each delete; the third-party-fulfilment check does not.
Side effects
- Requests Shippo refunds for deleted Shippo labels, in the background. Open Admin Portal pages refresh, and so do Customer Portal pages the order's customer has open.
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.
The body is an array of objects.
There is no create: packages come from labels.
- One of:
"update","delete"
- One of:
Your label for this action.
A package of this shipment.
payloadobjectRequired for
update.Child fields (1)
Pending, Ready to Ship, Shipped or Delivered.
- One of:
"pending","ready-to-ship","shipped","delivered"
- One of:
Response
200Successful response.
The packages you touched.
Fields of each item (6)
object_typestring- Always
"shipment_package"
- Always
action_performedstring- One of:
"UPDATED","DELETED"
- One of:
bidstringYour label from the request.
has_changesbooleanitemobjectA package.
Child fields (36)
chargesinteger | number | string | nullThe label cost. For a multi-parcel label every package repeats the rate's full amount: read the master's value and don't add packages up. Null for external labels. Thousandths, an older encoding:
12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.created_atstring (date-time)from_addressanyThe address record behind
from_address_id, or null when it is not set.from_address_idstring | nullOlder packages only: the ship-from address record; null otherwise.
goshippoobjectShippo labels only: the Shippo details (shipment, rate, carrier, addresses, parcels).
Child fields (13)
address_fromanyThe ship-from address sent to Shippo.
The return address sent to Shippo.
address_toanyThe ship-to address sent to Shippo.
carrier_idstring | nullThe Shippo carrier account.
parcel_idstring | nullThe Shippo parcel.
parcelsanyThe parcels of the Shippo shipment.
providerstring | nullprovider_image_200string | nullprovider_image_75string | nullprovider_tracking_numberstring | nullrate_idstring | nullThe Shippo rate bought.
The Shippo shipment the rate came from.
shipment_idstring | nullThe Shippo shipment.
heightnumber | string | nullParcel size and weight as stored, in
length_unitandweight_unit. Null for external labels.idstringThe package.
is_masterbooleanThe first package of a label (the others have
parent_id).lengthnumber | string | nulllength_unitstring | nullShippo labels only, upper case.
order_external_idsarray of objectsThe order's links to external systems.
order_external_typestring | nullshopifywhen the order came from Shopify.order_idstringThe order.
order_object_typestring | nullorder_quotebooleanorder_scoped_idstring | nullparent_idstring | nullThe master package, for the other parcels of a multi-parcel label.
pdfarray of objectsNot on external labels: the label file.
labelanddescriptionare fixed texts that always say 4 x 6, whatever your label size setting.Fields of each item (3)
descriptionstringlabelstringurlstringFor a Shippo label, Shippo's signed link to the label file: don't publish it.
provider_namestring | nullThe carrier.
provider_saturday_deliverybooleanShippo labels only (absent on external labels); always false today.
provider_service_codestring | nullFor external labels,
ups,fedexorother. For Shippo labels it may be null: read the service fromprovider_service_name.provider_service_namestring | nullprovider_shipment_idstring | nullThe Shippo transaction id (Shippo labels).
provider_tracking_numberstring | nullshipment_external_typestring | nullshopifywhen the shipment is linked to Shopify.shipment_idstringThe shipment.
shipment_scoped_idstringShopify sync state of the shipment.
statusstring- One of:
"pending","ready-to-ship","shipped","delivered"
- One of:
to_addressanyThe address record behind
to_address_id, or null when it is not set.to_address_idstring | nullOlder packages only: the ship-to address record; null otherwise.
typestringgoshippoa label bought through Shippo;external_labela label recorded from elsewhere.- One of:
"goshippo","external_label","single_label"
- One of:
weightnumber | string | nullweight_unitstring | nullShippo labels only, upper case.
widthnumber | string | null
lock_versionobjectLock versions after the change (no
orderkey here).Child fields (1)
shipmentobjectThe shipment's lock versions:
shipment_item_lock_version,shipment_lock_version.
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 view the shipment's order (
user_is_not_authorized). Nothing is saved. - Fix
- Ask the team owner for permission to view this order, or to be assigned to it.
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;bulk_validation_payload_failednames the failing item'sbidand itsfields.- When
- A bad
status(bulk_validation_payload_failed), a duplicate or foreign package, or a refused delete; nothing is saved. - Fix
- Fix the named action and resend the whole array.
Related
- PUTChange a package's status
/v2/ api/ store/ {team_slug}/ v2/ shipment_package/ {hash_id} - DELETEDelete a package (voids its label)
/v2/ api/ store/ {team_slug}/ v2/ shipment_package/ {hash_id}
