Shipments are not created in the system until an order goes into picking. There may be multiple shipments for one order depending on the overall weight and number of items on the order. Although there may be more than one package for a single shipment, most shipments will have only one package. A packing slip will be printed for each shipment and if multiple packages are required for one shipment they will be linked to the same master tracking number if supported by the carrier.

Methods


Entity Properties


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.

Parameters

filters
null | object
  • 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”.
options
null | array
  • null - No options will be applied.
  • object - Apply specified Search Options.
fields
null | string | object
  • 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"]
See Shipment Properties.

Return Value

An array of objects. Each object will contain the specified (or default if no fields parameter was given) Shipment Properties.

Error Codes

codemessage
101Invalid filters given. Details in error message.

shipment.info

shipment.info(string $shipment) Retrieve all shipment information.

Parameters

shipment
string
Shipment ID. Can be retrieved from the order “shipments” property.

Return Value

Shipment information.

Example Request

Request
{
    "jsonrpc": 2.0,
    "id": 1234,
    "method": "call",
    "params": [
        "97ca4f4a5cdca59e9dd0fe52e28bf7cf",
        "shipment.info",
        "100000020"
    ]
}

Example Response

Response
{
    "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"
            }
        ]
    ]
}

Example Response

Response
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "result" : true
}

Error Codes

codemessage
100Requested shipment does not exist.
102Invalid data given. Details in error message.

Entity Properties

Shipment Properties

Shipment Item Properties

Package Properties

Shipment Track Properties

Serial Number Properties

Shipment Custom Field

An object with a Custom Field code as the key and the Custom Field data as the value. The value format depends on the Custom Field input type. "custom_fields": { ... } To find out what fields are available see Shipment Custom Fieldsshipment_custom_field.list