shipment.search
shipment.search(null|object $filters, array $options = [], null|string|object $fields = [])
Retrieve list of shipments by filters. Shipment data can be customized by specifying properties to retrieve.
null
- Retrieve list of all shipments.object
- Retrieve list of shipments using specified Search Filters.
Allowed properties for filtering: “shipment_id”, “warehouse_id”, “order_unique_id”, “order_ref”, “order_id”, “store_code”, “created_at”, “updated_at”, “packed_at”, “status”, “shipment_type”.null
- No options will be applied.object
- Apply specified Search Options.null
- Retrieve only “shipment_id”, “order_unique_id”, and “order_ref” properties.string '*'
- Retrieve all properties excluding “shipping_address”, “items”, “packages”, “tracking_numbers”, and “serial_number_data”.object
- List of properties to retrieve in addition to “shipment_id”, “order_unique_id”, and “order_ref”. List may include ’*’.
Example:["*", "shipping_address", "packages"]
code | message |
---|---|
101 | Invalid filters given. Details in error message. |
shipment.info
shipment.info(string $shipment)
Retrieve all shipment information.
{
"jsonrpc": 2.0,
"id": 1234,
"method": "call",
"params": [
"97ca4f4a5cdca59e9dd0fe52e28bf7cf",
"shipment.info",
"100000020"
]
}
{
"jsonrpc": 2.0,
"id": 1234,
"error": null,
"result":
{
"shipment_id": "100000020",
"warehouse_id": 1,
"order_unique_id": "10000015",
"order_ref": "ABC-54321",
"store_code": "acme",
"status": "packing",
"shipment_type": "parcel",
"total_weight": "13.2300",
"total_weight_unit": "lb",
"total_item_weight": "12.1100",
"total_item_weight_unit": "lb",
"total_qty": "2.0000",
"shipped_weight": "13.2300",
"shipped_weight_unit": "lb",
"source": "123",
"tpb_group_id": 1,
"manifest_courier_code": "fedex",
"manifest_courier_name": "FedEx",
"created_at": "2014-07-24T18:51:18+00:00",
"updated_at": "2014-07-24T18:51:18+00:00",
"items": [
{
"sku": "product2",
"name": "product2",
"weight": "12.0500",
"weight_unit": "lb",
"qty": "1.0000",
"qty_picked": "1.0000",
"qty_shipped": "0.0000",
"order_item_id": 121,
"package_data": [
{"order_item_id": 121, "label": "Serial Number - 8 Characters", "value": "55285368"}
],
"lot_data": [
{"lot_number": "83CBC2", "expiration_date": "2021-10-05", "origination_date": "2019-01-23", "qty": "1.0000"}
]
},
{
"sku": "product1",
"name": "product1",
"weight": "1.2300",
"weight_unit": "lb",
"qty": "1.0000",
"qty_picked": "1.0000",
"qty_shipped": "1.0000",
"order_item_id": 122,
"package_data": [
{"order_item_id": 122, "label": "Serial Number - 8 Characters", "value": "55285442"}
],
"lot_data": [
{"lot_number": "83CCC2", "expiration_date": "2021-10-25", "origination_date": "2019-01-23", "qty": "1.0000"}
],
"ssccs": [
{"sscc": "508101336500131005", "package_index": 0}
]
}
],
"packages": [
{
"warehouse_id": "1",
"shipment_id": "1100000061",
"shipment_status": "packed",
"status": "packed",
"carrier": "fedex",
"created_at": "2014-07-24T18:51:18+00:00",
"tracking_added_at": "2014-07-24T18:51:18+00:00",
"shipped_at": "2014-07-24T18:51:18+00:00",
"delivered_at": "2014-07-24T18:51:18+00:00",
"weight": "13.2300",
"weight_unit": "lb",
"billable_weight": "14",
"billable_weight_unit": "lb",
"dimensional_weight_divisor": "139",
"dimensional_weight_divisor_unit": "in^3/lb",
"dimensional_weight": "14",
"rating_weight_unit": "lb",
"dimensions": {
"length": "16.000",
"width": "12.000",
"height": "8.000"
},
"dimension_unit": "in",
"tracking": [
{
"number": "800027315160887",
"description": "FedEx International Economy",
"track_url": "https://www.fedex.com/apps/fedextrack/?action=track&tracknumbers=800027315160887"
}
],
"order_items": [
{
"order_item_id": "122",
"order_item_ref": null,
"sku": "product1",
"quantity": "1.0000"
}
],
"package_items": [
{
"order_item_id": "122",
"sku": "product1",
"quantity": "1.0000"
}
],
"package_data": [
{"order_item_id": 121, "label": "Serial Number - 8 Characters", "value": "55285368"},
{"order_item_id": 122, "label": "Serial Number - 8 Characters", "value": "55285442"}
],
"serial_number_data": [
{
"serial_id": "1",
"identifier": "123456123456",
"sku": "product1",
"product_id": "7"
}
]
}
],
"tracking_numbers": [
{
"carrier": "fedex",
"description": "FedEx International Economy",
"number": "800027315160887",
"date": "2014-07-24T18:51:18+00:00",
"items": [
{"sku": "product1", "quantity": "1.0000" },
{"sku": "product2", "quantity": "1.0000" }
],
"weight": "13.2300",
"weight_unit": "lb"
}
],
"custom_fields": {
"freight_broker": { "id": 15, "label": "FreightClub" },
"hazmat_inspected_by": { "value": 414 }
}
}
}
### Error Codes
| code | message |
| ---- | ------- |
| 100 | Requested shipment does not exist. |
---
## `shipment.update`
`shipment.update (string $shipment, object $shipmentData, object $customFields)`
Update shipment information.
### Parameters
<ParamField path="shipment" type="string">
Shipment ID. Can be retrieved from the order "shipments" property.
</ParamField>
<ParamField path="shipmentData" type="object">
Shipment data.
Allowed properties: source.
</ParamField>
<ParamField path="customFields" type="object">
Shipment Custom Field Operations (see [Shipment Custom Field Operations](#shipment-custom-field-operations)).
</ParamField>
### Shipment Custom Field Operations
An object with an operation name as the key and an object containing the [Shipment Custom Field](#shipment-custom-field)) data for all operations except the `remove` operation. The `remove` operation only requires a list of custom field codes.
Allowed operations: `set`, `add`, `remove`, `add_option`, `remove_option`.
- `set` - Replace all values.
- `add` - Add new fields to existing, replace old values.
- `remove` - Remove only fields specified.
- `add_option` - Multi-selects only. Add an option without unsetting existing options.
- `remove_option` - Multi-selects only. Remove an option without unsetting other options not listed.
### Return Value
`true` if shipment was successfully updated.
### Example Request
```json title="Request"
{
"jsonrpc": 2.0,
"id": 1234,
"method": "call",
"params": [
"97ca4f4a5cdca59e9dd0fe52e28bf7cf",
"shipment.update",
[
"100000020",
{
"source": "123456"
}
]
]
}
{
"jsonrpc" : 2.0,
"id" : 1234,
"result" : true
}
code | message |
---|---|
100 | Requested shipment does not exist. |
102 | Invalid data given. Details in error message. |
Show Shipment Properties
total_weight
. See: Weight Units.total_item_weight
. See: Weight Units.shipped_weight
. See: Weight Units.Show Shipment Item Properties
weight
. See: Weight Units.Show Package Properties
weight
. See: Weight Units.billable_weight
. See: Weight Units.dimensional_weight
. See: Weight Units.length
, width
, and height
of the package.length
, width
, and height
in dimensions
. See: Length Units.Show Shipment Track Properties
weight
. See: Weight Units.Show Serial Number Properties
"custom_fields": { ... }
To find out what fields are available see Shipment Custom Fields — shipment_custom_field.list
Show Shipment Custom Field
{ "main_sku" : { "value" : "product2" } }
{ "shipment_details" : { "value" : "Long multiline
shipment details
here." } }
{ "number_of_skus" : { "value" : 5 } }
{ "length_and_girth" : { "value" : 54.25 } }
{ "cost_of_goods" : { "amount" : 105.95 } }
label
or id
key or both.{ "claim_reason" : { "id" : 13 } }
id
.{ "claim_reason" : { "label" : "Damaged in shipping" } }
label
.{ "claim_reason" : { "id" : 13, "label" : "Damaged in shipping" } }
id
and label
. The id
and the label
must refer to the same option.label
or id
key or both.{ "claim_reasons" : [ { "id" : 13 }, { "id" : 14 } ] }
id
.{ "claim_reasons" : [ { "label" : "Damaged in shipping" }, { "label" : "Did not fit" } ] }
label
.{ "claim_reasons" : [ { "id" : 13, "label" : "Damaged in shipping" }, { "id" : 14, "label" : "Did not fit" } ] }
id
and label
. The id
and the label
must refer to the same option.{ "allow_mailer" : { "value" : true } }
Y-m-d
format.{ "desired_delivery_date" : { "value" : "2023-01-23" } }
{ "created_by" : { "value" : 5 } }
{ "created_by" : { "value" : 7 } }
{ "custom_email" : { "value" : "john.doe@example.com" } }
{ "documentation_url" : { "value" : "https://example.com" } }