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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.goshippo.com/feedback

```json
{
  "path": "/docs/Shipments/RateShoppingWithCarriers",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Rate shopping with carriers

> Compare shipping rates from multiple carriers in a single API call to find the best price and service for your shipment.

## What is rate shopping?

Rates are the cost and service levels associated with a shipment. When you want to find the best cost and service level for a shipment, you can request rates from a number of different carriers in a single call. You can then compare the results to find the option that works best for your shipment. This practice is known as rate shopping.
When you create a Shipment object, rates are automatically generated for all carriers connected with your account. This can lead to a large number of rates returned for a shipment.

Follow this guide to learn how to rate shop for a specific subset of your available carriers.

## Rate shopping for specific carriers

### Capture carrier object ID

Capture the necessary carrier account object IDs. In this example, `6aa34d5f6865448fbb1ee93636e98999` and `7bb1235sdsd9sds6989845497874879`.

```shell cURL theme={null}
curl https://api.goshippo.com/carrier_accounts \
 -H "Authorization: ShippoToken <API_TOKEN>"
```

The expected response will look like this.

```json theme={null}
{
  "next": "baseurl?page=3&results=10",
  "previous": "baseurl?page=1&results=10",
  "results": [
    {
      "account_id": "****",
      "active": true,
      "carrier": "UPS",
      "parameters": {
        "account_number": "94567e",
        ….
      },
      "is_shippo_account": false,
      "metadata": "string",
      "object_id": "6aa34d5f6865448fbb1ee93636e98999",
      "object_owner": "bob+22@gmail.com",
      "test": false
    },
 {
      "account_id": "****",
      "active": true,
      "carrier": "USPS",
      "parameters": {
        "account_number": "9090a",
        ….
      },
      "is_shippo_account": false,
      "metadata": "string",
      "object_id": "7bb1235sdsd9sds6989845497874879",
      "object_owner": "bob+22@gmail.com",
      "test": false
    }

  ]
}
```

### Get rates

To get rates for specific carriers, create a Shipment and specify the carriers to be used using `carrier_accounts` field in the `/shipments` POST request to get rates as you usually would.

<img src="https://mintcdn.com/shippo-f4b7b609/lPHnOo88WOn7xPLX/images/Guides_general/api_flow_docs_carrier.svg?fit=max&auto=format&n=lPHnOo88WOn7xPLX&q=85&s=6c8347fecabdbca421b4d0968432a9fd" className="block dark:hidden" alt="" width="1083" height="475" data-path="images/Guides_general/api_flow_docs_carrier.svg" />

<img src="https://mintcdn.com/shippo-f4b7b609/U15irEHL4bA5woLZ/images/Guides_general/api_flow_docs_carrier_dark.svg?fit=max&auto=format&n=U15irEHL4bA5woLZ&q=85&s=721735d14d6d5a8df5e623677c76400c" className="hidden dark:block" alt="" width="1083" height="475" data-path="images/Guides_general/api_flow_docs_carrier_dark.svg" />

```json theme={null}
curl https://api.goshippo.com/shipments/ \
  -H "Authorization: ShippoToken <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
      "address_to": {
          "name": "Mr Hippo",
          "street1": "965 Mission St #572",
          "city": "San Francisco",
          "state": "CA",
          "zip": "94103",
          "country": "US",
          "phone": "4151234567",
          "email": "mrhippo@shippo.com"
      },
      "address_from": {
          "name": "Mrs Hippo",
          "street1": "1092 Indian Summer Ct",
          "city": "San Jose",
          "state": "CA",
          "zip": "95122",
          "country": "US",
          "phone": "4159876543",
          "email": "mrshippo@shippo.com"
      },
      "parcels": [{
          "length": "10",
          "width": "15",
          "height": "10",
          "distance_unit": "in",
          "weight": "1",
          "mass_unit": "lb"
      }],
      "async": false,
    "carrier_accounts": [
        "6aa34d5f6865448fbb1ee93636e98999",
        "7bb1235sdsd9sds6989845497874879",
        ...
    ]

  }'
```

The expected response will include a list of Rates generated from only the carriers specified in `carrier_accounts` array.
