Skip to main content

Get Shipment Rates

mailhub_get_shipment_rates

Get the carrier Rates available for one Shipment, so a Rate can be chosen and bought.

Permission and safety

Changes dataNo
ConfirmationNot required
Spends fundsNo
PermissionUpdate access to Orders

Input

FieldTypeRequiredNotes
shipmentIdstringYesThe Shipment's UUID. Checked for shape before the call is made.

Example input

{
"shipmentId": "22222222-2222-2222-2222-222222222222"
}

Output

FieldContents
ratesThe available Rates
totalCountHow many Rates were returned
carrierCountHow many carriers they came from

Each Rate carries its own identifier — the value mailhub_buy_label needs — along with the carrier and service information the carrier returned, the price and its currency, and delivery estimate fields where the carrier supplies them. Two presentation fields are added for readability: deliveryLabel, a phrase such as "1 day" or "Same-day delivery", and isSameDayDelivery when that applies.

The three fields above are the whole top level. The fields inside each Rate are described rather than pinned: treat them as what a Rate carries, not as a complete stable list to code against.

Prices are carried through exactly as Mailhub holds them; they are never passed through a floating-point value on the way to you.

Rules and common tool-specific errors

  • An empty result is a normal answer. No Rates means no carrier priced this Shipment — check the parcel, the addresses, and which carriers the account has configured. It is not an error condition.
  • Rates reflect the carriers already available to your account. MCP cannot enable or configure a carrier.
  • A Rate is a point-in-time quote. If it has gone stale by the time it is bought, the purchase is refused and you rate again.
CodeWhat it meansRetrying
MCP_INVALID_UUIDshipmentId is not a UUIDNo — fix the value
A correctable carrier rejectionThe carrier declined the Shipment as described — usually an address or parcel problem the message namesYes, after correcting it
A carrier being unavailableThe carrier could not be reached right nowYes, shortly

Access and shared failures live in Errors & Troubleshooting.

Next