API referenceQuotes
Create a quote
Creates a quote from the shipment details you send. The response lists the available rates with their prices, and a quote ID to use with Create a shipment.
/ quoteshttps:/ / sandbox.api.mothership.com/ beta$MOTHERSHIP_API_TOKENHover a key to see what it means. Click it to jump to the field.
Build a quote request
Change the shipment and the code samples, Try it and the spec check update as you type.
Freight
Purchasable metadata
In the response, there is a metadata field that indicates if the given quote is purchasable or if it is missing any required fields.
We require minimal information for creating quotes (such as only providing zip codes for locations or leaving out contact phone numbers). However, in order to actually book a shipment, we must have a specific location, a description of the freight, and valid contact information for both the pickup and delivery locations. metadata.invalidFieldsRequiredForPurchase lists each missing or invalid field with an errorMessage.
Rates
Each rate has an id to pass to Create a shipment along with the quote's id. See Rate services for the values in services and Providers for provider and providerScac. The quote stops being purchasable at expiresAt.
Carriers respond at different speeds. rateResponseTimeoutMs sets how long to wait for rates, 25 seconds by default. A shorter wait can return fewer rates.
Request body
application/json · requiredHow long to wait for rates, in milliseconds. Defaults to 25000. Some carriers take longer than others to return rates, so a lower value can return fewer rates. Platforms with strict timeouts, such as Shopify, may need a lower value. Use with caution.
- If you are unsure, leave this field out.
- If rates are missing, try a higher value.
- This is the time spent retrieving rates. If you have a hard limit on how long to wait for a response, set a timeout on the request itself.
If set, the minimum is 5000 (5 seconds).Defaults to25000min 5000