NAV
json

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 EnvíaYa 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 EnvíaYa user on 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

EnvíaYa accounts are used for billing, control, carrier & services filters and customer specific dicounts. A standard user usually uses only one EnvíaYa 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 EnvíaYa and use them with our API.

Example Response
{ 
    "enviaya_account": "Y0DCRGIU",
    "carrier_account": null
}

Attributes:

Parameter Type Description
enviaya_account optional String You may create several EnvíaYa 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 EnvíaYa user on 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 Response
{
    "direction": { 
        "full_name": "Juan Mario Perez Lopez", 
        "company": "Envia Ya SA de CV", 
        "direction_1": "Moliere 68", 
        "direction_2": "Esquina Masaryk", 
        "neighborhood": "Polanco IV Seccion", 
        "district": "Miguel Hidalgo", 
        "postal_code": "11550", 
        "city": "Ciudad de Mexico", 
        "state_code": "DF", 
        "country_code": "MX", 
        "phone": "(55) 8421 4124", 
        "email": "envia_con_api@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.
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.
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 Response
{
    "parcels":[ 
        { 
         "quantity": "1",
         "weight": "1.5",
         "weight_unit": "kg",
         "length": "8",
         "height": "13",
         "width": "15",
         "dimension_unit": "cm"
        }
    ]
}

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.

Rate

POST https://enviaya.com.mx/api/v1/rates

Example Response
{
  "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.png",
  "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": ""
}

Request fields:

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.
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 Response
{
"shipment": {
  "shipment_date": "2017-10-17",
  "shipment_type": "Package",
  "insured_value": 5000,
  "insured_value_currency": "MXN",
  "content": "Books",
  "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":[ {} ]
    }
  ],
  "label_format": "PDF",
  "label_url": "https://enviaya.com.mx/....................",
  "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.png",
    "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 booking String The shipment content.Only required for the labelling service.
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
label_format optional "Letter",
"ZPL",
"EPL"
The printer formar of the label.
label_file_type optional "PDF",
"JPG",
"GIF"
The fily type of the label the dbase code has to be converted to.
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 Response
{ "pickup": 
      {
            "pickup_date": "2017-10-17",
            "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": "Envia Ya SA de CV",
                "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": "tiyalcin@gmail.com"
            },
            "shipment": {
                "enviaya_shipment_number": "H3K9J7JS"
            },
            "pickup_id": "2274f23c-0b31-4eab-8165-d1dc489a53e4",
            "carrier_pickup_confirmation_number": "12312312"
      }
}

Attributes:

Parameter Type Description
pickup_id 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

Tracking Checkpoints

Example Response
{   "status": "SUCCESS",
    "status_message": "",
    "checkpoints": 
      {
            "code": "PU",
            "description": "description",
            "date": "2017-10-17",
            "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 Response
{ "customs": 
      {
            "duties_payment": "Recipient",
            "total_declared_value": "description",
            "commodities": [
                {
                    "quantity": "1",
                    "description": "description",
                    "country_of_manufacture": "Country",
                    "unit_price": 50,
                    "total_customs_value": 50
                },
                {
                    "quantity": "2",
                    "description": "description",
                    "country_of_manufacture": "Country",
                    "unit_price": 100,
                    "total_customs_value": 200
                }
            ]
      }
}

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
total_declared_value required Float
total_declared_value required String
commodities required Commodities See Commodity object.

Commodities

Example Response
{ "commodity": 
      {
            "quantity": "2",
            "description": "description",
            "country_of_manufacture": "Country",
            "unit_price": 100,
            "total_customs_value": 200
      }
}

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.

Amounts

Example Response

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 Response
{ "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.

Rating

Rates

POST https://enviaya.com.mx/api/v1/rates

Example Request
{
  "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"
    },
    "destination_direction":{
      "country_code":"MX",
      "postal_code":"01210"
    },
    "insured_value":"5000",
    "insured_value_currency":"MXN"
}

Request fields:

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.

Shipments

Shipment booking

POST https://enviaya.com.mx/api/v1/shipments

Example Request
{
  "enviaya_account": "Y0DCRGIU",
  "carrier_account": null,
  "api_key":"YOUR_API_KEY",
  "carrier": "dhl",
  "carrier_service_code": "N",
  "origin_direction": {
     "full_name": "Sven Crone",
     "country_code":"MX",
     "postal_code":"11550",
     "direction_1": "Direction 1",
     "city": "Ciudad Mexiko",
     "phone": "23232323",
     "state_code": "DF",
     "neighborhood": "Neighborhood"
  },
  "destination_direction": {
    "company": "Leopoldo Murillo",
    "country_code":"MX",
    "postal_code":"01210",
    "direction_1": "Direction 1",
    "city": "Ciudad Mexiko",
    "phone": "23232323",
    "state_code": "DF",
    "neighborhood": "Neighborhood"
  },
  "shipment": {
    "shipment_type": "Package",
    "insured_value": 200,
    "insured_value_currency": "mxn",
    "content": "description",
    "parcels":[
       {
        "quantity": 2,
        "weight": 1.5,
        "length": 10,
        "height": 10,
        "width": 10,
        "weight_unit": "kg"
       },
       {
        "quantity": 10,
        "weight": 1.5,
        "length": 20,
        "height": 10,
        "width": 10,
        "weight_unit": "kg"
       }
    ]
  },
  "label_format": "Letter"
}
Parameter Type Description
api_key required String YOUR_API_KEY
quick_label optional Boolean If the quick label option is enabled, we will create your label without rating it. This way, performance is improved, but the amount fields in the response will be returned in nil.If you provide a rate ID, this option only has an effect in case the shipment weight, parcels or dimensions provided in the rate ID are different to the one of the shipment request you submitted.We recommend to enable this option, as the shipment amount can be transmitted to your server via Webhook a few seconds later. You can use the webhook to update the shipment record set amount fields in your database.
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.
label_format optional "Letter", "ZPL", "EPL" Letter, ZPL, EPL. If no value is provided, Letter is used as default.

Shipments Look Up

GET https://enviaya.com.mx/api/v1/shipments/:enviaya_id?api_key=YOUR_API_KEY

  Example Request

https://enviaya.com.mx/api/v1/shipments/TAE3T6KS?api_key=ec77aecc9bdc95ffe8f6c5be1e6eab7c

  Example response
  {
  "shipment_date": "2016-07-20T19:00:00-05:00",
  "shipment_type": "Package",
  "parcels": [
  {
  "length": 10,
  "width": 10,
  "height": 10,
  "quantity": 2,
  "weight": 1.5,
  "piece_reference": null,
  "weight_unit": "kg",
  "dimension_unit": "cm",
  "all_references": null,
  "shipment": null,
  "pickup": null
  },
  {
  "length": 20,
  "width": 10,
  "height": 10,
  "quantity": 10,
  "weight": 1.5,
  "piece_reference": null,
  "weight_unit": "kg",
  "dimension_unit": "cm",
  "all_references": null,
  "shipment": null,
  "pickup": null
  }
  ],
  "insured_value": 200,
  "insured_value_currency": "MXN",
  "content": "description",
  "carrier": "DHL",
  "carrier_service_code": "EXPRESS DOMESTIC",
  "enviaya_service_code": null,
  "enviaya_shipment_number": "2ZB3YUQQ",
  "carrier_shipment_number": "3879785232",
  "label": "YOUR_LABEL",
  "label_format": "Letter",
  "label_file_type": null,
  "label_url": "https://enviaya.com.mx/shipping/shipments/5e30e9a1-4d54-40b7-a049-d071851aee2c/after_pay",
  "rate": null
  }
Parameter Type Description
api_key required String YOUR_API_KEY
enviaya_id required String Identification number of the shipment used by EnviaYa.

Shipment statuses

Example Request

GET https://enviaya.com.mx/api/v1/get_shipment_statuses?api_key=ec77aecc9bdc95ffe8f6c5be1e6eab7c

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"
    }
  ]
}

Tracking

Shipment tracking

POST https://enviaya.com.mx/api/v1/trackings

Example Request
{
   "carrier_account": null,
   "api_key":"YOUR_API_KEY",
   "carrier":"ups",
   "shipment_number": "1ZA9T9206896262635"
}

Request fields:

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.

Pickups

Pickup booking

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":"2017-10-17",
  "schedule_from": "08:00",
  "schedule_to": "20:00",
  "direction": {
      "full_name": "Sven Crone",
      "company": "Envia Ya SA de CV",
      "direction_1": "Kepler 195",
      "direction_2": "Int. 2b, Esquina Ejercito Nacional",
      "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": "2017-10-17",
  "enviaya_pickup_id": "3e296d45-2f89-4b6f-9687-ea6af8398f4c",
  "pickup_status": "Scheduled"
}
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 optional 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.
enviaya_id optional String The unique envia shipmnet id. This parameter is returned by the label service.
accounts optional Accounts See Accounts object.

Pickups Look Up

GET https://enviaya.com.mx/api/v1/pickups/:id?api_key=YOUR_API_KEY

  Example Request

https://enviaya.com.mx/api/v1/pickups/3e296d45-2f89-4b6f-9687-ea6af8398f4c?api_key=ec77aecc9bdc95ffe8f6c5be1e6eab7c

  Example response
  {
    "pickup_date": "2017-10-17",
    "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": "Envia Ya SA de CV",
    "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": "tiyalcin@gmail.com"
    },
    "parcels": [ ],
    "id": null,
    "confirmation_number": null,
    "status": null,
    "shipment_ids": [ ]
  }
Parameter Type Description
api_key required String YOUR_API_KEY
id required String The internal pickup ID identification number of the pickup used by EnviaYa.

Pickup statuses

Example Request

GET https://enviaya.com.mx/api/v1/get_pickup_statuses?api_key=ec77aecc9bdc95ffe8f6c5be1e6eab7c

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"
    }
  ]
}

Catalogues

Carriers

Example Request

GET https://enviaya.com.mx/api/v1/get_carriers?api_key=ec77aecc9bdc95ffe8f6c5be1e6eab7c

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=ec77aecc9bdc95ffe8f6c5be1e6eab7c

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"
        }
      ]
    }
  ]
}

Checkpoints

Shipment statuses

Example Request

GET https://enviaya.com.mx/api/v1/get_shipment_statuses?api_key=ec77aecc9bdc95ffe8f6c5be1e6eab7c

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"
    }
  ]
}

Pickup statuses

Example Request

GET https://enviaya.com.mx/api/v1/get_pickup_statuses?api_key=ec77aecc9bdc95ffe8f6c5be1e6eab7c

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"
    }
  ]
}

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"
    }    
  ]
}