The Airpost 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 and property names are pascal-cased, ascii strings.
In the right sidebar, you can find examples that work as they are. You only need to fill the ApiKey variable with your personal API key. You can find it under your user configuration on https://app.airpost.mx/MyAccount/MyAccounts
Sandbox Endpoint:
https://sandbox.airpost.com.mx/Api/
Production Endpoint:
https://app.airpost.mx/Api/
In order to authenticate you need to use your User Name used to access to your account and your API key. You can find it under your profile. Authentication to our API is performed using HTTP Basic Auth. Please be sure to keep your API key secret so nobody else will create shipments with your account and without your authorization.
# Example Object
{
"Notification": {
"Code": "0",
"Message": "La solicitud ha sido procesada exitosamente.",
"Severity": 3
}
}
# Example Object
{
"Contact": {
"ContactName": "Luis Pérez",
"Company": "Airpost Group",
"StreetLine1": "Av. Patria #3117 O",
"StreetLine2": "Col. Loma Bonita",
"ZipCode": "45086",
"City": "Zapopan",
"County": "Zapopan",
"State": "Jalisco",
"Country": "México",
"StateCode": "JA",
"CountryCode": "MX",
"Phone1": "3338257149",
"Ext1": "",
"Phone2": "",
"Ext2": "",
"MobilePhone": "",
"Email": "contacto@airpost.mx",
"Notes": ""
}
}
# Example Object
{
"Carrier": {
"CarrierId": 9,
"CarrierName": "AIRPOST",
"IsSuggestedProvider": true
}
}
# Example Object
{
"Service": {
"ServiceId": 10,
"Carrier": {
"CarrierId": 4,
"CarrierName": "ESTAFETA",
"IsSuggestedProvider": false
},
"ServiceName": "NACIONAL ECONÓMICO",
"Unit": null,
"PublicPrice": 0,
"TaxRate": 0,
"Currency": null,
"EstimatedDeliveryDate": null,
"IsExtendedArea": false
}
}
# Example Object
{
"Label": {
"ShippingLabelBase64": ""
}
}
# Example Object
{
"Event":
{
"Code": null,
"Description": "En proceso de entrega Irapuato",
"Date": "2017-11-08T17:48:00Z",
"Location": {
"StreetLine1": null,
"StreetLine2": null,
"ZipCode": null,
"City": "IRAPUATO",
"County": null,
"State": "",
"Country": null,
"StateCode": null,
"CountryCode": "MX"
},
"Comments": null
}
}
# Example Object
{
"Package": [
"PackageId": 999999999,
"Service": {
"ServiceId": 10,
"Carrier": {
"CarrierId": 4,
"CarrierName": "ESTAFETA",
"IsSuggestedProvider": false
},
"ServiceName": "NACIONAL ECONÓMICO",
"Unit": null,
"PublicPrice": 0,
"TaxRate": 0,
"Currency": null,
"EstimatedDeliveryDate": null,
"IsExtendedArea": false
},
"Label": {
"LabelId": 0,
"FileName": null,
"ContentType": null,
"FileBytes": null,
"IsMainMergedFile": false
},
"TrackingNumber": "9958698217781780277621",
"Weight": 25.6,
"Length": 20,
"Height": 20,
"Width": 20,
"Content": "LIBROS",
"PublicPrice": 210,
"TaxRate": 0,
"DeclaredValue": 0,
"Currency": "MXN",
"Reference": null,
"CostCenter": null,
"IsExtendedArea": false,
"IsPickedUp": true,
"IsDelivered": true,
"EstimatedDeliveryDate": "2017-11-13T22:23:22Z",
"DeliveryDate": "2017-11-08T18:58:00Z",
"ReceivedBy": "JAVIER M.",
"ShipmentStatus": "Entregado",
"ShipmentStatusCode": "DL",
"ShipmentSubstatus": "Recibido por: JAVIER M.",
"Events": []
}
}
# Example Object
{
"Shipment":
{
"ShipmentId": 999999,
"Sender": {
"ContactName": "Luis Pérez",
"Company": "Airpost Group",
"StreetLine1": "Av. Patria #3117 O",
"StreetLine2": "Col. Loma Bonita",
"ZipCode": "45086",
"City": "Zapopan",
"County": "Zapopan",
"State": "Jalisco",
"Country": "México",
"StateCode": "JA",
"CountryCode": "MX",
"Phone1": "3338257149",
"Ext1": "",
"Phone2": "",
"Ext2": "",
"MobilePhone": "",
"Email": "contacto@airpost.mx",
"Notes": ""
},
"Recipient": {
"ContactName": "Luis Pérez",
"Company": "Airpost Group",
"StreetLine1": "Av. Patria #3117 O",
"StreetLine2": "Col. Loma Bonita",
"ZipCode": "45086",
"City": "Zapopan",
"County": "Zapopan",
"State": "Jalisco",
"Country": "México",
"StateCode": "JA",
"CountryCode": "MX",
"Phone1": "3338257149",
"Ext1": "",
"Phone2": "",
"Ext2": "",
"MobilePhone": "",
"Email": "contacto@airpost.mx",
"Notes": ""
},
"ShipmentDate": "2017-11-06T22:23:22Z",
"ValueAddedServices": [],
"Packages": [
{
"PackageId": 999999999,
"Service": {
"ServiceId": 10,
"Carrier": {
"CarrierId": 4,
"CarrierName": "ESTAFETA",
"IsSuggestedProvider": false
},
"ServiceName": "NACIONAL ECONÓMICO",
"Unit": null,
"PublicPrice": 0,
"TaxRate": 0,
"Currency": null,
"EstimatedDeliveryDate": null,
"IsExtendedArea": false
},
"Label": {
"LabelId": 0,
"FileName": null,
"ContentType": null,
"FileBytes": null,
"IsMainMergedFile": false
},
"TrackingNumber": "9958698217781780277621",
"Weight": 25.6,
"Length": 20,
"Height": 20,
"Width": 20,
"Content": "LIBROS",
"PublicPrice": 210,
"TaxRate": 0,
"DeclaredValue": 0,
"Currency": "MXN",
"Reference": null,
"CostCenter": null,
"IsExtendedArea": false,
"IsPickedUp": true,
"IsDelivered": true,
"EstimatedDeliveryDate": "2017-11-13T22:23:22Z",
"DeliveryDate": "2017-11-08T18:58:00Z",
"ReceivedBy": "JAVIER M.",
"ShipmentStatus": "Entregado",
"ShipmentStatusCode": "DL",
"ShipmentSubstatus": "Recibido por: JAVIER M.",
"Events": [
{
"Code": null,
"Description": "En proceso de entrega Irapuato",
"Date": "2017-11-08T17:48:00Z",
"Location": {
"StreetLine1": null,
"StreetLine2": null,
"ZipCode": null,
"City": "IRAPUATO",
"County": null,
"State": "",
"Country": null,
"StateCode": null,
"CountryCode": "MX"
},
"Comments": null
},
{
"Code": null,
"Description": "Llegada a centro de distribución Irapuato",
"Date": "2017-11-08T15:43:00Z",
"Location": {
"StreetLine1": null,
"StreetLine2": null,
"ZipCode": null,
"City": "IRAPUATO",
"County": null,
"State": "",
"Country": null,
"StateCode": null,
"CountryCode": "MX"
},
"Comments": null
},
{
"Code": null,
"Description": "Llegada a centro de distribución Guadalajara",
"Date": "2017-11-07T01:11:00Z",
"Location": {
"StreetLine1": null,
"StreetLine2": null,
"ZipCode": null,
"City": "GUADALAJARA",
"County": null,
"State": "",
"Country": null,
"StateCode": null,
"CountryCode": "MX"
},
"Comments": null
}
]
}
],
"CustomsClearanceDetail": null
}
}
Track a shipment.
# Example Request https://app.airpost.mx/Api/Track?preferredLanguage=0&searchTerm=70279079&trackingType=2
# Example Response { "Shipments": [ { "ShipmentId": 999999, "Sender": { "ContactName": "Luis Pérez", "Company": "Airpost Group", "StreetLine1": "Av. Patria #3117 O", "StreetLine2": "Col. Loma Bonita", "ZipCode": "45086", "City": "Zapopan", "County": "Zapopan", "State": "Jalisco", "Country": "México", "StateCode": "JA", "CountryCode": "MX", "Phone1": "3338257149", "Ext1": "", "Phone2": "", "Ext2": "", "MobilePhone": "", "Email": "contacto@airpost.mx", "Notes": "" }, "Recipient": { "ContactName": "Luis Pérez", "Company": "Airpost Group", "StreetLine1": "Av. Patria #3117 O", "StreetLine2": "Col. Loma Bonita", "ZipCode": "45086", "City": "Zapopan", "County": "Zapopan", "State": "Jalisco", "Country": "México", "StateCode": "JA", "CountryCode": "MX", "Phone1": "3338257149", "Ext1": "", "Phone2": "", "Ext2": "", "MobilePhone": "", "Email": "contacto@airpost.mx", "Notes": "" }, "ShipmentDate": "2017-11-06T22:23:22Z", "ValueAddedServices": [], "Packages": [ { "PackageId": 999999999, "Service": { "ServiceId": 10, "Carrier": { "CarrierId": 4, "CarrierName": "ESTAFETA", "IsSuggestedProvider": false }, "ServiceName": "NACIONAL ECONÓMICO", "Unit": null, "PublicPrice": 0, "TaxRate": 0, "Currency": null, "EstimatedDeliveryDate": null, "IsExtendedArea": false }, "Label": { "LabelId": 0, "FileName": null, "ContentType": null, "FileBytes": null, "IsMainMergedFile": false }, "TrackingNumber": "9958698217781780277621", "Weight": 25.6, "Length": 20, "Height": 20, "Width": 20, "Content": "LIBROS", "PublicPrice": 210, "TaxRate": 0, "DeclaredValue": 0, "Currency": "MXN", "Reference": null, "CostCenter": null, "IsExtendedArea": false, "IsPickedUp": true, "IsDelivered": true, "EstimatedDeliveryDate": "2017-11-13T22:23:22Z", "DeliveryDate": "2017-11-08T18:58:00Z", "ReceivedBy": "JAVIER M.", "ShipmentStatus": "Entregado", "ShipmentStatusCode": "DL", "ShipmentSubstatus": "Recibido por: JAVIER M.", "Events": [ { "Code": null, "Description": "En proceso de entrega Irapuato", "Date": "2017-11-08T17:48:00Z", "Location": { "StreetLine1": null, "StreetLine2": null, "ZipCode": null, "City": "IRAPUATO", "County": null, "State": "", "Country": null, "StateCode": null, "CountryCode": "MX" }, "Comments": null }, { "Code": null, "Description": "Llegada a centro de distribución Irapuato", "Date": "2017-11-08T15:43:00Z", "Location": { "StreetLine1": null, "StreetLine2": null, "ZipCode": null, "City": "IRAPUATO", "County": null, "State": "", "Country": null, "StateCode": null, "CountryCode": "MX" }, "Comments": null }, { "Code": null, "Description": "Llegada a centro de distribución Guadalajara", "Date": "2017-11-07T01:11:00Z", "Location": { "StreetLine1": null, "StreetLine2": null, "ZipCode": null, "City": "GUADALAJARA", "County": null, "State": "", "Country": null, "StateCode": null, "CountryCode": "MX" }, "Comments": null } ] } ], "CustomsClearanceDetail": null } ], "Notifications": [ { "Code": "0", "Message": "La solicitud ha sido procesada exitosamente.", "Severity": 3 } ] }
Rate a shipment.
# Example Request { "PreferredLanguage": 0, "Shipment": { "Sender": { "ZipCode": "45086", "City": "Zapopan", "County": "Zapopan", "State": "Jalisco", "Country": "México", "StateCode": "JA", "CountryCode": "MX" }, "Recipient": { "ZipCode": "06600", "City": "Ciudad de México", "County": "Cuauhtémoc", "State": "Ciudad de México", "Country": "México", "StateCode": "DF", "CountryCode": "MX" }, "Packages": [ { "Weight": 25.6, "Length": 20, "Height": 20, "Width": 20 } ] } }
# Example Response { "Services": [ { "ServiceId": 10, "Carrier": { "CarrierId": 12, "CarrierName": "TUFESA", "IsSuggestedProvider": false }, "ServiceName": "NACIONAL ECONÓMICO", "Unit": "", "PublicPrice": 175.50, "TaxRate": 16, "Currency": "MXN", "EstimatedDeliveryDate": "18/11/2017 11:59:00 p. m.", "IsExtendedArea": false }, { "ServiceId": 10, "Carrier": { "CarrierId": 7, "CarrierName": "REDPACK", "IsSuggestedProvider": false }, "ServiceName": "NACIONAL ECONÓMICO", "Unit": "", "PublicPrice": 175.50, "TaxRate": 16, "Currency": "MXN", "EstimatedDeliveryDate": "19/11/2017 11:59:00 p.m.", "IsExtendedArea": false }, { "ServiceId": 10, "Carrier": { "CarrierId": 1, "CarrierName": "AEROFLASH", "IsSuggestedProvider": true }, "ServiceName": "NACIONAL ECONÓMICO", "Unit": "", "PublicPrice": 175.50, "TaxRate": 16, "Currency": "MXN", "EstimatedDeliveryDate": "15/11/2017 11:59:00 p. m.", "IsExtendedArea": false }, { "ServiceId": 10, "Carrier": { "CarrierId": 8, "CarrierName": "SENDEX", "IsSuggestedProvider": true }, "ServiceName": "NACIONAL ECONÓMICO", "Unit": "", "PublicPrice": 175.50, "TaxRate": 16, "Currency": "MXN", "EstimatedDeliveryDate": "18/11/2017 11:59:00 p. m.", "IsExtendedArea": false }, { "ServiceId": 10, "Carrier": { "CarrierId": 4, "CarrierName": "ESTAFETA", "IsSuggestedProvider": false }, "ServiceName": "NACIONAL ECONÓMICO", "Unit": "", "PublicPrice": 175.50, "TaxRate": 16, "Currency": "MXN", "EstimatedDeliveryDate": "19/11/2017 11:59:00 p.m.", "IsExtendedArea": false }, { "ServiceId": 10, "Carrier": { "CarrierId": 5, "CarrierName": "FEDEX", "IsSuggestedProvider": true }, "ServiceName": "NACIONAL ECONÓMICO", "Unit": "", "PublicPrice": 175.50, "TaxRate": 16, "Currency": "MXN", "EstimatedDeliveryDate": "18/11/2017 09:00:00 p. m. ", "IsExtendedArea": false }, { "ServiceId": 13, "Carrier": { "CarrierId": 5, "CarrierName": "FEDEX", "IsSuggestedProvider": true }, "ServiceName": "NACIONAL EXPRÉS", "Unit": "", "PublicPrice": 175.50, "TaxRate": 16, "Currency": "MXN", "EstimatedDeliveryDate": "14/11/2017 09:00:00 p. m. ", "IsExtendedArea": false }, { "ServiceId": 18, "Carrier": { "CarrierId": 5, "CarrierName": "FEDEX", "IsSuggestedProvider": true }, "ServiceName": "NACIONAL EXPRÉS PRIORITARIO", "Unit": "", "PublicPrice": 175.50, "TaxRate": 16, "Currency": "MXN", "EstimatedDeliveryDate": "14/11/2017 10:30:00 a. m. ", "IsExtendedArea": false }, { "ServiceId": 34, "Carrier": { "CarrierId": 10, "CarrierName": "UPS", "IsSuggestedProvider": true }, "ServiceName": "NACIONAL EXPRÉS", "Unit": "", "PublicPrice": 175.50, "TaxRate": 4, "Currency": "MXN", "EstimatedDeliveryDate": "14/11/2017 11:30:00 p. m.", "IsExtendedArea": false }, { "ServiceId": 22, "Carrier": { "CarrierId": 10, "CarrierName": "UPS", "IsSuggestedProvider": true }, "ServiceName": "NACIONAL EXPRÉS PRIORITARIO", "Unit": "", "PublicPrice": 175.50, "TaxRate": 4, "Currency": "MXN", "EstimatedDeliveryDate": "14/11/2017 10:30:00 a. m.", "IsExtendedArea": false }, { "ServiceId": 23, "Carrier": { "CarrierId": 10, "CarrierName": "UPS", "IsSuggestedProvider": true }, "ServiceName": "NACIONAL EXPRÉS PLUS", "Unit": "", "PublicPrice": 175.50, "TaxRate": 4, "Currency": "MXN", "EstimatedDeliveryDate": "14/11/2017 08:30:00 a. m.", "IsExtendedArea": false }, { "ServiceId": 13, "Carrier": { "CarrierId": 7, "CarrierName": "REDPACK", "IsSuggestedProvider": false }, "ServiceName": "NACIONAL EXPRÉS", "Unit": "", "PublicPrice": 175.50, "TaxRate": 16, "Currency": "MXN", "EstimatedDeliveryDate": "14/11/2017 11:59:00 p.m.", "IsExtendedArea": false }, { "ServiceId": 19, "Carrier": { "CarrierId": 5, "CarrierName": "FEDEX", "IsSuggestedProvider": true }, "ServiceName": "NACIONAL EXPRÉS PLUS", "Unit": "", "PublicPrice": 175.50, "TaxRate": 16, "Currency": "MXN", "EstimatedDeliveryDate": "14/11/2017 08:30:00 a. m. ", "IsExtendedArea": false } ], "Notifications": [ { "Code": "0", "Message": "La solicitud ha sido procesada exitosamente.", "Severity": 3 } ] }
Create a shipment.
# Example Request { "PreferredLanguage": 0, "Shipment": { "Sender": { "ContactName": "Juan Pérez", "Company": "Airpost Group", "StreetLine1": "Av. Patria #3117 O", "StreetLine2": "Col. Loma Bonita", "ZipCode": "45086", "City": "Zapopan", "County": "Zapopan", "State": "Jalisco", "Country": "Mexico", "StateCode": "JA", "CountryCode": "MX", "Phone1": "3338257149", "Email": "contacto@airpost.mx" }, "Recipient": { "ContactName": "Juan Pérez", "Company": "Museo Tamayo", "StreetLine1": "Paseo de la Reforma #51", "StreetLine2": "Col. Bosque de Chapultepec", "ZipCode": "11580", "City": "Miguel Hidalgo", "County": "Miguel Hidalgo", "State": "Ciudad de México", "Country": "Mexico", "StateCode": "DF", "CountryCode": "MX", "Phone1": "5541228200", "Email": "contacto@museo.org" }, "Packages": [ { "Weight": 3, "Length": 41, "Height": 31, "Width": 20, "Content": "LIBROS", "Service": { "ServiceId": 13, "Carrier": { "CarrierId": 10, "CarrierName": "UPS" } } } ] } }
# Example Response { { "Shipment": { "ShipmentId": 999669, "Sender": { "Id": 71632, "ContactName": "JUAN PÉREZ", "Company": "AIRPOST GROUP", "GovernmentId": "", "TaxpayerId": "", "Phone1": "3338257149", "Ext1": "", "Phone2": "", "Ext2": "", "MobilePhone": "", "Email": "CONTACTO@AIRPOST.MX", "StreetLine1": "AV. PATRIA #3117 O", "StreetLine2": "COL. LOMA BONITA", "ZipCode": "45086", "City": "ZAPOPAN", "County": "ZAPOPAN", "State": "JALISCO", "Country": "MÉXICO (MX)", "StateCode": "", "CountryCode": "" }, "Recipient": { "Id": 55534, "ContactName": "JUAN PÉREZ", "Company": "MUSEO TAMAYO", "GovernmentId": "", "TaxpayerId": "", "Phone1": "5541228200", "Ext1": "", "Phone2": "", "Ext2": "", "MobilePhone": "", "Email": "CONTACTO@MUSEO.ORG", "StreetLine1": "PASEO DE LA REFORMA #51", "StreetLine2": "COL. BOSQUE DE CHAPULTEPEC", "ZipCode": "11580", "City": "MIGUEL HIDALGO", "County": "MIGUEL HIDALGO", "State": "CIUDAD DE MÉXICO", "Country": "MÉXICO (MX)", "StateCode": "", "CountryCode": "" }, "ShipmentDate": "2018-01-11T18:11:11", "ValueAddedServices": [], "Packages": [ { "PackageId": 100251572, "Service": { "ServiceId": 13, "Carrier": { "CarrierId": 10, "CarrierName": "UPS", "IsSuggestedProvider": false }, "ServiceName": "NACIONAL EXPRÉS", "Unit": "", "PublicPrice": 0, "TaxRate": 0, "Currency": "", "EstimatedDeliveryDate": null, "IsExtendedArea": false }, "TrackingNumber": "1Z10A10X0493890107", "Weight": 3, "Length": 41, "Height": 31, "Width": 20, "TaxRate": 16, "PublicPrice": { "Amount": 1, "Currency": "MXN" }, "DeclaredValue": { "Amount": 0, "Currency": "MXN" }, "Content": "LIBROS", "Reference": "", "IsExtendedArea": false, "IsPickedUp": false, "IsDelivered": false, "EstimatedDeliveryDate": "0001-01-01T00:00:00", "DeliveryDate": "0001-01-01T00:00:00", "ReceivedBy": "", "ShipmentStatus": "", "ShipmentStatusCode": "", "ShipmentSubstatus": "", "Events": [] } ] }, "Label": { "ShippingLabelBase64": "" }, "Notifications": [ { "Code": "0", "Message": "La solicitud ha sido procesada exitosamente.", "Severity": 3 } ] } }