Introduction
API Reference
The EnviaYa API is following the REST architectural style and uses resource-oriented URLs as well as HTTP response codes to communicate any API error. All API responses return JSON.
In the right sidebar, you can find examples that works as they are. You only need to fill the api_key variable with your personal API key. You can find it in your user configuration on enviaya.com.mx.
Error Codes & Responses
The EnviaYa API returns appropriate HTTP status codes for every request.
Authentication
Authentication
In order to authenticate you need to user your API key. You can find it under your profile. Please be sure to keep your API key secret so nobody else will create shipments with your account and without your authorization.
Authentication to our API is performed using HTTP Basic Auth. Just provide your API key as the basic auth username.
Authentication via bearer auth is also supported. To do so, simply use -H "Authorization: Bearer sk_test_YOUR_API_KEY"
If you need to authenticate via bearer auth (e.g., for a cross-origin request), use -H "Authorization: Bearer sk_test_YOUR_API_KEY".
HTTPS protocol must be used for all API requests. Request over HTTP will fail.
Attributes:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
enviaya_account optional | String | You may create several Billing accounts for your user. This can be useful for internal billing and controlling purposes or if you want to use different carrier and service configurations by account. |
carrier_account optional | String | If you want to use your own carrier account, you can transmit it here. Please note that you first need to configure your carrier accounts and access data in your EnviaYa user on https://enviaya.com.mx/ |
Core Objects
You will use and retrieve the following core objects in your requests to and response from our API. Some of the fields will only be present in the API responses and do not need to be transmitted in your requests.
Accounts
Billing accounts are used for billing, control, carrier & services filters and customer specific dicounts. A standard user usually uses only one Billing account, whereas corporate users might want to use several ones in order to for example attribute shipments and costs to specific internal departments.
Furthermore, customers who want to use their own carrier accounts, e.g. because they want to use their own negotiated rates, are able to configure them in EnviaYa and use them with our API.
Example Object
{
"enviaya_account": "Y0DCRGIU",
"carrier_account": null
}
Attributes:
Parameter | Type | Description |
---|---|---|
enviaya_account optional | String | You may create several Billing accounts for your user. This can be useful for internal billing and controlling purposes or if you want to use different carrier and service configurations by account. |
carrier_account optional | String | If you want to use your own carrier account, you can transmit it here. Please note that you first need to configure your carrier accounts and access data in your EnviaYa user on https://enviaya.com.mx/. |
Direction
Direction objects are the core of every shipment quote, a shipment label request and a pickup scheduling request. A direction object can be an origin, destination or pickup address.
Example Object
{
"direction": {
"full_name": "Juan Mario Perez Lopez",
"company": "EnviaYa",
"direction_1": "Moliere 68",
"direction_2": "Esquina Masaryk",
"latitude": 19.4319089,
"longitude": -99.1983147,
"neighborhood": "Polanco IV Seccion",
"district": "Miguel Hidalgo",
"postal_code": "11550",
"city": "Ciudad de Mexico",
"state_code": "DF",
"country_code": "MX",
"phone": "5584214124",
"tax_id": "TOU130409ID7",
"email": "info@enviaya.com.mx"
}
}
Attributes:
Parameter | Type | Description |
---|---|---|
full_name required | String | Full name: First name(s) and last name(s) of the direction. |
company optional | String | Company name |
direction_1 required | String | First street line. In most cases, this is the street name and street number. |
direction_2 optional | String | Second street line. E.g. for internal numbers or further references to encounter the direction. |
latitude optional | Float | Coordinates latitude |
longitude optional | Float | Coordinates longitude |
postal_code required if country has postal code | String | Postal Code (not mandatory for countries that do not manage postal codes) |
neighborhood optional | String | The neighborhood is only used for directions in Mexico. |
district optional | String | The district is only used for directions in Mexico. |
city required | String | The city is optional for quote requests (unless the direction country does not manage postal codes), but mandatory for pickup booking |
state_code optional | String | The state code is only needed for directions within the USA, Canada or Mexico. If no state code is provided, we try to determine |
country_code required | ISO 3166-1-alpha-2 code (ISO 2 country code) | The 2 digits ISO 3166 country code of the origin. |
phone required | String | Carriers use the phone number to call the direction contact in case of any questions or problems. If you do not know the phone number of an direction, you might consider putting your own. |
tax_id optional | String | RFC |
email optional | String | The e-mail is used for automatic shipment and tracking notification. You can leave it empty if you don’t want such notifications to be sent. |
Parcel
The parcel object defines the dimensions and the weight of the parcels or document you are sending. A shipment can contain more than just one parcel. If all parcels you are sending do have the same dimensions and weight, you can use the field quantity so specify how many parcels you are sending. If dimension or weight differ, you can send several parcel objects in your request.
Please note: It is usually cheaper to send one shipment with several parcels instead of sending one separate shipment for each parcel you are sending. (Of course, this only applies as long as all your parcels are sent to the same destination.)
Example Object
{
"parcels":[
{
"quantity": "1",
"weight": "1.5",
"weight_unit": "kg",
"length": "8",
"height": "13",
"width": "15",
"dimension_unit": "cm",
"content": "Content",
"reference": "Some Reference",
"reference_type": 4,
"value": 100.0,
"value_currency": "MXN",
"packaging_category": "XBX",
"product_category": "31181701"
}
]
}
Attributes:
Parameter | Type | Description |
---|---|---|
quantity required | Integer | The quantity of parcels with the same dimensions and weight. |
weight required | Float | The weight of the parcel. |
weight_unit required | kg , lbs |
The weight unit used. |
height required | Float | The height of the parcel. |
length required | Float | The length of the parcel. |
width required | Float | The width of the parcel. |
dimension_unit required | cm , in |
The dimension unit used. |
content required for Package | String | The content of the parcel. |
reference optional | String | Some custom reference you want to assign to the parcel |
reference_type required if reference provided | Integer | The type of reference providedSee Reference Types Catalogue |
value optional | Float | The total value of all goods in the parcel. Hint: Only put the value of the goods in one parcel here, even if you send a quantity of 5. |
value_currency optional | String | The currency of the value. |
has_dangerous_materials optional | Boolean | Indicates if the parcel contains dangerous material. |
packaging_category optional | String | Carta Porte: The category of the packaging used. (c_ClaveUnidadPeso) |
product_category optional | String | Carta Porte: The category of the goods in the parcel. (c_ClaveProdServCP) |
dangerous_material_product_category optional | String | Carta Porte: The category of the dangerous goods in the parcel. (c_MaterialPeligroso) |
dangerous_material_packaging_category optional | String | Carta Porte: The category of the packaging used for the dangerous goods. (c_ClaveUnidadPeso) |
Rate
HTTP request
POST /api/v1/rates
Example Request
POST https://enviaya.com.mx/api/v1/rates
Example Object
{
"id": 1016,
"date": "2016-11-14T06:22:54-06:00",
"carrier": "dhl",
"carrier_service_name": "DOMESTIC EXPRESS 8:30",
"carrier_service_code": "I",
"carrier_logo_url": "https://enviaya.com.mx/assets/carrier_logos/dhl-31a36e9e5147dce69c5d2ea64423081b38f2c1334eb6643c59f1be4326a6d393.png",
"carrier_logo_url_svg": "https://enviaya.com.mx/assets/carrier_logos/dhl-937284af2a7505eb5ac90ed94cef92819fbc6d55ca89eac4524045b014257459.svg",
"estimated_delivery": "2016-11-15 09:00",
"net_shipping_amount": 432.7,
"net_surcharges_amount": 95.98,
"net_total_amount": 528.68,
"vat_amount": 82.47,
"vat_rate": 16,
"total_amount": 597.91,
"public_total_amount": 597.91,
"public_total_amount_currency": "MXN",
"currency": "MXN",
"service_terms": "",
"surcharges_break_down": [
{
"surcharge_name": "FUEL SURCHARGE",
"surcharge_net_amount": 17.74,
"surcharge_vat": 2.84,
"surcharge_total": 20.58
},
{
"surcharge_name": "SHIPMENT INSURANCE",
"surcharge_net_amount": 65,
"surcharge_vat": 10.4,
"surcharge_total": 75.4
}
],
"enviaya_service_name": "",
"enviaya_service_code": ""
}
Attributes:
Parameter | Type | Description |
---|---|---|
id optional | Integer | The ID of the rate. |
date optional | Time | Date and Time of the rate. This can be important for time definte services, because they might not be delivered on time if shipment is realized until a later hour of the day. |
carrier required | String | Carrier providing the service. |
carrier_service_name optional | String | The service name used by the carrier. |
carrier_service_code | String | The service code used by the carrier. |
carrier_logo_url | String | The URL to the carrier logo. Can be used if you want to display the carrier logo to your users. |
carrier_logo_url_svg | String | The URL to the carrier logo. Can be used if you want to display the carrier logo to your users. |
estimated_delivery | Datetime | The estimated delivery date and time. Time is only provided for a time definte service. For all other services, only an estimated delivery date is provided. |
net_shipping_amount | Float | The net amount of the shipping service. This amount does not include additional surcharges that migth apply. |
net_surcharges_amount | Float | The net amount of all surcharges that apply additional to the net shipping amount. |
net_total_amount | Float | The total net amount of the shipment, including all charges that apply (shipping amound and surcharges) You will probably want to use this field if you want to know the total net shipping amount of a service. |
vat_amount | Float | The vat amount applying. |
vat_rate | Float | The vat rate. |
total_amount | Float | The total amount / final price of the shipment. This amount includes all charges that apply (shipping and surcharges) and VAT. You will probably want to use this field if you want to know the final total price of a service. |
public_total_amount | Float | The public total amount. |
public_total_amount_currency | ISO 4217 alphabetic currency code | The 3 letter currency code in ISO 4217 alphabetic standard. |
currency | ISO 4217 alphabetic currency code | The 3 letter currency code in ISO 4217 alphabetic standard. |
surcharges | Surcharges | The breakdown of surcharges that apply to your shipment. |
service_terms | String | If special terms apply for a service, these are mentioned here. |
enviaya_service_name | String | A standardized service name assigned by us. This can be used for easier understanding and comparision of the carrier services. Example: "2 day shipping". |
enviaya_service_code | String | A unique service code assigned by us and used to identify this specific service. Can be used for label creation and pickup service. |
Create a Rate
Retrieve a Rate
Shipment
Example Object
{
"shipment": {
"shipment_date": "2024-11-21",
"shipment_type": "Package",
"insured_value": 5000,
"insured_value_currency": "MXN",
"content": "Books",
"reference": "Some Reference",
"reference_type": 4,
"carrier": "DHL",
"carrier_service_code": "N",
"enviaya_service_code": "A",
"parcels":[
{
"quantity": "1",
"weight": "1.5",
"weight_unit": "kg",
"length": "8",
"height": "13",
"width": "15",
"dimension_unit": "cm",
"references":[ {} ]
}
],
"file_format": "PDF",
"label_size": "Thermal",
"label_url": "https://enviaya.com.mx/shipping/shipments/5e30e9a1-4d54-40b7-a049-d071851aee2c/after_pay",
"rate":[
{
"id": 1398164,
"date": "2016-10-07T13:56:56-05:00",
"carrier": "DHL",
"carrier_service_name": "EXPRESS DOMESTIC",
"carrier_service_code": "N",
"carrier_logo_url": "https://enviaya.com.mx/assets/carrier_logos/dhl-31a36e9e5147dce69c5d2ea64423081b38f2c1334eb6643c59f1be4326a6d393.png",
"carrier_logo_url_svg": "https://enviaya.com.mx/assets/carrier_logos/dhl-937284af2a7505eb5ac90ed94cef92819fbc6d55ca89eac4524045b014257459.svg",
"estimated_delivery": "2016-10-10",
"net_shipping_amount": 120.72,
"net_surcharges_amount": 1189.15,
"vat": 30.51,
"total_amount": 221.18,
"currency": "MXN",
"service_terms": "",
"surcharges_break_down": [
{
"surcharge_name": "SHIPMENT INSURANCE",
"surcharge_net_amount": 65,
"surcharge_vat": 1040,
"surcharge_total": 1105
},
{
"surcharge_name": "FUEL SURCHARGE",
"surcharge_net_amount": 4.95,
"surcharge_vat": 79.2,
"surcharge_total": 84.15
}
],
"enviaya_service_name": "Next Day",
"enviaya_service_code": "A"
}]
}
Shipments are the core of our API. You will use shipment objects to rate your shipments and to create shipment labels. You may also use shipments when you request a pickup, in order to let the carrier know more details of the shipment that needs to be picked up.
Attributes:
Parameter | Type | Description |
---|---|---|
shipment_type optional | Document , Package |
Defines if the shipment is a document or a package. If no value is provided, Package is assumed as shipment type. |
parcels required | Parcel | See Parcel object. |
insured_value optional | Float | Defines the amount you want to insure. Please note that shipment insurance usually generates an additional cost. |
insured_value_currency required if insured | ISO 4217 alphabetic currency code | The 3 letter currency code in ISO 4217 alphabetic standard. |
content required for type Document and Booking | String | The shipment content.Only required for the labelling service. |
reference optional | String | Some custom reference you want to assign to the parcel |
reference_type required if reference provided | Integer | The type of reference providedSee Reference Types Catalogue |
shipment_date optional | Date | The shipment date. If not provided, we will use the current date in your users time zone. |
carrier optional | String | |
carrier_service_code required for label generation | String | The service code used by the carrier. Only mandatory if you provide at least one parcel. |
enviaya_service_code optional | String | A unique service code assigned by us and used to identify this specific service. Can be used for label creation and pickup service. |
enviaya_shipment_number optional | String | |
carrier_shipment_number optional | String | |
label optional | String | The label in DBASE code |
file_format optional |
"pdf"
,
"dpl"
,
"ipl"
,
"png"
,
"json"
,
"zpl"
,
"epl"
|
The printer format of the file. |
label_size optional | "Letter" , "Thermal" |
The printer size of the label. |
label_url optional | String | The URL where the label can be downloaded. |
rate optional | Rate | The rate and charges break down of the shipment cost. |
accounts optional | Accounts | See Accounts object. |
Create a Shipment
Retrieve a Shipment
Pickup
Example Object
{ "pickup":
{
"pickup_date": "2024-11-21",
"schedule_from": "2016-07-21T01:00:00-05:00",
"schedule_to": "2016-07-21T13:00:00-05:00",
"carrier": "UPS",
"enviaya_account": "Y0DCRGIU",
"direction": {
"full_name": "Sven Crone",
"company": "EnviaYa",
"direction_1": "Kepler 195",
"direction_2": "Int. 2b, Esquina Ejercito Nacional",
"neighborhood": "Nueva Anzures",
"district": null,
"country_code": "MX",
"postal_code": "11590",
"city": "Ciudad de Mexico",
"state_code": "DF",
"phone": "5554127756",
"email": "info@enviaya.com.mx"
},
"shipment": {
"enviaya_shipment_number": "H3K9J7JS"
},
"pickup_uuid": "2274f23c-0b31-4eab-8165-d1dc489a53e4",
"carrier_pickup_confirmation_number": "12312312"
}
}
Attributes:
Parameter | Type | Description |
---|---|---|
pickup_uuid required | String | |
carrier required | DHL , FedEX , UPS , Redpack |
The carrier you want to book a pickup with. |
pickup_date required | Date | The date you want the pickup to be realized. |
schedule_from optional | Time | The earliest hour you want the carrier to pick up your shipment. Please note that nor do all carriers accept a schedule_from time neither can we guarantee the pickup in the time window provided. |
schedule_to optional | Time | The latest hour you want the carrier to pick up your shipment. Please note that nor do all carriers accept a schedule_to time neither can we guarantee the pickup in the time window provided. |
direction required | Direction | See Direction object. |
shipment optional | Shipment | See Shipment object. |
carrier_pickup optional | String | The pickup confirmation provided by the carrier. You can use this number to track your pickup status directly with the carrier. |
pickup_status optional | String | The current pickup status. |
accounts optional | Accounts | See Accounts object. |
Create a Pickup
Retrieve a Pickup
Shipment Events
Example Object
{ "status": "SUCCESS",
"status_message": "",
"checkpoints":
{
"code": "PU",
"description": "description",
"date": "2024-11-21",
"postal_code": "11550",
"city": "Mexico",
"country_code": "MX",
"country": "Mexico",
"comments": "Comments"
}
}
Attributes:
Parameter | Type | Description |
---|---|---|
code optional | String | The event code. |
short_description | String | A short description of the main event. |
description optional | String | A more detailed description of the main event. |
sub event code | String | The sub event code, which explains the event in further detail. |
sub event short description | String | A short description of the sub event. |
description | String | A more detailed description of the sub-event. |
date optional | Datetime | The date of the event. |
postal_code optional | String | The postal code the event happened at. |
city optional | String | The city the event happened at. |
country_code optional | ISO 3166-1-alpha-2 code (ISO 2 country code) | The 2 digits ISO 3166 country code the event happened at. |
country optional | String | The country name the event happened at. |
comments optional | String | Additional checkpoint comments, such as who received a shipment for example. |
carrier_code | String | The original carrier event code. |
carrier_description | String | The original carrier description of the event. |
Track a Shipment
Customs Declarations
Example Object
{ "customs":
{
"duties_payment": "Recipient",
"total_declared_value": 100,
"total_declared_value_currency": "MXN",
"commodities": [
{
"quantity": 1,
"description": "description",
"country_of_manufacture": "Country",
"unit_price": 50,
"total_customs_value": 50,
"total_customs_value_currency": "MXN",
"weight_per_piece": 2
},
{
"quantity": 2,
"description": "description",
"country_of_manufacture": "Country",
"unit_price": 25,
"total_customs_value": 50,
"total_customs_value_currency": "MXN",
"weight_per_piece": 2
}
]
}
}
Attributes:
Parameter | Type | Description |
---|---|---|
duties_payment optional | Sender , Recipient |
Defines if Sender or Recipient pays duties. Sender is only allowed if an own carrier account is used. |
total_declared_value required | Float | |
total_declared_value_currency required | String | |
commodities required | Commodities | See Commodity object. |
Commodities
Example Object
{ "commodity":
{
"quantity": 2,
"description": "description",
"country_of_manufacture": "Country",
"unit_price": 100,
"total_customs_value": 200,
"total_customs_value_currency": "MXN",
"weight_per_piece": 2
}
}
Attributes:
Parameter | Type | Description |
---|---|---|
quantity optional | Integer | Quantity of the commodity |
description optional | String | Description of the commodity |
country_of_manufacture optional | ISO 3166-1-alpha-2 code (ISO 2 country code) | The 2 digits ISO 3166 country code of the origin. |
unit_price optional | Float | The unit price |
unit_price_currency optional | ISO 4217 | The 3 letter currency code in ISO 4217 alphabetic standard. |
weight_per_piece required | Float | Weight of the commodity. |
total_customs_value required | Float | Value of the commodity |
total_customs_value_currency required | String | Currency of the commodity value. |
Amounts
Example Object
Attributes:
Parameter | Type | Description |
---|---|---|
net_shipping_amount required | String | The net amount of the shipping service. This amount does not include additional surcharges that migth apply. |
net_surcharges_amount optional | String | The net amount of all surcharges that apply additional to the net shipping amount. |
net_total_amount optional | Float | The total net amount of the shipment, including all charges that apply (shipping amound and surcharges) You will probably want to use this field if you want to know the total net shipping amount of a service. |
vat_amount optional | Float | The vat amount applying. |
vat_rate optional | Float | The vat rate. |
total_amount optional | Float | The total amount / final price of the shipment. This amount includes all charges that apply (shipping and surcharges) and VAT. You will probably want to use this field if you want to know the final total price of a service. |
currency optional | ISO 4217 alphabetic currency code | The 3 letter currency code in ISO 4217 alphabetic standard. |
surcharges optional | Surcharges | The breakdown of surcharges that apply to your shipment. |
Surcharges
Example Object
{ "surcahrges":
[
{
"name": "FUEL SURCHARGE",
"net_amount": 100.0,
"vat_amount": 16.0,
"vat_rate": 16.0,
"total_amount": 116.0
}
]
}
Attributes:
Parameter | Type | Description |
---|---|---|
name optional | String | Surcharge name. |
net_amount optional | Float | The net amount of the surcharge. |
vat_amount optional | Float | The vat amount of the surcharge. |
vat_rate optional | Float | The vat rate that applies. |
total_amount optional | Float | The total amount of the surcharge. |
Assignation
Assignation objects main purpose is to stablish the owner of certain object when everal of them can be defined.
Example Object
{
"level": "User",
"id": 1234
}
Attributes:
Parameter | Type | Description |
---|---|---|
level required | User , CorporateAccount , EnviayaAccounts |
The object to which we are going to assign. |
id required | Integer | The id of the objects for assignment, if just one of them is required. |
ids required | [Integer] | The ids of the objects for assignment, if several of them are required. |
Rating
Rates
HTTP request
POST /api/v1/rates
Example Request
POST https://enviaya.com.mx/api/v1/rates
{
"enviaya_account": "Y0DCRGIU",
"carrier_account": null,
"api_key":"YOUR_API_KEY",
"shipment":{
"shipment_type":"Package",
"parcels":[
{
"quantity":"1",
"weight":"3",
"weight_unit":"kg",
"length":"10",
"height":"20",
"width":"30",
"dimension_unit":"cm"
}
]
},
"origin_direction":{
"country_code":"MX",
"postal_code":"11550",
"latitude": 19.4319089,
"longitude": -99.1983147
},
"destination_direction":{
"country_code":"MX",
"postal_code":"01210",
"latitude": 19.3830539,
"longitude": -99.2421994
},
"insured_value":"5000",
"insured_value_currency":"MXN",
"order_total_amount": 60,
"currency":"USD",
"intelligent_filtering":true,
"enable_cached_rates":true,
"timeout":15
}
Example Response
{
"warning": [
"Lo sentimos, el envío no se puede realizar con iVoy por el momento",
"Aviso: Has usado más del 75% de tu crédito autorizado. Te recomendamos revisar y pagar tus facturas pendientes de tal modo que tengas crédito disponible hasta el siguiente ciclo de facturación."
],
"dhl": [],
"fedex": [],
"redpack": [
{
"rate_id": "71003",
"shipment_id": "6584",
"dynamic_service_name": "Día siguiente",
"date": "2018-10-01T05:02:26.724-05:00",
"carrier": "redpack",
"carrier_service_name": "EXPRESS",
"carrier_service_code": "1",
"carrier_logo_url": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/redpack.png",
"carrier_logo_url_svg": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/redpack.svg",
"estimated_delivery": "2018-10-02 00:00",
"net_shipping_amount": 268,
"net_surcharges_amount": 75,
"net_total_amount": 343,
"vat_amount": 54.88,
"vat_rate": 16,
"total_amount": 397.88,
"currency": "MXN",
"list_total_amount": 397.88,
"list_total_amount_currency": "MXN",
"subsidy_total_amount": 0,
"service_terms": "",
"surcharges_break_down": [
{
"carrier_surcharge_name": "Insurance",
"surcharge_net_amount": 75,
"surcharge_vat": 12,
"surcharge_total": 87
}
],
"enviaya_service_name": "TBD",
"enviaya_service_code": "TBD"
},
{
"rate_id": "71004",
"shipment_id": "6584",
"dynamic_service_name": "Entrega en 2 días",
"date": "2018-10-01T05:02:26.738-05:00",
"carrier": "redpack",
"carrier_service_name": "METROPOLITANO",
"carrier_service_code": "4",
"carrier_logo_url": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/redpack.png",
"carrier_logo_url_svg": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/redpack.svg",
"estimated_delivery": "2018-10-03 00:00",
"net_shipping_amount": 110.24,
"net_surcharges_amount": 75,
"net_total_amount": 185.24,
"vat_amount": 29.64,
"vat_rate": 16,
"total_amount": 214.88,
"currency": "MXN",
"list_total_amount": 214.88,
"list_total_amount_currency": "MXN",
"subsidy_total_amount": 0,
"service_terms": "",
"surcharges_break_down": [
{
"carrier_surcharge_name": "Insurance",
"surcharge_net_amount": 75,
"surcharge_vat": 12,
"surcharge_total": 87
}
],
"enviaya_service_name": "TBD",
"enviaya_service_code": "TBD"
}
],
"ups": [
{
"rate_id": "71006",
"shipment_id": "6584",
"dynamic_service_name": "Día siguiente",
"date": "2018-10-01T05:02:34.020-05:00",
"carrier": "ups",
"carrier_service_name": "UPS Saver",
"carrier_service_code": "65",
"carrier_logo_url": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/ups.png",
"carrier_logo_url_svg": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/ups.svg",
"estimated_delivery": "2018-10-02",
"net_shipping_amount": 249.03,
"net_surcharges_amount": 45,
"net_total_amount": 294.03,
"vat_amount": 47.05,
"vat_rate": 16,
"total_amount": 341.08,
"currency": "MXN",
"list_total_amount": 344,
"list_total_amount_currency": "MXN",
"subsidy_total_amount": 0,
"service_terms": "",
"surcharges_break_down": [
{
"carrier_surcharge_name": "Insurance",
"surcharge_net_amount": 45,
"surcharge_vat": 7.2,
"surcharge_total": 52.2
}
],
"enviaya_service_name": null,
"enviaya_service_code": null
},
{
"rate_id": "71007",
"shipment_id": "6584",
"dynamic_service_name": "Día siguiente (Entrega 08:30)",
"date": "2018-10-01T05:02:34.034-05:00",
"carrier": "ups",
"carrier_service_name": "UPS Worldwide Express Plus",
"carrier_service_code": "54",
"carrier_logo_url": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/ups.png",
"carrier_logo_url_svg": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/ups.svg",
"estimated_delivery": "2018-10-02 08:30",
"net_shipping_amount": 346.15,
"net_surcharges_amount": 45,
"net_total_amount": 391.15,
"vat_amount": 62.58,
"vat_rate": 16,
"total_amount": 453.73,
"currency": "MXN",
"list_total_amount": 457.79,
"list_total_amount_currency": "MXN",
"subsidy_total_amount": 0,
"service_terms": "",
"surcharges_break_down": [
{
"carrier_surcharge_name": "Insurance",
"surcharge_net_amount": 45,
"surcharge_vat": 7.2,
"surcharge_total": 52.2
}
],
"enviaya_service_name": "TBD",
"enviaya_service_code": "TBD"
},
{
"rate_id": "71008",
"shipment_id": "6584",
"dynamic_service_name": "Día siguiente (Entrega 10:30)",
"date": "2018-10-01T05:02:34.048-05:00",
"carrier": "ups",
"carrier_service_name": "UPS Worldwide Express",
"carrier_service_code": "07",
"carrier_logo_url": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/ups.png",
"carrier_logo_url_svg": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/ups.svg",
"estimated_delivery": "2018-10-02 10:30",
"net_shipping_amount": 273.76,
"net_surcharges_amount": 45,
"net_total_amount": 318.76,
"vat_amount": 51,
"vat_rate": 16,
"total_amount": 369.76,
"currency": "MXN",
"list_total_amount": 372.98,
"list_total_amount_currency": "MXN",
"subsidy_total_amount": 0,
"service_terms": "",
"surcharges_break_down": [
{
"carrier_surcharge_name": "Insurance",
"surcharge_net_amount": 45,
"surcharge_vat": 7.2,
"surcharge_total": 52.2
}
],
"enviaya_service_name": "TBD",
"enviaya_service_code": "TBD"
}
],
"minutos": []
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
origin_direction optional | Direction | See Origin direction object. |
destination_direction optional | Direction | See Destination direction object. |
shipment required | Shipment | See Shipment object. |
accounts optional | Accounts | See Accounts object. |
order_total_amount optional | Decimal | Order total amount for subsidy calculate |
intelligent_filtering optional | Boolean | If a carrier offers more than one services with the same delivery date and time, only the cheapest one of those services will be returned if the intelligent filtering option is enabled (true). On the contrary, all services will always be returned if this option is disabled (false). |
enable_cached_rates optional | Boolean | Enable cached rates |
timeout optional | Integer | This is timeout value in seconds, after the time request will be returned. |
Shipments
Shipment Booking
Example Request
POST https://enviaya.com.mx/api/v1/shipments
HTTP request
POST /api/v1/shipments
Example request
{
"enviaya_account": "Y0DCRGIU",
"carrier_account": null,
"api_key":"YOUR_API_KEY",
"carrier": "ups",
"carrier_service_code": "07",
"origin_direction": {
"full_name": "Sven Crone",
"country_code":"MX",
"postal_code":"11550",
"direction_1": "Direction 1",
"latitude": 19.4319089,
"longitude": -99.1983147,
"city": "Ciudad Mexiko",
"phone": "5554127756",
"state_code": "DF",
"neighborhood": "Neighborhood"
},
"destination_direction": {
"company": "Leopoldo Murillo",
"country_code":"MX",
"postal_code":"01210",
"direction_1": "Direction 1",
"latitude": 19.3830539,
"longitude": -99.2421994,
"city": "Ciudad Mexiko",
"phone": "5554127756",
"state_code": "DF",
"neighborhood": "Neighborhood"
},
"shipment": {
"shipment_type": "Package",
"insured_value": 200,
"insured_value_currency": "mxn",
"parcels":[
{
"quantity": 2,
"weight": 1.5,
"length": 10,
"height": 10,
"width": 10,
"weight_unit": "kg",
"content": "Content",
"value": 100.0,
"value_currency": "MXN",
"packaging_category": "XBX",
"product_category": "31181701"
},
{
"quantity": 10,
"weight": 1.5,
"length": 20,
"height": 10,
"width": 10,
"weight_unit": "kg",
"content": "Content",
"value": 100.0,
"value_currency": "MXN",
"packaging_category": "XBX",
"product_category": "31181701"
}
]
},
"cash_on_delivery_amount": 100.00,
"cash_on_delivery_currency": "MXN",
"file_format": "PDF",
"label_size": "Letter",
"quick_booking": true
}
Example Response
{
"warnings": [],
"status_message": "Se generó exitosamente el envío.",
"shipment_date": "2018-10-01T05:26:09-05:00",
"shipment_status": "Recolección pendiente",
"shipment_type": "package",
"parcels": [
{
"length": 20,
"width": 10,
"height": 10,
"quantity": 10,
"weight": 1.5,
"piece_reference": null,
"weight_unit": "kg",
"carrier_invoiced_weight": null,
"dimension_unit": "cm",
"all_references": null,
"shipment": null,
"pickup": null,
"volumetric_weight": null
},
{
"length": 10,
"width": 10,
"height": 10,
"quantity": 2,
"weight": 1.5,
"piece_reference": null,
"weight_unit": "kg",
"carrier_invoiced_weight": null,
"dimension_unit": "cm",
"all_references": null,
"shipment": null,
"pickup": null,
"volumetric_weight": null
}
],
"insured_amount": null,
"insured_amount_currency": null,
"content": "description",
"carrier": "UPS",
"carrier_service_code": "UPS Worldwide Express",
"enviaya_service_code": null,
"enviaya_shipment_number": "5E5CRBIQ",
"id": 6591,
"carrier_shipment_number": "1ZA9T9206697509399",
"label": null,
"file_format": "PDF",
"label_size": "Letter",
"label_url": "https://enviaya.com.mx/download_label_public/28935756?uuid=a32c1569-d084-4d68-8b80-dccbd2f8ce89",
"label_share_link": "/shipping/shipments/download_label?id=28935756",
"rate": {
"rate_id": "71053",
"shipment_id": null,
"dynamic_service_name": null,
"date": "2018-10-01T05:26:14-05:00",
"carrier": "UPS",
"carrier_service_name": "UPS Worldwide Express",
"carrier_service_code": "07",
"carrier_logo_url": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/ups.png",
"carrier_logo_url_svg": "https://enviaya-public.s3-us-west-1.amazonaws.com/images/ups.svg",
"estimated_delivery": null,
"net_shipping_amount": 743.65,
"net_surcharges_amount": 0,
"net_total_amount": 743.65,
"vat_amount": 118.98,
"vat_rate": 16,
"total_amount": 862.63,
"currency": "MXN",
"list_total_amount": 871.35,
"list_total_amount_currency": "MXN",
"subsidy_total_amount": null,
"service_terms": null,
"surcharges_break_down": [],
"enviaya_service_name": null,
"enviaya_service_code": null
},
"error": false,
"errors": [
""
]
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
accounts optional | Accounts | See Accounts object. |
rate_id optional | Integer | |
carrier required | DHL , FedEX , UPS |
|
carrier_service_code required | String | |
origin_direction required | Direction | See Direction object. |
destination_direction required | Direction | See Direction object. |
shipment required | Shipment | See Shipment object. |
customs required for international | Customs | Mandatory for international packages; See Customs object. |
cash_on_delivery_amount optional | Float | Amount to be paid on delivery. |
cash_on_delivery_currency optional | String | Currency of the amount to be paid on delivery |
file_format optional |
"pdf"
,
"dpl"
,
"ipl"
,
"png"
,
"json"
,
"zpl"
,
"epl"
|
If no value is provided, pdf is used as default. |
label_size optional | "Letter" , "Thermal" |
Letter, Thermal. If no value is provided, Letter is used as default. |
quick_booking optional | true , false |
The value defines if the price will be calculated right away, or after booking, in order to finish the process more fast. |
Response Parameters:
Parameter | Type | Description |
---|---|---|
label_share_link | String | This link can be shared with the public. It grants public download permission for the shipment label. |
Shipments Look Up
HTTP request
GET /api/v1/shipments/enviaya_id?api_key=YOUR_API_KEY
Example Request
GET https://enviaya.com.mx/api/v1/shipments/5E5CRBIQ?api_key=YOUR_API_KEY
Example Response
{
"shipment": {
"warnings": [],
"status_message": null,
"shipment_date": "2018-10-01T05:26:09.000-05:00",
"shipment_status": "Recolección pendiente",
"shipment_type": "package",
"parcels": [
{
"length": 20,
"width": 10,
"height": 10,
"quantity": 10,
"weight": 1.5,
"piece_reference": null,
"weight_unit": "kg",
"carrier_invoiced_weight": null,
"dimension_unit": "cm",
"all_references": null,
"shipment": null,
"pickup": null,
"volumetric_weight": null
},
{
"length": 10,
"width": 10,
"height": 10,
"quantity": 2,
"weight": 1.5,
"piece_reference": null,
"weight_unit": "kg",
"carrier_invoiced_weight": null,
"dimension_unit": "cm",
"all_references": null,
"shipment": null,
"pickup": null,
"volumetric_weight": null
}
],
"insured_amount": null,
"insured_amount_currency": null,
"content": "description",
"carrier": "UPS",
"carrier_service_code": "UPS Worldwide Express",
"enviaya_service_code": null,
"enviaya_shipment_number": "5E5CRBIQ",
"id": null,
"carrier_shipment_number": "1ZA9T9206697509399",
"label": null,
"file_format": "PDF",
"label_size": "Letter",
"label_url": "https://enviaya.com.mx/download_label_public/28935756?uuid=a32c1569-d084-4d68-8b80-dccbd2f8ce89",
"rate": null,
"error": null,
"errors": []
}
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
enviaya_id required | String | Identification number of the shipment used by EnviaYa. |
Shipment Cancellation
Shipment request cancelation
Note: You dont set the shipment to cancelled, but to request cancellation.
HTTP request
POST /api/v1/request_cancellation
Example Request
POST https://enviaya.com.mx/api/v1/request_cancellation
{
"api_key":"YOUR_API_KEY",
"enviaya_account" : "H76TM5DE",
"enviaya_id": "Y0DCRGIU",
"shipment_id": "1112233"
}
Example Response
{
"status": "SUCCESS",
"status_message": "Cancellation of the shipment 'Y0DCRGIU' was successfully requested."
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
enviaya_account optional | String | The Billing account. |
enviaya_id optional | String | The EnviaYa ID of your shipment. |
shipment_id optional | Integer | The shipment ID. |
Tracking
Shipment tracking
HTTP request
POST /api/v1/trackings
Example Request
POST https://enviaya.com.mx/api/v1/trackings
{
"carrier_account": null,
"api_key":"YOUR_API_KEY",
"carrier":"ups",
"shipment_number": "1ZA9T9220497543646"
}
Example Response
{
"status": "SUCCESS",
"enviaya_shipment_number": "LE8HZKIW",
"carrier_tracking_number": "1ZA9T9220497543646",
"estimated_delivery_date": "19/12/2017",
"expected_delivery_date": "28/12/2017",
"delivery_date": "2017-12-21T02:55:00-06:00",
"pickup_date": "2017-12-13T07:57:39-06:00",
"shipment_status": "Entregado",
"event_code": 155,
"event_description": "Entregado",
"event": "Entregado",
"status_code": 50,
"sub_event_code": null,
"sub_event": null,
"sub_event_description": null
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
carrier required | DHL , FedEx , UPS , Redpack , EnviaYa |
The carrier you want to track. If you create your shipments with us, you recommend to use the EnviaYa IDs of your shipments for tracking. |
shipment_number optional | Yes | The shipment number or EnviaYa ID of your shipment. |
reference optional | No | If you provide one or more reference(s) when creating your shipment, you can use these for tracking instead of a shipment number. |
Response Parameters:
Parameter | Type | Description |
---|---|---|
delivery_date | String | Unlike the estimated delivery date, the expected delivery date considers all existing shipment events and dynamically calculates the probable date of delivery. The main difference between the estimated delivery date and the expected delivery date is, that the estimated delivery is returned during rating and label creation and is never updated, whereas the expected delivery date will be updated over time. If you want to know the realistic date of arrival of a shipment, we recommend to consult the expected_delivery_date. |
Pickups
Pickup booking
HTTP request
POST /api/v1/pickups
Request URL
POST https://enviaya.com.mx/api/v1/pickups
Example Request
{
"enviaya_account": "Y0DCRGIU",
"carrier_account": null,
"api_key":"YOUR_API_KEY",
"carrier":"DHL",
"pickup_date":"2024-11-21",
"schedule_from": "08:00",
"schedule_to": "20:00",
"direction": {
"full_name": "Sven Crone",
"company": "EnviaYa",
"direction_1": "Kepler 195",
"direction_2": "Int. 2b, Esquina Ejercito Nacional",
"latitude": 19.4319089,
"longitude": -99.1983147,
"postal_code": "11550",
"neighborhood": "Nueva Anzures",
"district": "Miguel Hidalgo",
"city": "Ciudad de Mexico",
"state_code": "DF",
"country_code": "MX",
"phone": "5554127756",
"email": "info@enviaya.com.mx"
},
"shipment": {
"parcels":[
{
"quantity":"1",
"weight":"1.5",
"weight_unit": "kg",
"length": "5",
"height":"10",
"width":"10",
"dimension_unit": "cm"
}
]
}
}
Example response
{
"status": "SUCCESS",
"messages": {
"message": "Your pickup was created successfully"
},
"carrier_pickup_confirmation_number": "105151",
"pickup_date": "2024-11-21",
"enviaya_pickup_uuid": "3e296d45-2f89-4b6f-9687-ea6af8398f4c",
"pickup_status": "Scheduled"
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
enviaya_account optional | String | |
carrier required | DHL , FedEx , UPS , Redpack |
The carrier you want to book a pickup with. |
pickup_date required | Date | The date you want the pickup to be realized. |
schedule_from optional | Time | The earliest hour you want the carrier to pick up your shipment. Please note that nor do all carriers accept a schedule_from time neither can we guarantee the pickup in the time window provided. |
schedule_to optional | Time | The latest hour you want the carrier to pick up your shipment. Please note that nor do all carriers accept a schedule_to time neither can we guarantee the pickup in the time window provided. |
direction required | Direction | See Direction object. |
shipment parcels required | Shipment | See Shipment object. |
carrier_service_codeoptional | String | The service code used by the carrier. |
enviaya_service_codeoptional | String | A unique service code assigned by us and used to identify this specific service. Can be used for label creation and pickup service. |
accounts optional | Accounts | See Accounts object. |
Pickups Look Up
HTTP request
Example Request
GET https://enviaya.com.mx/api/v1/pickups/1234?api_key=YOUR_API_KEY
Example response
{
"pickup_date": "2024-11-21",
"schedule_from": "2016-07-21T01:00:00-05:00",
"schedule_to": "2016-07-21T13:00:00-05:00",
"carrier": "UPS",
"enviaya_account": null,
"service_code": null,
"direction": {
"full_name": "Sven Crone",
"company": "EnviaYa",
"direction_1": "Kepler 195",
"direction_2": "Int. 2b, Esquina Ejercito Nacional",
"neighborhood": "Nueva Anzures",
"district": null,
"country_code": "MX",
"postal_code": "11590",
"city": "Ciudad de Mexico",
"state_code": "DF",
"phone": "5554127756",
"email": "info@enviaya.com.mx"
},
"parcels": [ ],
"uuid": null,
"confirmation_number": null,
"status": null,
"shipment_ids": [ ]
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
id required | String | The pickup ID returned by our API when scheduling a pickup. |
Pickup statuses
Example Request
GET https://enviaya.com.mx/api/v1/get_pickup_statuses?api_key=YOUR_API_KEY
HTTP request
GET /api/v1/get_pickup_statuses?api_key=YOUR_API_KEY
Example Response
{
"pickup_statuses": [
{
"1": "Pending"
},
{
"2": "Scheduled"
},
{
"3": "Failed"
},
{
"4": "Completed"
},
{
"5": "Cancelled"
},
{
"6": "Unknown"
},
{
"7": "Shipment(s) in transit"
},
{
"8": "Booked via email"
},
{
"9": "Failed but Fixed"
},
{
"98": "Complain"
},
{
"99": "Deleted"
}
]
}
Directions
Directions Index
HTTP request
GET /api/v1/directions?api_key=YOUR_API_KEY&page=1&per_page=500
Example Request
GET https://enviaya.com.mx/api/v1/directions?api_key=YOUR_API_KEY&page=1&per_page=500
Example response
{
"directions": [
{
"id": 227,
"full_name": "Full Name",
"company": null,
"direction_1": "Street 1",
"direction_2": null,
"latitude": 19.4319089,
"longitude": -99.1983147,
"neighborhood": "Polanco IV Seccion",
"district": "Miguel Hidalgo",
"country_code": "MX",
"postal_code": "11550",
"city": "Ciudad de Mexico",
"state_code": "DF",
"phone": "5554127756",
"tax_id": "TOU130409ID7",
"email": null
},
{
"id": 42,
"full_name": "Juan Perez",
"company": "EnviaYa",
"direction_1": "Street",
"direction_2": "13 A",
"latitude": 19.3830539,
"longitude": -99.2421994,
"neighborhood": null,
"district": null,
"country_code": "MX",
"postal_code": "01210",
"city": "City",
"state_code": "DF",
"phone": "5554127756",
"tax_id": "TOU130409ID7",
"email": "info@enviaya.com.mx"
}
]
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
page | Integer | Page number |
per_page | Integer | Records per page |
get_origins optional | Boolean | Get origin's directions, true is used as default. |
get_destinations optional | Boolean | Get destination's directions, true is used as default. |
fullname optional | String | Search for specific direction's fullname |
company optional | String | Search for specific direction's company |
Webhooks
Webhooks Create
HTTP request
POST /api/v1/webhook_configurations
Example Request
POST https://enviaya.com.mx/api/v1/webhook_configurations
{
"api_key": "YOUR_API_KEY",
"url": "https://test.com",
"object": "Shipment",
"fields": [
"carrier_shipment_number",
"shipment_id",
"shipment_number",
"shop_order_id",
"status",
"status_code"
],
"events": [
"shipment.status_update",
"shipments.carrier_tracking_number_update"
],
"assign_to": {
"level": "User",
"id": 1234
}
}
Example response
{
"id": 227,
"url": "https://test.com",
"object": "Shipment",
"fields": [
"carrier_shipment_number",
"shipment_id",
"shipment_number",
"shop_order_id",
"status",
"status_code"
],
"events": [
"shipments.status_update"
],
"user": true,
"enviaya_accounts": [],
"corporate_account": null,
"verify_token": "jipcRyieeBocUbXGtYnGZ2GH",
"disabled": false,
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
url | String | The endpoint to send the webhook |
object optional | Shipment , Pickup |
The object to which this webhook should be triggered |
fields optional | String[] Fields | The fields to send to the endpoint |
events optional | String[] Events | The events to trigger the webhook |
assign_to optional | Assignation | To specify the object to which link the Webhook. logged user is used if not provided |
disabled optional | Boolean | If the webhook is disabled |
Webhooks Update
HTTP request
PUT /api/v1/webhook_configurations/:id
Example Request
PUT https://enviaya.com.mx/api/v1/webhook_configurations/227
{
"api_key": "YOUR_API_KEY",
"url": "https://test.com",
"object": "Shipment",
"fields": [
"carrier_shipment_number",
"shipment_id",
"shipment_number",
"shop_order_id",
"status",
"status_code"
],
"events": [
"shipment.status_update",
"shipments.carrier_tracking_number_update"
],
"assign_to": {
"level": "User",
"id": 1234
}
}
Example response
{
"id": 227,
"url": "https://test.com",
"object": "Shipment",
"fields": [
"carrier_shipment_number",
"shipment_id",
"shipment_number",
"shop_order_id",
"status",
"status_code"
],
"events": [
"shipments.status_update"
],
"user": true,
"enviaya_accounts": [],
"corporate_account": null,
"verify_token": "jipcRyieeBocUbXGtYnGZ2GH",
"disabled": false,
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
url | String | The endpoint to send the webhook |
object optional | Shipment , Pickup |
The object to which this webhook should be triggered |
fields optional | String[] Fields | The fields to send to the endpoint |
events optional | String[] Events | The events to trigger the webhook |
assign_to optional | Assignation | To specify the object to which link the Webhook. logged user is used if not provided |
disabled optional | Boolean | If the webhook is disabled |
Webhooks Delete
HTTP request
DELETE /api/v1/webhook_configurations/:id?api_key=YOUR_API_KEY
Example Request
DELETE https://enviaya.com.mx/api/v1/webhook_configurations/227?api_key=YOUR_API_KEY
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
Catalogues
Carriers
Example Request
GET https://enviaya.com.mx/api/v1/get_carriers?api_key=YOUR_API_KEY
HTTP request
GET /api/v1/get_carriers?api_key=YOUR_API_KEY
Example Response
{
"carriers": [
{
"4": "Redpack"
},
{
"2": "DHL"
},
{
"5": "UPS"
},
{
"1": "FedEx"
},
{
"3": "Estafeta"
}
]
}
Services
Example Request
GET https://enviaya.com.mx/api/v1/get_services?api_key=YOUR_API_KEY
HTTP request
GET /api/v1/get_services?api_key=YOUR_API_KEY
Example Response
{
"services": [
{
"UPS": [
{
"54": "UPS Worldwide Express Plus"
},
{
"07": "UPS Worldwide Express"
},
{
"08": "UPS Worldwide Expedited"
},
{
"65": "UPS Worldwide Express Saver"
},
{
"": "UPS Worldwide Express Freight"
},
{
"08": "UPS Expedited"
},
{
"07": "UPS Express"
},
{
"54": "UPS Express Plus"
},
{
"11": "UPS Standard"
},
{
"11": "UPS Standard"
},
{
"65": "UPS Express Saver"
}
]
},
{
"DHL": [
{
"YK": "12:00 PREMIUM"
},
{
"8": "EXPRESS"
},
{
"E": "EXPRESS 9:00 NonDoc"
},
{
"U": "DOMÉSTICO ENVÍO SALIDA RDD"
},
{
"M": "EXPRESS 10:30 NonDoc"
},
{
"6": "DOMÉSTICO ENVÍO RETORNO"
},
{
"T": "EXPRESS 12:00 Doc"
},
{
"Y": "EXPRESS 12:00 NonDoc"
},
{
"K": "EXPRESS 9:00 Doc"
},
{
"P": "EXPRESS WORLDWIDE NonDoc"
},
{
"L": "EXPRESS 10:30 Doc"
},
{
"D": "EXPRESS WORLDWIDE Doc"
},
{
"X": "EXPRESS ENVELOPE"
},
{
"1": "DOMÉSTICO EXPRESS 8:30"
},
{
"5": "DOMÉSTICO EXPRESS 10:30"
},
{
"9": "DOMÉSTICO EXPRESS 12:00"
},
{
"N": "DOMÉSTICO EXPRESS"
},
{
"G": "DOMÉSTICO ECONOMY SELECT"
}
]
},
{
"Estafeta": []
},
{
"Redpack": [
{
"2": "ECOEXPRESS"
},
{
"4": "METROPOLITANO"
},
{
"1": "EXPRESS"
}
]
},
{
"FedEx": [
{
"": "Embarques Pesados"
},
{
"FIRST_OVERNIGHT": "Nacional 8:30 a.m."
},
{
"PRIORITY_OVERNIGHT": "Nacional 10:30 a.m."
},
{
"FEDEX_1_DAY_FREIGHT": "1 Day Freight"
},
{
"FEDEX_2_DAY_FREIGHT": "2 Day Freight"
},
{
"": "International Economy"
},
{
"": "International Priority®*"
},
{
"": "International First®*"
},
{
"": "International Priority Freight"
},
{
"": "International Economy Freight"
},
{
"STANDARD_OVERNIGHT": "Nacional Día Siguiente"
},
{
"FEDEX_EXPRESS_SAVER": "Nacional Económico"
}
]
}
]
}
Shipment statuses
Example Request
GET https://enviaya.com.mx/api/v1/get_shipment_statuses?api_key=YOUR_API_KEY
HTTP request
GET /api/v1/get_shipment_statuses?api_key=YOUR_API_KEY
Example Response
{
"shipment_statuses": [
{
"1": "Pending"
},
{
"2": "Waiting for pickup or drop off"
},
{
"3": "In transit"
},
{
"4": "Delivered"
},
{
"5": "Delay"
},
{
"6": "Exception"
},
{
"7": "Unknown"
},
{
"97": "Booking error"
},
{
"98": "Cancelled"
},
{
"99": "Deleted"
}
]
}
Shipment Events
Example Request
GET https://enviaya.com.mx/api/v1/get_shipment_events?api_key=YOUR_API_KEY&locale=de
HTTP request
GET https://enviaya.com.mx/api/v1/get_shipment_events?api_key=YOUR_API_KEY&locale=locale
Example Response
{
"tracking_events": [
{
"UPS": [
{
"DL": {
"shipment_status": "Zugestellt",
"event_code": "DL",
"carrier_event_code": "kb_d",
"event_description": "Zugestellt"
}
},
{
"OD": {
"shipment_status": "Unterwegs",
"event_code": "OD",
"carrier_event_code": "ds_i",
"event_description": "Wird zugestellt"
}
}
]
}
]
}
Sub-Events
Example Response
{
"sub_events": [
{
"CL": "Closed"
},
{
"NP": "Not present"
},
{
"SP": "Store Pickup"
},
{
"PU": "Pick Up"
},
{
"DO": "Drop Off"
},
{
"SP": "Store Pickup"
},
{
"CR": "Customer Reported Damage"
},
{
"WD": "Wrong Direction"
},
{
"AC": "Accident"
},
{
"AC": "Accident"
},
{
"DC": "Delivery Direction Change"
},
{
"VD": "Vehicle Damage"
},
{
"RP": "Repaired Packaging"
},
{
"IP": "Internal Processing Error"
},
{
"WP": "Wrong Destination Postal Code"
},
{
"PP": "Payment Problems"
},
{
"UC": "Uncontrollable Circumstances"
},
{
"PC": "Pickup Change"
}
]
}
Pickup statuses
Example Request
GET https://enviaya.com.mx/api/v1/get_pickup_statuses?api_key=YOUR_API_KEY
HTTP request
GET /api/v1/get_pickup_statuses?api_key=YOUR_API_KEY
Example Response
{
"pickup_statuses": [
{
"1": "Pending"
},
{
"2": "Scheduled"
},
{
"3": "Failed"
},
{
"4": "Completed"
},
{
"5": "Cancelled"
},
{
"6": "Unknown"
},
{
"7": "Shipment(s) in transit"
},
{
"8": "Booked via email"
},
{
"9": "Failed but Fixed"
},
{
"98": "Complain"
},
{
"99": "Deleted"
}
]
}
Method of events
Example Response
{
"event_code": [
{
"DL": "Delivered"
},
{
"OD": "Out for Delivery"
},
{
"AR": "Arrival"
},
{
"WD": "Wrong Direction"
},
{
"DA": "Delivery Attempt"
},
{
"DA": "Delivery Attempt"
},
{
"DA": "Delivery Attempt"
},
{
"DA": "Delivery Attempt"
},
{
"SR": "Shipment Received"
},
{
"DP": "Departure"
},
{
"OH": "On Hold"
},
{
"PR": "Processed"
},
{
"SR": "Shipment Received"
},
{
"SD": "Scheduled Delivery"
},
{
"PP": "Pending Pickup"
},
{
"IT": "In Transit"
},
{
"DL": "Delivered"
},
{
"RR": "Rejected by Recipient"
},
{
"DE": "Delay"
},
{
"DM": "Damage"
},
{
"ES": "Export Scan"
},
{
"DM": "Damage"
},
{
"CP": "Courier Pickup"
},
{
"TH": "Theft"
},
{
"CN": "Cancelled"
},
{
"ND": "Not delivered"
},
{
"DA": "Delivery Attempt"
},
{
"DE": "Delay"
},
{
"PR": "Processed"
},
{
"DE": "Delay"
},
{
"DM": "Damage"
},
{
"DE": "Delay"
},
{
"EE": "Exceeding Weight or Dimensions"
},
{
"FC": "Forbidden Content"
},
{
"SP": "Store Pickup"
},
{
"DE": "Delay"
},
{
"DE": "Delay"
},
{
"DE": "Delay"
},
{
"WD": "Wrong Direction"
},
{
"SH": "Shipment Hold"
},
{
"DE": "Delay"
},
{
"PP": "Pending Pickup"
}
]
}
Get Postal Code Information
Example Request
GET https://enviaya.com.mx/api/v1/get_postal_code_information?api_key=YOUR_API_KEY&country_code=mx&page=1&per_page=500&postal_code=11550
HTTP request
GET /api/v1/get_postal_code_information?api_key=YOUR_API_KEY&country_code=COUNTRY_CODE&page=1&per_page=500&postal_code=POSTAL_CODE
Example Response
{
"postal_code_information": [
{
"postal_code": "11550",
"neighborhood": "Polanco IV Seccion",
"district": "Miguel Hidalgo",
"state": "Distrito Federal",
"city": "Ciudad de Mexico",
"state_code": "DF"
}
]
}
Get States
Example Request
GET https://enviaya.com.mx/api/v1/get_states?api_key=YOUR_API_KEY&country_code=us
HTTP request
GET /api/v1/get_states?api_key=YOUR_API_KEY&country_code=country_code
Example Response
{
"states": [
{
"ak": "Alaska"
},
{
"al": "Alabama"
},
{
"ar": "Arkansas"
}
]
}
Get Accounts
Example Request
GET https://enviaya.com.mx/api/v1/get_accounts?api_key=YOUR_API_KEY
HTTP request
GET /api/v1/get_accounts?api_key=YOUR_API_KEY
Example Response
{
"enviaya_accounts": [
{
"account": "UH97C34F",
"alias": "Company",
"status": "active"
}
]
}
Get Countries
Example Request
GET https://enviaya.com.mx/api/v1/get_countries?api_key=YOUR_API_KEY
HTTP request
GET /api/v1/get_countries?api_key=YOUR_API_KEY
Example Response
{
"countries": [
{
"country_code": "AD",
"country": "Andorra",
"translated_name": "Andorra",
"currency_code": "EUR"
},
{
"country_code": "AE",
"country": "United Arab Emirates",
"translated_name": "Emiratos Árabes Unidos",
"currency_code": "AED"
}
]
}
Get Account Saldo
Example Request
GET https://enviaya.com.mx/api/v1/get_account_saldo?api_key=YOUR_API_KEY
HTTP request
GET /api/v1/get_account_saldo?api_key=YOUR_API_KEY
Example Response
{
"enviaya_account_saldo": [
{
"account": "8IA8OICA",
"alias": "My Account",
"balance": "154.55",
"currency": "MXN",
"order_type": "Credit"
},
{
"account": "DB1HDFWA",
"alias": "Another Account",
"balance": "0.0",
"currency": "MXN",
"order_type": "Credit"
}
]
}
Get Users
Example Request
GET https://enviaya.com.mx/api/v1/get_users?api_key=YOUR_API_KEY
HTTP request
GET /api/v1/get_users?api_key=YOUR_API_KEY
Example Response
{
"users": [
{
"firstname": "Sven",
"lastname": "Crone",
"email": "info@enviaya.com.mx",
"created_at": "2017-06-01T13:39:46.243-05:00",
"last_login_at": null,
"last_activity_at": null
}
]
}
Get Subsidy Amount
Example Request
GET https://enviaya.com.mx/api/v1/get_subsidy?api_key=YOUR_API_KEY¤cy=USD&enviaya_account=8IA8OICA&order_totl_amount=60
HTTP request
GET /api/v1/get_subsidy?api_key=YOUR_API_KEY¤cy=currency&order_total_amount=order_amount
Example Response
{
"subsidy":
{
"total_amount": 0.51,
"currency": "USD"
}
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
order_total_amount required | Decimal | Order total amount for subsidy amount calculate |
currency required | String | Currency of order total amount |
enviaya_account optional | String | Account for subsidy amount calculate |
Carta Porte Catalogues
Example Request
GET https://enviaya.com.mx/api/v1/carta_porte_catalogues?api_key=YOUR_API_KEY&key=X1F&name=c_ClaveUnidadPeso
HTTP request
GET https://enviaya.com.mx/api/v1/carta_porte_catalogues?api_key=YOUR_API_KEY&key=X1F&name=c_ClaveUnidadPeso
Example Response
{
"catalogues":
[{
"key": "X1F",
"value": "Contenedor flexible"
}]
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
name required | String | Name of the catalogue, eg. c_ClaveUnidadPeso |
key optional | String | Key of the element, eg. X1F |
value optional | String | Value of the catalogue, eg. Contenedor flexible |
Webhooks Fields
Example Request
GET https://enviaya.com.mx/api/v1/get_webhook_configuration_fields?api_key=YOUR_API_KEY&object_type=Shipment
HTTP request
GET /api/v1/get_webhook_configuration_fields?api_key=YOUR_API_KEY&object_type=Shipment
Example Response
[
"id",
"email",
"company",
"date",
"carrier_name",
"city",
"district",
"user_id",
"created_at",
"updated_at",
"status",
"neighborhood",
"full_name",
"booking_time",
"schedule_from",
"schedule_to",
"confirmation_number",
"phone",
"direction_1",
"direction_2",
"postal_code",
"state_code",
"country_code",
"enviaya_account_id",
"error_message",
"uuid",
"enviaya_account",
"carrier_id",
"test",
"latitude",
"longitude",
"gmaps_url",
"locale",
"id",
"confirmation_number",
"status"
]
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
object_type optionak | Shipment , Pickup |
Object for which we are looking the available fields to be sent through webhook |
Webhooks Events
Example Request
GET https://enviaya.com.mx/api/v1/get_webhook_configuration_events?api_key=YOUR_API_KEY&object_type=Shipment
HTTP request
GET /api/v1/get_webhook_configuration_events?api_key=YOUR_API_KEY&object_type=Shipment
Example Response
{
"Shipment Status Update": "shipments.status_update",
"Shipment Label Updat": "shipments.label_update",
"Shipment Carrier Shipment Number Update": "shipments.carrier_tracking_number_update",
"Shipment Amounts Update": "shipments.amounts_update",
"Shipment Origin Update": "shipments.origin_update",
"Shipment Destination Update": "shipments.destination_update",
"Shipment Est Delivery Date Update": "shipments.estimated_delivery_date_update"
}
Query Parameters:
Parameter | Type | Description |
---|---|---|
api_key required | String | YOUR_API_KEY |
object_type optionak | Shipment , Pickup |
Object for which we are looking the available events to trigger the webhook |
Get Reference Types Ids
Example Request
GET https://enviaya.com.mx/api/v1/get_reference_types?api_key=YOUR_API_KEY
HTTP request
GET https://enviaya.com.mx/api/v1/get_reference_types?api_key=YOUR_API_KEY
Example Response
[
"1": "Categoría",
"2": "Centro de Costos",
"3": "Cliente",
"4": "Número del Pedido",
"5": "Número de Seríe",
"6": "Etiquete",
"7": "Otro"
]