Getting Rates

Taking a look at the Quotes API documentation, there are a few pieces of information we'll need before we can request a quote.

What am I shipping?
Two pallets of T-shirts
48 x 42 x 46 inches (L x W x H)
50lbs each

When is the freight ready to be picked up?
9:30am, March 19th

Where am I shipping to?

Griffith Observatory: 2800 East Observatory Road, Los Angeles, CA 90027
LACMA: 5905 Wilshire Boulevard, Los Angeles, CA 90036

What are the pickup and delivery locations' open and close hours?
Griffith Observatory: 10am - 10pm
LACMA: 11am - 5pm

Contact information for the pickup and delivery locations.
Griffith Observatory: (555) 555-5555 - [email protected]
LACMA: (555) 555-5555

Are any additional services required?
Liftgate needed at both locations
Residential delivery

Let's put this information together in JSON format.

{
	"freight": [
    {
      "quantity": 2,
      "type": "Pallet",
      "weight": 50,
      "length": 48,
      "width": 42,
      "height": 46,
      "description": "T-shirts"
    }
  ],
	"pickup": {
		"name": "Griffith Observatory",
		"address": {
      "street": "2800 East Observatory Road",
      "city": "Los Angeles",
      "state": "CA",
      "zip": "90027"
    },
		"accessorials": ["liftgate"],
		"phoneNumber": "+15555555555",
		"emails": ["[email protected]"],
		"openTime": "1000",
		"closeTime": "2200"
	},
	"delivery": {
		"name": "LACMA",
		"address": {
    	"street": "5905 Wilshire Boulevard",
      "city": "Los Angeles",
      "state": "CA",
      "zip": "90036"
    },
		"accessorials": ["liftgate", "residential"],
		"phoneNumber": "+15555555555",
		"openTime": "1100",
		"closeTime": "1700"
	},
	"pickupReadyDate": {
    "date": "2024-03-19",
    "time": "0930"
  }
}

We now have the information we need to get rates via the Quotes API. Let's put everything together into a cURL request.

curl -X POST \
  https://sandbox.api.mothership.com/beta/quotes \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
  -H 'Content-Type: application/json' \
  -d '{
	"freight": [{
		"quantity": 2,
		"type": "Pallet",
		"weight": 50,
		"length": 48,
		"width": 42,
		"height": 46,
		"description": "T-shirts"
	}],
	"pickup": {
		"name": "Griffith Observatory",
		"address": {
      "street": "2800 East Observatory Road",
      "city": "Los Angeles",
      "state": "CA",
      "zip": "90027"
    },
		"accessorials": ["liftgate"],
		"phoneNumber": "+15555555555",
		"emails": ["[email protected]"],
		"openTime": "1000",
		"closeTime": "2200"
	},
	"delivery": {
		"name": "LACMA",
		"address": {
    	"street": "5905 Wilshire Boulevard",
      "city": "Los Angeles",
      "state": "CA",
      "zip": "90036"
    },
		"accessorials": ["liftgate", "residential"],
		"phoneNumber": "+15555555555",
		"openTime": "1100",
		"closeTime": "1700"
	},
	"pickupReadyDate": {
    "date": "2024-03-19",
    "time": "0930"
  }
}'

We should receive a valid quote back from that request, containing pricing information, denoting any issues with our information, and informing us whether or not the quote is ready to purchase.


What’s Next

With our quote in-hand, we can now proceed to booking the shipment.