# Rate shopping with carriers ## 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 ### ![](/assets/step1.14ee6260337a0b326de06f1173e3703f933b52790e666cd390788635d3e7e0a6.9c1bb791.svg) Capture carrier object ID Capture the necessary carrier account object IDs. In this example, `6aa34d5f6865448fbb1ee93636e98999` and `7bb1235sdsd9sds6989845497874879`. ```shell curl https://api.goshippo.com/carrier_accounts \ -H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" ``` The expected response will look like this. ``` { "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 } ] } ``` ### ![](/assets/step2.37831ee18f1f0290fe49fb6b512319f7a374b18f4063f0302fe35b4afcd9816b.9c1bb791.svg) 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. ![](/assets/api_flow_docs_carrier.f9efd1fe91d81d6fd9b1c6ac907a8bee0a405d8b58d0c7cdb3261fc2bf0894f6.4050d67f.svg) ```json curl https://api.goshippo.com/shipments/ \ -H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \ -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.