Skip to content

Shippo - Get Rates

This module gets shipping rates from multiple carriers through Shippo. It receives the origin and destination addresses in JSON format (or Shippo address IDs), the package specifications, and an optional async mode. It makes a POST request to the /shipments/ endpoint creating a shipment that returns rates from all connected carriers. It processes the response to extract rate ID, provider, service, service token, price, currency, estimated days, duration terms, and arrival date. It automatically identifies the cheapest and fastest rates.

ParameterTypeRequiredDescription
credentials_idcredentialsYesShippo credential (provider: shippo)
address_fromtextareaYesOrigin address in JSON or Shippo address ID
address_totextareaYesDestination address in JSON or Shippo address ID
parceltextareaYesPackage in JSON (length, width, height, distance_unit, weight, mass_unit)
async_modebooleanNoAsync mode - faster for many carriers (default: false)

A shippo type credential is required with the following fields:

  • api_token: Shippo API Token
{
"success": true,
"shipment_id": "shp_abc123",
"rates": [
{
"rate_id": "rate_abc123",
"carrier": "USPS",
"service": "Priority Mail",
"service_token": "usps_priority",
"price": "7.58",
"currency": "USD",
"estimated_days": 2,
"duration_terms": "1-3 business days",
"arrives_by": null
}
],
"rates_count": 10,
"cheapest": {
"rate_id": "rate_def456",
"carrier": "USPS",
"service": "First Class",
"price": "4.50"
},
"fastest": {
"rate_id": "rate_ghi789",
"carrier": "FedEx",
"service": "FedEx 2Day",
"estimated_days": 1
},
"message": "10 tarifas obtenidas"
}
{
"credentials_id": "mi_credencial_shippo",
"address_from": "{\"name\":\"Remitente\",\"street1\":\"Calle Gran Via 1\",\"city\":\"Madrid\",\"state\":\"MD\",\"zip\":\"28001\",\"country\":\"ES\"}",
"address_to": "{\"name\":\"Destinatario\",\"street1\":\"Av Diagonal 100\",\"city\":\"Barcelona\",\"state\":\"CT\",\"zip\":\"08001\",\"country\":\"ES\"}",
"parcel": "{\"length\":\"25\",\"width\":\"15\",\"height\":\"10\",\"distance_unit\":\"cm\",\"weight\":\"1\",\"mass_unit\":\"kg\"}"
}
  • Addresses can be full JSON objects or previously created Shippo address IDs
  • The package requires explicit units (distance_unit: cm/in, mass_unit: kg/lb/oz)
  • The returned shipment_id is not used directly; the rate_id is used to purchase a rate
  • The cheapest and fastest fields are calculated automatically
  • Async mode is recommended when you have many connected carriers