Want to learn more about the Box Calc service, visit the Box Calc web site.
The Box Calc API is a JSON-RPC 2.0 web service located at: https://api.boxcalc.net/rpc
There are currently two methods available from this service: packing_list and shipping_options
This service will pack up a list of items in to the best box possible, and then return a packing list.
{
"method" : "packing_list",
"params" : [
{
"api_key" : "xxx",
"box_types" : [
{
"y" : 10,
"weight" : 20,
"name" : "A",
"x" : 5,
"z" : 8
},
{
"y" : 6,
"weight" : 7,
"name" : "B",
"x" : 4,
"z" : 2
}
],
"items" : [
{
"item" : {
"y" : 1,
"weight" : 5,
"name" : "Banana",
"x" : 3,
"z" : 4.5
},
"quantity" : 5
}
]
}
],
"jsonrpc" : "2.0",
"id" : 1
}
{
"jsonrpc" : "2.0",
"id" : 1,
"result" : [
{
"id" : "xxx",
"packing_list" : {
"Banana" : 5
},
"weight" : 45,
"name" : "A"
}
]
}
This service will pack up a list of items in to the best box possible for each mail service you request, and then look up the postage for each of those shipping options, and return the complete list.
{
"method" : "packing_list",
"params" : [
{
"api_key" : "xxx",
"from" : "53716",
"to" : "90210",
"box_types" : [
{
"y" : 10,
"weight" : 20,
"name" : "A",
"x" : 5,
"z" : 8,
"compatible_services" : [
"USPS First-Class Parcel",
"USPS Parcel Post",
"USPS Priority"
]
},
{
"y" : 6,
"weight" : 7,
"name" : "B",
"x" : 4,
"z" : 2,
"compatible_services" : [
"USPS Priority Medium Flat Rate Box"
]
}
],
"items" : [
{
"item" : {
"y" : 1,
"weight" : 5,
"name" : "Banana",
"x" : 3,
"z" : 4.5
},
"quantity" : 5
}
]
}
],
"jsonrpc" : "2.0",
"id" : 1
}
{
"jsonrpc" : "2.0",
"id" : 1,
"result" : {
"USPS Parcel Post" : {
"number_of_parcels" : 1,
"weight" : 45,
"postage" : "11.12",
"parcels" : [
{
"id" : "xxx",
"shipping" : {
"postage" : "11.12",
},
"packing_list" : {
"Banana" : 5
},
"weight" : 45,
"name" : "A"
}
]
},
"USPS Priority" : {
...
},
"USPS Priority Flat Rate" : {
...
}
}
}