Methods


Entity Properties

This API endpoint allows a merchant to request shipping and handling quotes based on a set of order items and a destination zip code.

rate.quote

rate.quote (object $destination, object $items, object $methodInfo)

Request shipping and handling quotes based on a set of order items and a destination zip code.

Parameters

0 object
Destination (see “Destination Properties”)
1 object
Order Items. Format:
[ { "sku": "product1", "qty": 1 }, { "sku": "product2", "qty": 3 } ]
2 object
Method Information (see “Method Information Properties”)

Return Value

An object with rates and handling cost.

Example Request

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "be1c13ed4e03f0ed7f1e4053dfff9658",
        "rate.quote",
        [
            {
                "country" : "US",
                "region" : "NY",
                "city" : "New York",
                "street" : "11 Times Square",
                "postcode" : "10036",
                "company" : "Microsoft",
                "classification" : "com"
                
            },
            [ 
                { 
                    "sku" : "product1", 
                    "qty": 1 
                }, 
                { 
                    "sku" : "product2", 
                    "qty" : 3 
                } 
            ],
            {
                "methods" : "ups_03",
                "signature_required" : "adult",
                "saturday_delivery" : false,
                "overbox" : false
            }
        ]
    ]
}

Example Response

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result" : {
        "rates" : [
            {
                "code" : "ups_03",
                "description" : "UPS Ground",
                "zone" : "002",
                "days_in_transit" : "2",
                "package_count" : 1,
                "shipping_cost" : "17.23",
                "shipping_cost_currency" : "USD",
                "if_ordered_by" : "15:00:00",
                "min_delivery_date" : "2017-02-05",
                "max_delivery_date" : "2017-02-05",
                "signature_fee" : "1.15",
                "signature_fee_currency" : "USD",
                "multiple_warehouses" : false,
                "allocation" : [
                    { "product1" : [{ "warehouse_id": 1, "qty": "1.000" }] },
                    { "product2" : [{ "warehouse_id": 1, "qty": "3.000" }] }
                ]
            }
        ],
        "handling_cost" : "2.4",
        "handling_cost_currency" : "USD"
    }
}

rate.services

rate.services (int|null $warehouseId)

Get a list of the enabled shipping methods.

Parameters

0 int|null
Warehouse. If not specified, the first allowed warehouse will be used.

Return Value

An array of enabled shipping methods.

Example Request

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "c4d62bb4c368d8158b1221cd5f27a659",
        "rate.services",
        1
    ]
}

Example Response

{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "result" : {
        "external_ltl" : {
            "title" : "LTL",
            "carrier_code" : "external",
            "service" : "ltl",
            "rates_available" : false
        },
        "external_ltl_thirdparty" : {
            "title" : "LTL - Third Party",
            "carrier_code" : "external",
            "service" : "ltl_thirdparty",
            "rates_available" : false
        },
        "fedex_EUROPE_FIRST_INTERNATIONAL_PRIORITY" : {
            "title" : "FedEx Europe First International Priority",
            "carrier_code" : "fedex",
            "service" : "EUROPE_FIRST_INTERNATIONAL_PRIORITY",
            "rates_available" : true
        },
        "fedex_FEDEX_1_DAY_FREIGHT" : {
            "title" : "FedEx 1 Day Freight",
            "carrier_code" : "fedex",
            "service" : "FEDEX_1_DAY_FREIGHT",
            "rates_available" : true
        },
        "fedex_FEDEX_2_DAY" : {
            "title" : "FedEx 2 Day",
            "carrier_code" : "fedex",
            "service" : "FEDEX_2_DAY",
            "rates_available" : true
        },
        "ups_02" : {
            "title" : "UPS 2nd Day Air",
            "carrier_code" : "ups",
            "service" : "02",
            "rates_available" : true
        },
        "ups_03" : {
            "title" : "UPS Ground",
            "carrier_code" : "ups",
            "service" : "03",
            "rates_available" : true
        },
        "ups_07" : {
            "title" : "UPS Worldwide Express",
            "carrier_code" : "ups",
            "service" : "07",
            "rates_available" : true
        }
    }
}

Entity Properties

Destination Properties

country
{ "country" : "US" }
The "Country" property. ISO-2 format.
region
{ "region" : "NY" }
The "Region" property. 2 characters.
city
{ "city" : "New York" }
The "City" property.
street
{ "street" : "11 Times Square\nc/oSteve Ballmer" }
The street address. Multi-line street addresses will be separated by a newline ("\n") character.
postcode
{ "postcode" : "10036" }
The "Postal Code" property. Pass as a string to prevent leading 0s from being dropped.
company
{ "company" : "Microsoft" }
The "Company" property.
classification
{ "classification" : "com" }
The "Classification" property. Allowed: "res" - residential, "com" - commercial, "po" - post office, "mil" - military, "unk" - unknown.

Method Information Properties

methods
{ "methods" : "ups_03" }
One or more shipping methods. See the Shipping Methods document for a reference.
signature_required
{ "signature_required" : "adult" }
If "adult" then the package(s) will be shipped with the Adult Signature Required option (21 years or older). If "any" then the package(s) will be shipped with the "Direct" signature required (recipient of any age). If "indirect" then the package(s) will be shipped with the "Indirect" signature required (if "Indirect" is not supported by the carrier, this option will fall back to 'any'). If not specified will default to "none".
saturday_delivery
{ "saturday_delivery" : false }
Saturday delivery option. If not specified will default to 'false'.
overbox
{ "overbox" : false }
Request overbox option. If not specified will default to 'false'.

Rate Properties

code
{ "code" : "ups_03" }
Shipping methods. See the Shipping Methods document for a reference.
description
{ "description" : "UPS Ground" }
See the Shipping Methods document for a reference.
zone
{ "zone" : "002" }
Carrier zone.
days_in_transit
{ "days_in_transit" : 2 }
Days in transit.
package_count
{ "package_count" : 2 }
The number of packages.
shipping_cost
{ "shipping_cost" : "17.50" }
Shipping cost.
shipping_cost_currency
{ "shipping_cost_currency" : "USD" }
Shipping cost currency. An ISO 4217 alphabetic code.
if_ordered_by
{ "if_ordered_by" : "15:00:00" }
Same day shipping if you place your order by this time. 24 hour clock time. Eastern Time.
min_delivery_date
{ "min_delivery_date" : "2017-02-05" }
Minimum delivery date.
max_delivery_date
{ "max_delivery_date" : "2017-02-06" }
Maximum delivery date.
signature_fee
{ "signature_fee" : "1.20" }
Signature fee.
signature_fee_currency
{ "signature_fee_currency" : "USD" }
Signature fee currency. An ISO 4217 alphabetic code.
multiple_warehouses
{ "multiple_warehouses" : false }
Multiple warehouses flag indicates if the items were split between multiple warehouses.
allocation
{ "allocation" : [{ "product1" : [{ "warehouse_id": 1, "qty": "1.000" }] }] }
Inventory allocated to warehouses.
base_rate
{ "base_rate" : "5.10" }
Base rate, before surcharges are applied.
base_rate_currency
{ "base_rate_currency" : "USD" }
Base rate currency. An ISO 4217 alphabetic code.
residential_surcharge
{ "residential_surcharge" : "7.70" }
Residential surcharge.
residential_surcharge_currency
{ "residential_surcharge_currency" : "USD" }
Residential surcharge currency. An ISO 4217 alphabetic code.
delivery_area_surcharge
{ "delivery_area_surcharge" : "8.40" }
Delivery area surcharge (DAS).
delivery_area_surcharge_currency
{ "delivery_area_surcharge_currency" : "USD" }
Delivery area surcharge currency. An ISO 4217 alphabetic code.
fuel_surcharge
{ "fuel_surcharge" : "6.29" }
Fuel surcharge.
fuel_surcharge_currency
{ "fuel_surcharge_currency" : "USD" }
Fuel surcharge currency. An ISO 4217 alphabetic code.
weight_surcharge
{ "weight_surcharge" : "5.10" }
Weight surcharge.
weight_surcharge_currency
{ "weight_surcharge_currency" : "USD" }
Weight surcharge currency. An ISO 4217 alphabetic code.
packaging_surcharge
{ "packaging_surcharge" : "2.50" }
Packaging surcharge.
packaging_surcharge_currency
{ "packaging_surcharge_currency" : "USD" }
Packaging surcharge currency. An ISO 4217 alphabetic code.
dimension_surcharge
{ "dimension_surcharge" : "5.70" }
Dimension surcharge.
dimension_surcharge_currency
{ "dimension_surcharge_currency" : "USD" }
Dimension surcharge currency. An ISO 4217 alphabetic code.
oversize_surcharge
{ "oversize_surcharge" : "11.00" }
Oversize surcharge.
oversize_surcharge_currency
{ "oversize_surcharge_currency" : "USD" }
Oversize surcharge currency. An ISO 4217 alphabetic code.
demand_surcharge
{ "demand_surcharge" : "4.00" }
Demand surcharge.
demand_surcharge_currency
{ "demand_surcharge_currency" : "USD" }
Demand surcharge currency. An ISO 4217 alphabetic code.
additional_surcharge
{ "additional_surcharge" : "4.00" }
Additional surcharge.
additional_surcharge_currency
{ "additional_surcharge_currency" : "USD" }
Additional surcharge currency. An ISO 4217 alphabetic code.