Filter packages
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/shipment-packages/v1-shipment-package-filter.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/
Returns one page of your team's packages across all sales orders (quotes, drafts and autosave copies are left out) that match the filters.
Every condition in filters must match (they are joined with AND). Omit filters for no filter; an empty array is a 422. A key that isn't in the table, a missing operator or value, or a value of the wrong kind fails the whole request with 422; the message for filters (or sort) is the bare rule name validation.filter_rule (or validation.filter_sort_rule), with no detail, so check each filter against the table. Send real values: no key here matches empty columns with "null" or "" (for dates, use the ..._is_set keys where the table has them). Hash ids in value are decoded for you. system-current-user stands for the caller only where a key's row says so; elsewhere it is compared as a raw value, so with in it matches nothing and with nin it matches every row that has a value.
key |
Kind | Operators and value |
Meaning |
|---|---|---|---|
status |
Options | in or nin, with an array of the listed values. |
The package status: pending, ready-to-ship, shipped, delivered. |
shipment_status_id |
Hash ids | in or nin, with an array of hash ids. |
The status of the package's shipment. |
created_at |
Date | eq, gte or lte, with a whole number of days counted from now (UTC). See below. |
When the package was created. |
A date filter's value is a whole number of days, counted from the moment of the request in UTC: eq N matches the whole UTC day N days from today (0 is today, -1 yesterday); gte N matches dates on or after now plus N days; lte N matches dates on or before now minus N days. So "due in the next 7 days" is due_date gte 0 and due_date lte -7, and "overdue" is due_date lte 0. This differs from the v2 filters (Filter invoices, the production control calendar), where lte and gte both count forward.
The response is one page with pagination. The page size is the team's list page size setting (50 unless the team changed it); per_page is not read. Send page (from 1) in the body or the query string for later pages.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
Request body
application/json, optional.
filtersarray of objectsConditions, all of which must match. Omit for no filter.
- At least 1 item
Fields of each item (3)
What to filter on. See the table in the description.
- One of:
"status","shipment_status_id","created_at"
- One of:
How to compare. Each kind of key accepts only some operators.
- One of:
"eq","neq","gt","gte","lt","lte","in","nin","bt","ct","sw","ew"
- One of:
What to compare with: text, a number of days, true or false, or an array of hash ids or options, by kind of key.
pageintegerThe page to read.
- Default
1 - Minimum 1
- Default
sortarray of objectsSort keys, applied in order. Without
sortthe order is not guaranteed.
Response
200Successful response.
Fields of each item (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
paginationobjectChild fields (6)
Links to the neighbouring pages:
previousandnext, each present only when that page exists. An empty list,[], when there is only one page.
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.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.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
- A filter breaks the table.
- Fix
- Check each filter against the table.
Related
- GETList the packages of a shipment
/v2/ api/ store/ {team_slug}/ v2/ shipment/ {hash_id}/ packages - PATCHGet live tracking for a package
/v1/ api/ store/ {team_slug}/ shipment_package/ {id}/ track
