Skip to main content

packingRatePreview

Requires permission sales:sales_order:ship.

Packs the given lines and prices both packings with every enabled delivery partner, using the carrier's exact wording. It uses the same rule as checkout and the Ship dialog, and stores nothing. Requires permission to ship sales orders.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query PackingRatePreview($input: PackingRatePreviewInput!) {
packingRatePreview(input: $input) {
originWarehouseName
currency
packing {
estimatedVariantIds
freightQuote
missingWeightVariantIds
strategy
}
}
}

Variables:

{
"input": {
"lines": [
{
"quantity": 0,
"variantId": "id"
}
]
}
}

Response:

{
"data": {
"packingRatePreview": {
"originWarehouseName": "string",
"currency": "string",
"packing": {
"estimatedVariantIds": [
"id"
],
"freightQuote": true,
"missingWeightVariantIds": [
"id"
],
"strategy": "BOXES"
}
}
}
}
packingRatePreview(
input: PackingRatePreviewInput!
): PackingRatePreview!

Arguments​

packingRatePreview.input ● PackingRatePreviewInput! non-null input​

The order lines, and either a saved address ID or a typed address, with optional warehouse.

Type​

PackingRatePreview object​

The packing and live prices for some lines and an address.