> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shipstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Rating

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

## Methods

* [rate.quote](#rate-quote)
* [rate.services](#rate-services)

***

## Entity Properties

* [Destination](#destination-properties)
* [Method Information Properties](#method-information-properties)
* [Rate Properties](#rate-properties)

***

## `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

<ParamField path="destination" type="object">
  Destination (see [Destination Properties](#destination-properties))
</ParamField>

<ParamField path="items" type="object">
  Order Items. Format:

  ```json theme={null}
  [ { "sku": "product1", "qty": 1 }, { "sku": "product2", "qty": 3 } ]
  ```
</ParamField>

<ParamField path="methodInfo" type="object">
  Method Information (see [Method Information Properties](#method-information-properties))
</ParamField>

### Return Value

An object with rates and handling cost.

### Example Request

```json title="Request" theme={null}
{
    "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

```json title="Response" theme={null}
{
    "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

<ParamField path="warehouseId" type="integer | null">
  Warehouse. If not specified, the first allowed warehouse will be used.
</ParamField>

### Return Value

An array of enabled shipping methods.

### Example Request

```json title="Request" theme={null}
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "c4d62bb4c368d8158b1221cd5f27a659",
        "rate.services",
        1
    ]
}
```

### Example Response

```json title="Response" theme={null}
{
    "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

<Expandable title="Destination Properties">
  <ParamField path="country" type="string">
    The "Country" property. ISO-2 format.
  </ParamField>

  <ParamField path="region" type="string">
    The "Region" property. 2 characters.
  </ParamField>

  <ParamField path="city" type="string">
    The "City" property.
  </ParamField>

  <ParamField path="street" type="string">
    The street address. Multi-line street addresses will be separated by a newline ("\n") character.
  </ParamField>

  <ParamField path="postcode" type="string">
    The "Postal Code" property. Pass as a string to prevent leading 0s from being dropped.
  </ParamField>

  <ParamField path="company" type="string">
    The "Company" property.
  </ParamField>

  <ParamField path="classification" type="string">
    The "Classification" property. Allowed: "res" - residential, "com" - commercial, "po" - post office, "mil" - military, "unk" - unknown.
  </ParamField>
</Expandable>

### Method Information Properties

<Expandable title="Method Information Properties">
  <ParamField path="methods" type="string">
    One or more shipping methods. See the [Shipping Methods](/merchant-api/shipping-methods) document for a reference.
  </ParamField>

  <ParamField path="signature_required" type="string">
    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".
  </ParamField>

  <ParamField path="saturday_delivery" type="boolean">
    Saturday delivery option. If not specified will default to 'false'.
  </ParamField>

  <ParamField path="overbox" type="boolean">
    Request overbox option. If not specified will default to 'false'.
  </ParamField>
</Expandable>

### Rate Properties

<Expandable title="Rate Properties">
  <ParamField path="code" type="string">
    Shipping methods. See the [Shipping Methods](/merchant-api/shipping-methods) document for a reference.
  </ParamField>

  <ParamField path="description" type="string">
    See the [Shipping Methods](/merchant-api/shipping-methods) document for a reference.
  </ParamField>

  <ParamField path="zone" type="string">
    Carrier zone.
  </ParamField>

  <ParamField path="days_in_transit" type="integer">
    Days in transit.
  </ParamField>

  <ParamField path="package_count" type="integer">
    The number of packages.
  </ParamField>

  <ParamField path="shipping_cost" type="string">
    Shipping cost.
  </ParamField>

  <ParamField path="shipping_cost_currency" type="string">
    Shipping cost currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="if_ordered_by" type="string">
    Same day shipping if you place your order by this time. 24 hour clock time. Eastern Time.
  </ParamField>

  <ParamField path="min_delivery_date" type="string">
    Minimum delivery date.
  </ParamField>

  <ParamField path="max_delivery_date" type="string">
    Maximum delivery date.
  </ParamField>

  <ParamField path="signature_fee" type="string">
    Signature fee.
  </ParamField>

  <ParamField path="signature_fee_currency" type="string">
    Signature fee currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="multiple_warehouses" type="boolean">
    Multiple warehouses flag indicates if the items were split between multiple warehouses.
  </ParamField>

  <ParamField path="allocation" type="array">
    Inventory allocated to warehouses.
  </ParamField>

  <ParamField path="base_rate" type="string">
    Base rate, before surcharges are applied.
  </ParamField>

  <ParamField path="base_rate_currency" type="string">
    Base rate currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="residential_surcharge" type="string">
    Residential surcharge.
  </ParamField>

  <ParamField path="residential_surcharge_currency" type="string">
    Residential surcharge currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="area_surcharge" type="string">
    Area surcharge.
  </ParamField>

  <ParamField path="area_surcharge_currency" type="string">
    Area surcharge currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="fuel_surcharge" type="string">
    Fuel surcharge.
  </ParamField>

  <ParamField path="fuel_surcharge_currency" type="string">
    Fuel surcharge currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="weight_surcharge" type="string">
    Weight surcharge.
  </ParamField>

  <ParamField path="weight_surcharge_currency" type="string">
    Weight surcharge currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="packaging_surcharge" type="string">
    Packaging surcharge.
  </ParamField>

  <ParamField path="packaging_surcharge_currency" type="string">
    Packaging surcharge currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="dimension_surcharge" type="string">
    Dimension surcharge.
  </ParamField>

  <ParamField path="dimension_surcharge_currency" type="string">
    Dimension surcharge currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="oversize_surcharge" type="string">
    Oversize surcharge.
  </ParamField>

  <ParamField path="oversize_surcharge_currency" type="string">
    Oversize surcharge currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="demand_surcharge" type="string">
    Demand surcharge.
  </ParamField>

  <ParamField path="demand_surcharge_currency" type="string">
    Demand surcharge currency. An ISO 4217 alphabetic code.
  </ParamField>

  <ParamField path="additional_surcharge" type="string">
    Additional surcharge.
  </ParamField>

  <ParamField path="additional_surcharge_currency" type="string">
    Additional surcharge currency. An ISO 4217 alphabetic code.
  </ParamField>
</Expandable>
