{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"b513a570-1296-4421-bd08-c255097a6d07","name":"Public","description":"# Public API\n\nEiya Public API is a RESTful web service designed to be consumed by developers to integrate with and programatically allow to create shipping labels, schedule package pickups and query statuses.\n\nIf you have questions about using the API, want to share some feedback, or have come across a bug you'd like to report, write us an email at [ayuda@eiya.mx](https:). Welcome.\n\n# **Authorization**\n\nThe mecanism to authorize API calls from consumers is via Token verification, this token must be included in the header Authorization of every HTTP request that you perform. This kind of token is known as Bearer Token and you can generate it in the Dashboard Portal.\n\nYou can manage your Bearer Tokens with the following actions:\n\n- create/generate\n    \n- disable\n    \n- delete\n    \n\nIf you don't include the bearer token or if it's invalid you will receive an 401 according to HTTP status codes.\n\n<img src=\"https://content.pstmn.io/b7ade715-2ac2-4360-af9f-a09ce68e2357/aW1hZ2UucG5n\" width=\"584\" height=\"312\">\n\n**Note:**\n\nYou can have more than one active Token , if you will have multiple integrations (AKA as applications), it's recommended to use different token for each application.\n\n## General Convetions\n\nAs this API allow to perform bulk actions over resources, it's important to distinguish if the totallity of the elements were correctly proccesed or not, for this kind of endpoints, you can receive a 200 that indicates that elements were proccesed or fulfilled partially, while 201 means that all elements were proccesed and no error happened.\n\n_**For bulk endpoints**_\n\n| **Code** | **Description** |\n| --- | --- |\n| **201** | Means each element was proccesed. |\n| 200 | Means that elements were proccesed partially (at least one fail) |\n\n## Services\n\nEiya offers many types of services according to the coverage of your shipment, when creating a shipping you can specify the type of service that fits with your needs.\n\nIt's important to know that some services must be activated on your account.\n\n| **Service Name** | **Description.** |\n| --- | --- |\n| Standard | Is the service type by default when no service_name is set. |\n| Same day | This service is commited to be fulfilled in one day. Some conditions apply, please contact with Eiya support if you look for this type of service. |\n\nYou can know the available services for your shipments via rates/quotation endpoints.\n\n# Entities\n\nThere are many JSON structures/entites that are used to group related info for both request and responses, some of the most important are listed below.\n\n### Location\n\nThis object is composed by two entities address and contact (see below), and can represent the origin or destination, so depending on where this objects is set(origin or destination) this information is used to know the origin and destination .\n\n- Origin\n    \n- Destination\n    \n\n| **Field** | **Description** |\n| --- | --- |\n| address | Contains an address object |\n| contact | Contains an contact object |\n\nLocation xample\n\n``` json\n    \"address\": {\n      \"city\": \"CDMX\",\n      \"state\": \"CDMX\",\n      \"street\": \"Lago Ladoga 220, Modelo Pensil, Miguel Hidalgo, 11450 Ciudad de México, CDMX\",\n      \"number\": \"220\",\n      \"neighborhood\": null,\n      \"zip\": \"11450\",\n      \"internal_number\": null\n    },\n    \"contact\": {\n      \"name\": \"Music Store\",\n      \"phone\": \"2722106322\",\n      \"email\": \"music@demo.com\"\n    }\n\n ```\n\n### Contact\n\nThis entity represents the contact info from the sender or recipient, as mentionated previously this entity is belongs to a \"Location\" object/entity.\n\n| **Field Name** | **Type** | **Description** |\n| --- | --- | --- |\n| name | String | The name of the person who will receive/provide the package. No empty string, 2 characters minimum |\n| email | String | The email address of the contact |\n| phone | String | The number component for the contact person with a 10 digit format without spaces or special characters |\n\ncontact example:\n\n``` json\n{\n      \"name\": \"Music Store\",\n      \"phone\": \"2722106322\",\n      \"email\": \"music@demo.com\"\n    }\n\n ```\n\n### Address Object\n\nThis entity contains actually the location of a 'pick up' or 'shipping', we offer two options to set addresses:\n\n- Op1. This option you can set the address info in its own fields: street , number, city, zip code. Some fields are mandatory but it's recommended to include as much information as possible.\n    \n- Op2. By this option you group address info into a single string field called address1 (also known as line 1). Optionally you can set the address2\n    \n\n| **Field** | **Type** | **Option 1** | **Option2** | **Description** |\n| --- | --- | --- | --- | --- |\n| street | string | Yes. Required | No | Name of the street |\n| number | string | Yes. Required | No | External number for the delivery |\n| internal_number | string | Yes. Optional | No | The internal number/apartment of the delivery |\n| city | string | Yes. Optional | No | Municipality |\n| state | string | Yes. Optional | No | Postal or zip code |\n| country | string | Yes. Optional | No | Name of the country |\n| zip |  | Yes. Required | Yes. Required | op1 and op2. |\n| address1 | string | No | Yes. Required | Also known as Line 1, this is complete address specified in a single plain string where each address element is separated by commas. |\n| address2 | string | No | Yes. Required | Also known as Line 2. Use this field to add secundary information such as apparment number, suites, etc. |\n\n**Example Option 1.**\n\n``` json\n{\n      \"city\": \"CDMX\",\n      \"state\": \"CDMX\",\n      \"street\": \"Lago Ladoga 220, Modelo Pensil, Miguel Hidalgo, 11450 Ciudad de México, CDMX\",\n      \"number\": \"220\",\n      \"neighborhood\": null,\n      \"zip\": \"11450\",\n      \"internal_number\": null\n }\n\n ```\n\nExample **Option 2**.\n\n``` json\n  {\n      \"address1\": \"Lago Ladoga 220, Modelo Pensil, Miguel Hidalgo, 11450 Ciudad de México, CDMX\",\n      \"address2\": \"floor 15 , appartment 15A\",\n      \"zip\": \"11450\",\n    }\n\n ```\n\n**Metadata**\n\nThis entity you to add info that you wish to attach to the shipping entity. This metadata can be: Reference ID, Store ID, Merchandise SKUs and Bar Codes, Total Sale amount, among others.\n\nThis object consist of a par of attribute values in form of a collection, the pair attributes is described the below table:\n\n| **name** | **type** | **descriicpion** |\n| --- | --- | --- |\n| key | string: length from 1 to 50 | name of the value |\n| value | string: length from 1 to 150 | actual value |\n\nExample:\n\n``` json\n\"metadata\":[\n   {\n       \"key\": \"SKU\",\n       \"value\": \"00101010110\"\n   },\n   {\n        \"key\": \"store_id\",\n        \"value\": \"st01\"\n   }\n]\n\n ```\n\nAs you can notice, metadata is a collection when each element is a pair of attrubutes key-value, the max number of metadata elements is 30.\n\n# Errors\n\nThe Eiya Public API returns errors with the traditional non 200 HTTP status code. The response includes an error json object with the following structure:\n\n| Name | Type | Description |\n| --- | --- | --- |\n| code | Integer | Four digits error code |\n| message | String | Description of the error. |\n| details | Object | Optional. Json object with detailed information of the error. |\n\n**Example**\n\n``` json\n{\n  \"errors\": [\n    {\n      \"message\": \"Las credenciales de autenticación no se proveyeron.\",\n      \"code\": 1102\n    }\n  ]\n}\n\n ```\n\nThe following list show the available error codes and messages:\n\n**Status 400 errors**\n\n- 1000: The values of one or more parameters are invalid.\n    \n- 1001: Exceeds items per request.\n    \n- 1002: The data types of one or more parameters are invalid.\n    \n- 1003: Required fields are missing.\n    \n- 1004: The request was not able to succeed.\n    \n- 1005: Required field not valid.\n    \n- 1006: Invalid credentials.\n    \n- 1008: Scheduled time is invalid.\n    \n- 1009: Task cannot be assigned.\n    \n- 1010: Task already assigned.\n    \n- 1011: Task cannot register first fail.\n    \n- 1012: Task cannot be accepted.\n    \n- 1013: Only assigned messenger can accept this task.\n    \n- 1014: Task cannot register second fail.\n    \n- 1015: Task cannot be finished.\n    \n- 1016: Task is not assigned.\n    \n- 1017: Task cannot be canceled.\n    \n- 1018: One or more tasks cannot be canceled.\n    \n- 1019: One or more tasks cannot be assigned.\n    \n- 1020: One or more tasks are already assigned.\n    \n- 1021: One or more tasks are not assigned.\n    \n- 1022: Tasks cannot register first fail.\n    \n- 1023: Tasks cannot register second fail.\n    \n- 1024: Tasks cannot be finished.\n    \n- 1025: Tasks cannot be ordered.\n    \n- 1026: Training date and time not available.\n    \n- 1027: Training date and time already assigned.\n    \n- 1028: Training cannot be updated 24 hours before.\n    \n- 1029: Training cannot be in past.\n    \n- 1030: Messenger transition is not possible.\n    \n- 1031: Reference weight exceeds limit (20kg).\n    \n- 1032: Required address components missing.\n    \n- 1077: No national active\n    \n\n**Status 401 errors**\n\n- 1100: Token is invalid or expired.\n    \n- 1101: Cannot get current user with the given credentials.\n    \n- 1102: Authentication credentials were not provided.\n    \n- 1103: You are not currently authorized to access this service.\n    \n- 1104: There were issues with your API key.\n    \n- 1105: The API key provided is invalid.\n    \n- 1106: Given password doesn’t match the current one.\n    \n\n**Status 403 errors**\n\n- 1300: You do not have permission to perform this action.\n    \n- 1301: Account is not active.\n    \n\n# Terms of service and privacy policy\n\nIn case you use this API, you are bonded by our [License Agreement](https://) and our [Privacy Policies](https://).","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"17049908","team":330005,"collectionId":"b513a570-1296-4421-bd08-c255097a6d07","publishedId":"2sA3QwapHG","public":true,"publicUrl":"https://developers.eiya.mx","privateUrl":"https://go.postman.co/documentation/17049908-b513a570-1296-4421-bd08-c255097a6d07","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":"Eiya API, Eiya Envios API , Eiya Envios Public API"},{"name":"title","value":"Eiya API"}],"appearance":{"default":"light","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.10.1","publishDate":"2024-10-03T22:47:46.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"Eiya API","description":"Eiya API, Eiya Envios API , Eiya Envios Public API"},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[{"name":"production","id":"aa8ce70b-498b-4cdf-a32e-2b0a822a6915","owner":"17049908","values":[{"key":"api_host","value":"api.eiya.mx/","enabled":true,"type":"default"},{"key":"token","value":"dsadsa","enabled":true,"type":"secret"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/13c71333836d6c6b646555d1b583c52b9cf5ad7033792d5a9168657b5cede97f","favicon":"https://res.cloudinary.com/postman/image/upload/v1558024602/team/xlisy2thc901kn0d6jga.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"production","value":"17049908-aa8ce70b-498b-4cdf-a32e-2b0a822a6915"}],"canonicalUrl":"https://developers.eiya.mx/view/metadata/2sA3QwapHG"}