/
The first step in determining how items should be packaged is to provide the packaging options that you commonly use to ship items.
Mutation
mutation {
createPackagingOption(
input: {
height: "10"
length: "5"
weightCapacity: "100"
width: "5"
dimensionalUnit: INCH
name: "Box 1"
type: PACKAGE
weightUnit: POUND
}
) {
name
width
weightUnit
weightCapacity
height
length
}
}
Response
{
"data": {
"createPackagingOption": {
"name": "Box 1",
"width": 5,
"weightUnit": "POUND",
"weightCapacity": 100,
"height": 10,
"length": 5
}
}
}
Once you have provided packaging options, you will perform the cartonize
mutation. This will take in the shipTo
, shipFrom
, and item
details in order to properly determine which items will go in which box for shipping.
Mutation
mutation {
partyCreateWorkflow(
input: [
{ type: ORIGIN, location: { countryCode: US } }
{ type: DESTINATION, location: { countryCode: CA } }
]
) {
id
}
itemCreateWorkflow(
input: [
{
quantity: 4
amount: 50
productId: "123"
description: "test 1223"
currencyCode: USD
measurements: [
{ type: WEIGHT, value: 10, unitOfMeasure: POUND }
{ type: LENGTH, value: 10, unitOfMeasure: INCH }
{ type: WIDTH, value: 5, unitOfMeasure: INCH }
{ type: HEIGHT, value: 2, unitOfMeasure: INCH }
]
}
]
) {
id
}
cartonizeWorkflow {
packagingOption {
name
}
id
width
length
height
dimensionalUnit
weight
weightUnit
items {
quantity
item {
productId
id
}
}
}
}
Response
{
"data": {
"partyCreateWorkflow": [
{
"id": "party_ee2f80f2-0775-449e-a5f8-e8c5310f9c67"
},
{
"id": "party_0ea8c605-3a4b-4e19-8f1a-316cb8ddbe78"
}
],
"itemCreateWorkflow": [
{
"id": "item_d0cb6416-17cc-404f-9755-a93ce4356c38"
}
],
"cartonizeWorkflow": [
{
"packagingOption": {
"name": "Box 1"
},
"id": "carton_d0615c15-5158-4908-b818-9e5eeb7092ed",
"width": 5.0,
"length": 5.0,
"height": 10.0,
"dimensionalUnit": "INCH",
"weight": 20,
"weightUnit": "POUND",
"items": [
{
"quantity": 1,
"item": {
"productId": "123",
"id": "item_d0cb6416-17cc-404f-9755-a93ce4356c38"
}
},
{
"quantity": 1,
"item": {
"productId": "123",
"id": "item_d0cb6416-17cc-404f-9755-a93ce4356c38"
}
}
]
},
{
"packagingOption": {
"name": "Box 1"
},
"id": "carton_817de960-8e20-43c4-84c8-f8eedfea1f93",
"width": 5.0,
"length": 5.0,
"height": 10.0,
"dimensionalUnit": "INCH",
"weight": 20,
"weightUnit": "POUND",
"items": [
{
"quantity": 1,
"item": {
"productId": "123",
"id": "item_d0cb6416-17cc-404f-9755-a93ce4356c38"
}
},
{
"quantity": 1,
"item": {
"productId": "123",
"id": "item_d0cb6416-17cc-404f-9755-a93ce4356c38"
}
}
]
}
]
}
}
Create packaging options and cartonize with the Zonos API
Learn how to create packaging options and cartonize items prior to shipping
When fulfilling orders, it is important to package your items in the most effective way possible. The
createPackagingOptions
mutation allow users to tell Zonos about the packaging options that you use. If no packaging options are provided to us, a default value of 8x4x2 is used. Once you have provided us with your packaging options, you can use thecartonize
mutation to determine which items should be placed in which package. These details can then be passed to the carrier to provide a more accurate shipping cost calculation.