Shipments
Retrieve Shipments
To access shipment information, you may retrieve either individual or multiple shipment records:
- Accessing a single shipment record requires only the shipment's unique identifier
(id)
. - When accessing multiple shipments simultaneously, the system provides enhanced functionality through additional search parameters and filtering options.
Retrieve Shipment
This endpoint allows you to retrieve detailed information about a specific shipment using its unique identifier. The response includes comprehensive shipment details along with related information such as tracking updates, addresses, etc.
Request Example
List Shipments
This endpoint enables you to retrieve multiple shipments with comprehensive filtering, sorting, and search capabilities. The system provides flexible query options to help you find exactly the shipments you need.
When you want to retrieve multiple shipments, your data
property on the result will always be an array
even if you don't have any shipments.
Basic Usage
Filtering
The API supports comprehensive filtering of shipments through query parameters.
created_at
, pickup_at
, estimated_delivery_at
, rates_generated_at
and start_at
support the following operators:
eq
: Equals!eq
: Not equalsgt
: Greater thangte
: Greater than or equallt
: Less thanlte
: Less than or equalbwe
: Between exclusive (requires comma-separated dates)bwi
: Between inclusive (requires comma-separated dates)in
: In list of dates (requires comma-separated dates)!in
: Not in list of dates (requires comma-separated dates)
Format: {field}={operator}:{date} or {field}={operator}:{date1},{date2}
Filtering Examples
- Filtering by
status
:
- Filtering by
type
:
- Filtering by
filter
:
- Filtering by
tags
:
- Filtering by
layout_id
:
- Filtering by
location_id
:
- Filtering by
layout_path
:
- Filtering by
sender_contact_id
:
- Filtering by
recipient_contact_id
:
- Filtering by
container_id
:
- Filtering by
provider_id
:
- Filtering by
service_level
:
- Filtering by
rate_type
:
- Filtering by
sender_address_id
:
- Filtering by
recipient_address_id
:
- Filtering by
user_id
:
- Filtering by
created_at
:
- Filtering by
pickup_at
:
- Filtering by
estimated_delivery_at
:
- Filtering by
rates_generated_at
:
- Filtering by
start_at
:
Pagination
The system uses page-based pagination with these properties:
- has_more - Indicates if there are more shipments available
- page - Current page number (default: 1)
- limit - Number of results per page (default: 25)
- total_count - Total number of shipments in the database.
To retrieve the next page of results:
Example with pagination:
Sorting
Control the order of results using:
By default, shipments will be sorted by in ascending order.
Search
The API provides advanced full-text search capabilities through the search parameter, allowing you to filter specific shipments using fuzzy, typo-tolerant matching across multiple fields.
Below are the properties that are supported by our full text search.
Searchable Properties
search.provider
: the provider namesearch.barcode_values
search.order_number
search.recipient
: the recipient name, nickname and emailsearch.sender
: the sender name, nickname and emailsearch.tracking_number
search.metadata
: the custom metadata of the shipment
Each shipment in the search results includes a special _search
object that provides detailed information about the match:
To perform a general search, simply provide a string to search by using the search
query param. The results will be order by the most relevant first.
To perform a targeted search, or a mixture of targeted search and general search, or to use various modifiers to boost a particular field, refer to the general section on search, while using the searchable properties provided above
If you want to highlight matching search results for a frontend, we provide a special property for search-returned shipment objects called _search
which will have the matched text surrounded with <mark>
handles.
We also provide a _searchV2
object that has a searchV2.scores
property for scores and searchV2.shipment
property with all matches highlighted with <mark>
handles; this object has the same structure as the shipment object, except only those properties are present where there are highlights.
Ordering Search Results
By default, search results are ordered by relevance score to show the best matches first. However, you can override this by specifying an order_by
parameter to sort by other fields like created_at
, updated_at
, estimated_delivery_at
and pickup_at
or the search score like _similarity
and _relevance
. The search functionality can be combined with other filter parameters to refine your results further.