GET v3/shipments
GET/v3/shipments
List shipments from the last 90 days, with filters and pagination.
Returns a collection of up to 100 shipment resources, non older than 90 days, that match the provided filerting criteria and allows for iterating over pages of more shipment resources if there are more available. The endpoint supports pagination and filtering as described in the chapters below.
Pagination
The endpoint supports pagination to split the large collection of resources into smaller, more manageable chunks or pages. This helps to reduce the response size and to improve performance. The endpoint supports only cursor-based technique for pagination.
- See also this article on pagination.
Filters
The GET v3/shipments endpoint supports filtering on the following attributes: shippedOn, orderType, status, orderId, externalOrderNumber. Each of these are explained below. Filters can be used in combination with eachother and with pagination as to allow full access to the desired subset of shipments.
Filtering on shippedOn
The results returned by this service can be filtered based on the shipping date of the shipments. To do so make use of the filter[shippedOn] parameter in the following manner:
GET {host}/v3/shipments?filter[shippedOn][lt]={date}will return shipments that have shipped before the provided date. Shipments that shipped on that date are not included in the results.GET {host}/v3/shipments?filter[shippedOn][gt]={date}will return shipments that have shipped after the provided date. Shipments that shipped on that date are not included in the results.GET {host}/v3/shipments?filter[shippedOn][gt]={date_1}&filter[shippedOn][lt]={date_2}will return shipments that have shipped between dates {date_1} and {date_1}. Shipments that shipped on either date are not included in the results.
Filtering on status
The results returned by this service can be filtered based on the status of the shipments. To do so make use of the filter[status][in] parameter in the following manner:
GET {host}/v3/shipments?filter[status][in]=READY_TO_SHIP,SHIPPEDwill return shipments that have been picked and packed and are awaiting pickup by the carrier or have been picked up by the carrier.GET {host}/v3/shipments?filter[status][in]=READY_TO_PICKwill return shipments that are waiting for physical processing in the warehouse.
Filtering on orderType
The endpoint allows filtering on one or more orderType values of the order(s) that form the bases of the shipments. An orderType is a required paramter on the order and determines various asects of how the order should be processed. To filter on orderType use the filter[orderType][in] query parameter as follows:
GET {host}/v3/shipments?filter[orderType][in]=1will return all shipments that belong to anorderwith theorderTypeset to 1.GET {host}/v3/shipments?filter[orderType][in]=5,6,7will return all shipments that belong to anorderwith theorderTypeset to 5, 6 or 7.
Filtering on orderId, externalOrderNumber and reference
The endpoint allows filtering on both orderId, externalOrderNumber and reference of the order(s) that the shipments are created for.
To filter using one or more of these filters follow the examples below:
GET {host}/v3/shipments?filter[orderId][in]=123will return all shipments are created for an order with id equal to 123. To filter onexternalOrderNumberuse thefilter[externalOrderNumber][in]query parameter as follows:GET {host}/v3/shipments?filter[externalOrderNumber][in]=abc,123,1a2bwill return all shipments that are created for orders with external order numbers set to corresponding values.GET {host}/v3/shipments?filter[orderId][in]=123&filter[externalOrderNumber][in]=abcwill return all shipments that are created for orders withorderId = 123andexternalOrderNumber=abc.GET {host}/v3/shipments?filter[reference][in]=cust1,cust2,cust3will return all shipments that are created for orders with reference set to corresponding values.
Including related resources
The endpoint also supports -to some degree- the inclusion of information of related resources. To get the details of related entities the include parameter must be added to the URI in the following way:
GET {host}/v3/shipments?include=shipmentItemswill return theshipmentwith allshipmentItemsdetails.
Limitations of GET v3/shipments
- When using this endpoint, expect the following limits on the result set:
- Shipments older than 90 days are not returned using this method.
- At most 100 shipments will be returned regardless of the
page[size]settings provided in the request. - Ordering is based on the
idof theshipmentin ascending order. - Some shipment statusses are suppressed from the results when retreiving shipments in bulk using the
GET v3/shipments.
- Users are rate-limited to 1000 requests per hour on this service.
Request
Responses
- 200
- 401
- 403
- 406
- 415
- 429
A successful response consists of zero or more shipment resources being returned as part of the data element in the response body that match the filterng and pagination query parameters provided in the request. Also a set of pagination links will be returned to assist with further invokations of the endpoint.
401 Unauthorized
A 401 Unauthorized response occurs when attempting to access a resource or perform an action that requires authentication, but no valid credentials have been provided. It indicates that the requester is unauthorized to access the requested resource.
The following are common scenarios that may lead to a 401 Unauthorized response:
- Attempting to access a protected API endpoint without providing authentication credentials.
- Providing an invalid or expired authentication token.
- Providing valid authentication credentials, but lacking sufficient privileges to access the requested resource.
- Providing authentication credentials that are valid for a different resource or API endpoint than the one being requested.
403 Forbidden
The HTTP 403 Forbidden client error response status code indicates that the server understood the request but refused to process it. This status is similar to 401 Unauthorized, except that for 403 Forbidden responses, authenticating or re-authenticating makes no difference. The request failure is tied to application logic, such as insufficient permissions to a resource or action.
406 Not Acceptable
A 406 Not Acceptable response occurs when the server cannot provide a response that matches the client's requested format or content language for the requested resource. For instance, if a client sends an Accept header of text/html to an API endpoint that only supports application/json responses, the server would respond with a 406 Not Acceptable status code. This type of response is a required response for JSON:API compatible endpoints.
415 Unsupported Media Type
A 415 Unsupported Media Type response occurs when the server cannot process the request because the media type specified in the request is not supported for the requested resource. For example, if a client sends a request with a Content-Type header of application/pdf to an API endpoint that only supports application/json (the only valid media type for JSON:API), the server would respond with a 415 Unsupported Media Type status code. This type of error-response is a required for JSON:API compatible endpoints.
429 Too Many Requests
The request could not be completed because of a rate limit violation.