deliveryBoxFitPreview
Requires permission settings:sales:read.
Tests a box being added or edited with one product variant: how many the packing engine puts in one such box, what limits it, and a suggested arrangement by shape. Stores nothing. Requires permission to read sales settings.
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:
- GraphQL
- cURL
query DeliveryBoxFitPreview($input: DeliveryBoxFitPreviewInput!) {
deliveryBoxFitPreview(input: $input) {
capacity
capped
limitedBy
item {
fragile
heightCm
label
lengthCm
ownPackaging
quantity
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query DeliveryBoxFitPreview($input: DeliveryBoxFitPreviewInput!) {\n deliveryBoxFitPreview(input: $input) {\n capacity\n capped\n limitedBy\n item {\n fragile\n heightCm\n label\n lengthCm\n ownPackaging\n quantity\n }\n }\n}",
"variables": {
"input": {
"heightCm": 0,
"lengthCm": 0,
"maxWeightKg": 0,
"tareWeightKg": 0,
"variantId": "id",
"widthCm": 0
}
}
}
EOF
Variables:
{
"input": {
"heightCm": 0,
"lengthCm": 0,
"maxWeightKg": 0,
"tareWeightKg": 0,
"variantId": "id",
"widthCm": 0
}
}
Response:
{
"data": {
"deliveryBoxFitPreview": {
"capacity": 0,
"capped": true,
"limitedBy": "DOES_NOT_FIT",
"item": {
"fragile": true,
"heightCm": 0,
"label": "string",
"lengthCm": 0,
"ownPackaging": true,
"quantity": 0
}
}
}
}
deliveryBoxFitPreview(
input: DeliveryBoxFitPreviewInput!
): DeliveryBoxFitPreview!
Arguments
deliveryBoxFitPreview.input ● DeliveryBoxFitPreviewInput! non-null input
The box's inside size and weights, and the variant to test it with.
Type
DeliveryBoxFitPreview object
How many of one product variant one box holds by the packing engine's rules, what limits it, and a suggested arrangement (which may place fewer: the engine counts volume only).