Order Tracking Create

POST{{api_url}}/shop/order/{{orderid}}/shipment

Creates a shipment on an existing order. It records the tracking number, the carrier, and the order lines in the package. InfiPlex forwards the tracking to the order's marketplace automatically, so the shipment becomes visible to the customer. Check the tracking number and carrier before sending.

Each request is one package with one tracking number. Every request must list the order lines in that package in package_items, including when a single package holds the whole order. For an order shipping in several boxes, send one request per box, each listing the lines in that box.

Package items reference order lines by itemid, which is the line's shop_order_itemid from order_items in Order Get, not the SKU. Order Get returns an order's shipments under tracking_numbers, each with its package_items.

Path parameters

ParameterTypeDescription
orderidintegerThe InfiPlex order ID (shop_orderid), not the marketplace order number.

Body parameters

ParameterTypeDescription
tracking_numberstringThe carrier tracking number. Required.
carrier_namestringThe carrier name as it should be recorded and sent, for example UPS, FedEx, or USPS. Any value is accepted. Required.
carrier_methodstringThe service level, for example Ground or 3rd Day.
package_itemsarrayThe order lines in this package and how many units of each. Required, even when the package holds the whole order. See Package item fields.
save_items_as_qty_onebooleanWhen true, each unit is saved as its own package item with a quantity of 1, instead of one package item per line. Used with lot and serial tracked items, as in the Advanced example.
weight_oznumberPackage weight in ounces.
length_inchesnumberPackage length in inches.
width_inchesnumberPackage width in inches.
height_inchesnumberPackage height in inches.
set_ship_from_infobooleanSet to true to record the ship_from_\* fields below on the shipment.
ship_from_namestringShip-from contact or company name.
ship_from_street1stringShip-from street address, line 1.
ship_from_street2stringShip-from street address, line 2.
ship_from_citystringShip-from city.
ship_from_statestringShip-from state, for example IL.
ship_from_zipstringShip-from ZIP or postal code.
ship_from_countrystringShip-from country code, for example US.
ship_from_warehouse_idstringThe ID of the InfiPlex warehouse the package shipped from. Use Warehouse Search to find it.

Package item fields

FieldTypeDescription
itemidstringThe order line's shop_order_itemid from Order Get. Required.
quantityintegerUnits of that line in this package. Required.
lot_numberstringLot number, for lot tracked items.
serial_numberstringSerial number, for serial tracked items.
{
    "tracking_number": "33332222",
    "carrier_name": "UPS",
    "carrier_method": "3rd Day",
    "package_items": [
        { "itemid": "1077", "quantity": 2 },
        { "itemid": "1078", "quantity": 3 }
    ]
}

See the Advanced example for lot and serial numbers, package weight and dimensions, and ship-from info.

Response fields

FieldDescription
shipment_idThe ID of the new shipment, returned as a string.

Authorization

Bearer token, sent in the Authorization header. Inherited from the collection.

Headers

KeyValueDescription
Content-Typeapplication/json

Body

{
    "tracking_number": "33332222",
    "carrier_name": "UPS",
    "carrier_method": "3rd Day",
    "package_items": [
        {
            "quantity": 2,
            "itemid": "1077"
        },
        {
            "quantity": 3,
            "itemid": "1078"
        }
    ],
    "weight_oz": 10,
    "length_inches": 5,
    "width_inches": 6,
    "height_inches": 7,
    "set_ship_from_info": true,
    "ship_from_name": "Some Contact",
    "ship_from_street1": "1234 Main St",
    "ship_from_street2": "",
    "ship_from_city": "Example City",
    "ship_from_state": "IL",
    "ship_from_zip": "12345",
    "ship_from_country": "US",
    "ship_from_warehouse_id": "7"
}

Example Request

curl --location --request POST '{{api_url}}/shop/order/{{orderid}}/shipment' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{auth_token}}' \
--data '{
    "tracking_number": "33332222",
    "carrier_name": "UPS",
    "carrier_method": "3rd Day",
    "package_items": [
        {
            "quantity": 2,
            "itemid": "1077"
        },
        {
            "quantity": 3,
            "itemid": "1078"
        }
    ],
    "weight_oz": 10,
    "length_inches": 5,
    "width_inches": 6,
    "height_inches": 7,
    "set_ship_from_info": true,
    "ship_from_name": "Some Contact",
    "ship_from_street1": "1234 Main St",
    "ship_from_street2": "",
    "ship_from_city": "Example City",
    "ship_from_state": "IL",
    "ship_from_zip": "12345",
    "ship_from_country": "US",
    "ship_from_warehouse_id": "7"
}'

Example Responses

Order Tracking Create

Request

curl --location --request POST '{{api_url}}/shop/order/{{orderid}}/shipment' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{auth_token}}' \
--data '{
    "tracking_number": "33332222",
    "carrier_name": "UPS",
    "carrier_method": "3rd Day",
    "package_items": [
        {
            "quantity": 2,
            "itemid": "1077"
        },
        {
            "quantity": 3,
            "itemid": "1078"
        }
    ]
}'

Response 200 OK

{
    "shipment_id": "123455"
}

Order Tracking Create - Advanced

Request

curl --location --request POST '{{api_url}}/shop/order/{{orderid}}/shipment' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{auth_token}}' \
--data '{
    "save_items_as_qty_one": true,
    "tracking_number": "33332222",
    "carrier_name": "UPS",
    "carrier_method": "3rd Day",
    "package_items": [
        {
            "quantity": 2,
            "itemid": "20438",
            "lot_number": "lot123"
        },
        {
            "quantity": 1,
            "itemid": "20439",
            "serial_number": "serial111"
        }
    ],
    "weight_oz": 10,
    "length_inches": 5,
    "width_inches": 6,
    "height_inches": 7,
    "set_ship_from_info": true,
    "ship_from_name": "Some Contact",
    "ship_from_street1": "1234 Main St",
    "ship_from_street2": "",
    "ship_from_city": "Example City",
    "ship_from_state": "IL",
    "ship_from_zip": "12345",
    "ship_from_country": "US",
    "ship_from_warehouse_id": "7"
}'

Response 200 OK

{
    "shipment_id": "123455"
}