Quote Shipment
This guide allows you to check shipping rates using the DrEnvío API. It includes information about the available environments, the list of compatible carriers, request parameters, response structure, and more.
Environments
DrEnvio API supports two environments: Production and Sandbox.
Production Environment The production environment is where real shipments are processed. To use the production API, send your requests to the following URL:
https://prod.api-drenvio.com/v2/shipments/rate
Sandbox Environment The sandbox environment is used for testing purposes. It provides simulated data to help you develop and test your integration before moving to production. To use the sandbox API, send your requests to the following URL:
https://sandbox.api-drenvio.com/v2/shipments/rate
Available Carriers
DrEnvío currently supports 17 carriers, which you can use to get shipping rates for your shipments.
- Fedex
- Sendex
- DHL
- UPS
- Carssa
- Ivoy
- Scm
- Quiken
- Ampm
- Estafeta
- Paquetexpress
- 99minutos
- Uber
- Mensajeros Urbanos
- JTExpress
- Borzo
Note: In the sandbox environment, the available carriers for quoting are JTExpress and Quiken.
API request
To get a quote for a shipment, send a POST request to the API with the following JSON body:
{ "type": "National", "origin": { "country": "MX", "postal_code": "64000" }, "destination": { "country": "MX", "postal_code": "64380" }, "packages": [ { "weight": 1, "height": 10, "width": 10, "length": 10, "volumetric": 0.2, "type": "box", "main_weight": 1 } ], "carriers": ["fedex", "estafeta", "ampm", "dhl"], "insurance": 0}
Fields description
Field | Description | Type | Required |
---|---|---|---|
type | Type of shipment | Enum: National, International | true |
origin | Origin information for shipment address | Object AddressObject | true |
destination | Destination information for shipment address | Object AddressObject | true |
packages | Packages array of items | Array PackageObject | true |
insurance | The insurance of the shipment, if insured the response will contain the amount of the insurance. MXN if national shipping, if not in USD. | number | true |
carriers | An array with each of the carriers that you want to rate your shipment. International rates are only available with fedex, dhl, ups, and estafeta. | Array of strings: AllCarriers | true |
Address (Object)
Field | Description | Type | Required |
---|---|---|---|
country | 2-digit country code for each address. Origin must always be MX , and destination can be any country. | MX | CO (or any country code) |
postalCode | Postal Code for the origin and destination addresses. | 64000 | 64380 (or any valid postal code) |
Package (Object)
Field | Description | Type | Required |
---|---|---|---|
weight | The weight of the package in kilograms (KG). | number | true |
height | The height of the package in centimeters (CM). | number | true |
width | The width of the package in centimeters (CM). | number | true |
length | The length of the package in centimeters (CM). | number | true |
volumetric | The volumetric weight of the shipment, typically calculated based on the dimensions. | number | false |
type | The type of the package. | Enum: box, envelope, pallet | true |
insurance | The insurance of the shipment, if insured the response will contain the amount of the insurance. MXN if national shipping, if not in USD. | number | false |
API response
[ { "ObjectId": null, "ShippingId": "G1", "carrier": "fedex", "service_id": "fedex_mx_D-C03_ground", "service": "ground", "price": 120, "days": "3 a 5 días", "insurance": 0, "currency": "MXN", "metadata": { "extended_area": { "extended_area": false, "origin": false, "destination": false } } }, { "ObjectId": null, "ShippingId": "G1", "carrier": "fedex", "service_id": "fedex_mx_P-C00_ground", "service": "ground", "price": 94.55, "days": "3 a 5 días", "insurance": 0, "currency": "MXN", "metadata": { "account_id": "648a19d789be2a38ae8eb0d2", "account_price": 1, "extended_area": { "extended_area": false, "origin": false, "destination": false } } }, { "ObjectId": null, "ShippingId": "G1", "carrier": "fedex", "service_id": "fedex_mx_D-C03_express", "service": "express", "price": 145, "days": "1 a 2 días", "insurance": 0, "currency": "MXN", "metadata": { "extended_area": { "extended_area": false, "origin": false, "destination": false } } }, { "ObjectId": null, "ShippingId": "G1", "carrier": "fedex", "service_id": "fedex_mx_P-C00_express", "service": "express", "price": 86.52, "days": "1 a 2 días", "insurance": 0, "currency": "MXN", "metadata": { "account_id": "648a19d789be2a38ae8eb0d2", "account_price": 1, "extended_area": { "extended_area": false, "origin": false, "destination": false } } }, { "ObjectId": "T0", "ShippingId": "N6", "carrier": "estafeta", "service": "metropolitano", "currency": "MXN", "price": 68, "insurance": 0, "service_id": "estafeta_mx_D-C03_metropolitano", "days": "2 días", "metadata": { "extended_area": { "extended_area": false, "origin": false, "destination": false }, "ocurre": false } }, { "ObjectId": "78", "ShippingId": "N6", "carrier": "estafeta", "service": "ground", "currency": "MXN", "price": 120, "insurance": 0, "service_id": "estafeta_mx_D-C03_terrestre", "days": "5 días", "metadata": { "extended_area": { "extended_area": false, "origin": false, "destination": false }, "ocurre": false } }, { "ObjectId": "D8", "ShippingId": "N6", "carrier": "estafeta", "service": "2_days", "currency": "MXN", "price": 134, "insurance": 0, "service_id": "estafeta_mx_D-C03_2dias", "days": "2 días", "metadata": { "extended_area": { "extended_area": false, "origin": false, "destination": false }, "ocurre": false } }, { "ObjectId": "60", "ShippingId": "N6", "carrier": "estafeta", "service": "next_day", "currency": "MXN", "price": 135, "insurance": 0, "service_id": "estafeta_mx_D-C03_next_day", "days": "1 día", "metadata": { "extended_area": { "extended_area": false, "origin": false, "destination": false }, "ocurre": false } }, { "ShippingId": "E1", "ObjectId": "ECONOMY SELECT DOMESTIC", "carrier": "dhl", "service": "ground", "service_id": "dhl_mx_D-C01_ground", "insurance": 0, "currency": "MXN", "days": "1 a 2 días", "metadata": { "dhl": { "productCode": "G", "productName": "ECONOMY SELECT DOMESTIC" } }, "price": 170 }, { "ShippingId": "E1", "ObjectId": "ECONOMY SELECT DOMESTIC", "carrier": "dhl", "service": "ground", "service_id": "dhl_mx_P-C00_ground", "insurance": 0, "currency": "MXN", "days": "1 a 2 días", "metadata": { "account_id": "648a1a9d89be2a38ae8eb21a", "account_price": 1, "dhl": { "productCode": "G", "productName": "ECONOMY SELECT DOMESTIC" } }, "price": 138.14 }, { "ShippingId": "E1", "ObjectId": "EXPRESS DOMESTIC", "carrier": "dhl", "service": "express", "service_id": "dhl_mx_D-C01_express", "insurance": 0, "currency": "MXN", "days": "1 a 2 días", "metadata": { "dhl": { "productCode": "N", "productName": "EXPRESS DOMESTIC" } }, "price": 175 }, { "ShippingId": "E1", "ObjectId": "EXPRESS DOMESTIC", "carrier": "dhl", "service": "express", "service_id": "dhl_mx_P-C00_express", "insurance": 0, "currency": "MXN", "days": "1 a 2 días", "metadata": { "account_id": "648a1a9d89be2a38ae8eb21a", "account_price": 1, "dhl": { "productCode": "N", "productName": "EXPRESS DOMESTIC" } }, "price": 138.14 }, { "ObjectId": "next_day_guaranteed", "ShippingId": "N4", "carrier": "quiken", "service": "ground", "service_id": "quiken_mx_D-C01_ground", "price": 92, "currency": "MXN", "days": "Siguiente día", "extra": "Next Day Guaranteed", "metadata": {} }, { "ObjectId": "local_express", "ShippingId": "N4", "carrier": "quiken", "service": "ground", "service_id": "quiken_mx_D-C01_ground36hrs", "price": 69, "currency": "MXN", "days": "36 horas", "extra": "Next Day - 36 hrs", "metadata": {} }, { "ObjectId": null, "ShippingId": "E1", "carrier": "mensajerosUrbanos", "service": "ground", "service_id": "mensajerosUrbanos_mx_A-P01_ground", "insurance": 0, "price": 117.29, "currency": "MXN", "days": "2 horas", "metadata": {} }]