Generar guia
Esta guía te permite generar una guía de envío utilizando el API de DrEnvio. Incluye información sobre los distintos entornos disponibles, la lista de transportistas compatibles, los parámetros de solicitud, la estructura de la respuesta y más.
Environments
DrEnvio API supports two environments: Production and Sandbox.
Production Environment El entorno de producción es donde se procesan los envíos reales. Para utilizar el API de producción, envía tus solicitudes a la siguiente URL:
URL utilizada para la generación de envíos con Redpack y en el caso de Fedex, sólo cuando el ShippingId es G1.
URL utilizada para la generación de envíos con las paqueterías restantes.
API request
To generate the guide, send a POST request with a JSON body like this:
Fields description
Field | Description | Type | Required |
---|---|---|---|
origin | Origin Address of shipment | Object AddressObject | true |
destination | Destination address of the shipment | Object AddressObject | true |
shipments | Shipment details | Object ShipmentObject | true |
packages | Packages | Array PackagesObject | true |
service_id | Id of the service selected | string | true |
insurance | The insurance of shipment (MXN for national, USD for international) | number | true |
carriers | Selected carrier(s) (Provided in the rate) | Array of strings | true |
Address (Object)
El campo last_name solo se utiliza para envíos de 99Minutos que contengan el ShippingId en N11 y para todas las paqueterías que tengan el código A-P10 en el service_id.
Si se deja el campo como opcional, para los envíos con el código A-P10 se rellenará automáticamente con el campo company. Para todos los envíos que no cumplan con las condiciones mencionadas, el campo debe ser ignorado.
Field | Description | Type | Required |
---|---|---|---|
name | Name of the person making/receiving the shipment. | string | true |
last_name | Last Name of the person making/receiving the shipment. | string | false |
company | Company of the person making/receiving the shipment, if not provided will be NA. | string | true |
email | Email of the person making/receiving the shipment. | string | true |
phone | Phone number of the person making/receiving the shipment. | string | true |
street | Street of the person making/receiving the shipment. | string | true |
number | Number of building of the address. | string | true |
int_number | Interior Number of building of the address. | string | false |
district | District of the address. | string | true |
city | City of the address. | string | true |
country | Always MX until next major update. | string | true |
reference | A reference to help find the address, if not provided will be NA. | string | true |
state | 2 digit state code of the address, those can be found here. | StateCode Enum | true |
postalCode | 5 digit postal code of the address. | string | true |
Package (Object)
Field | Description | Type | Required |
---|---|---|---|
width | Width of the package in CM. | number | true |
height | Height of the package in CM. | number | true |
length | Length of the package in CM. | number | true |
weight | Weight of the package in KG. | number | true |
type | The type of the package. | Enum: box, envelope, pallet | true |
name | Content of the package. | string | true |
content | Content of the package. | string | true |
declared_value | Declared Value of the package. | number | true |
contentQuant ity | Amount of packages. | number | true |
StateCode (Enum)
Name | StateCode2Digit |
---|---|
Aguascalientes | AG |
Baja California | BC |
Baja California Sur | BS |
Campeche | CM |
Chiapas | CS |
Chihuahua | CH |
Ciudad de México | CX |
Coahuila | CO |
Colima | CL |
Durango | DG |
Guanajuato | GT |
Guerrero | GR |
Hidalgo | HG |
Jalisco | JA |
Estado de México | EM |
Michoacán | MI |
Morelos | MO |
Nayarit | NA |
Nuevo León | NL |
Oaxaca | OA |
Puebla | PU |
Querétaro | QT |
Quintana Roo | QR |
San Luis Potosí | SL |
Sinaloa | SI |
Sonora | SO |
Tabasco | TB |
Tamaulipas | TM |
Tlaxcala | TL |
Veracruz | VE |
Yucatán | YU |
Zacatecas | ZA |
Shipment (Object)
El campo satContent es un código identificador del tipo de producto requerido en México por el SAT, se obtiene con el servicio de Consulta de código de productos del SAT.
Si no se utiliza el servicio mencionado, se puede colocar el código de paquete genérico en sun lugar (ejemplo: satContent: ‘31181701’)
Field | Description | Type | Required |
---|---|---|---|
carrier | Provided in the rate | string | true |
ObjectId | Provided in the rate | string | true |
ShippingId | Provided in the rate | string | true |
service | Provided in the rate | string | true |
price | Provided in the rate | number | true |
contentExplanation | An explanation of the content of the shipment, must include fabrication materials | string | true |
contentQuantity | How many items are in the box | number | true |
satContent | Product type identification code that you are sending | string | true |