Introduction
Welcome to the Emissary API! Our API provides a set of endpoints designed to help you seamlessly integrate Emissary's shipping capabilities into your applications. With our API, you can create orders, manage shipments, query catalogs, track shipments, and much more, all through a secure authentication system with your user account.
Key Features
- User Authentication: Securely access the API using your Emissary account credentials.
- Order Management: Create and manage shipping orders directly from your application.
- Shipment Handling: Manage the details of your shipments, including pickups, deliveries, and status updates.
- Catalog Queries: Access detailed information about available services, shipping options, and more.
- Tracking: Track the status of your shipments to ensure timely deliveries. Inventory: Check the inventory of your warehouses.
Authentication
POST /api/Auth/Token
curl -X 'POST' \
'https://emissaryapi.azurewebsites.net/api/Auth/Token' \
-H 'accept: application/json' \
-H 'Authorization: Bearer sdsdds' \
-H 'Content-Type: application/json' \
-d '{
"email": "string",
"password": "string"
}'
The Authentication endpoint returns a response in JSON format:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....",
"tokenType": "Bearer Token",
"expiresIn": "60 minutes"
}
The Emissary API uses JWT token-based authentication. To authenticate, you will need your username and password from the Emissary.mx. Below is an example of how to include the API key in your requests:
Emissary expects the JWT token to be included in all API requests to the server in a header like the following:
GET /orders HTTP/1.1
Host: emissaryapi.azurewebsites.net
Authorization: Bearer TU_TOKEN_JWT
Body Request
| Parameter | Description |
|---|---|
| Email / Username used to log in to the Emissary portal. | |
| Password | Contraseña creado al registrarse en Emissary. |
Body Response
| Parameter | Description |
|---|---|
| Token | Token JWT created by the Emissary API for authenticating all endpoints. |
| TokenType | Type of Token (Bearer). |
| ExpiresIn | Token expiration time, after which a new token must be requested. |
Consignment Note
Get División
GET /api/ConsignmentNote/Division
curl -X 'GET' \
'https://emissaryapi.azurewebsites.net/api/ConsignmentNote/Division' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
The GET endpoint for division returns a response in JSON format:
[
{
"id": 0,
"name": "string",
"type": "string"
}
]
This endpoint returns all the consulted visions in a group.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/ConsignmentNote/Division
Get Grupo By id
GET /api/ConsignmentNote/Division/1/Group
curl -X 'GET' \
'https://emissaryapi.azurewebsites.net/api/ConsignmentNote/Division/1/Group' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
The GET endpoint for division returns a response in JSON format:
[
{
"id": 0,
"name": "string",
"type": "string"
}
]
This endpoint returns all groups by a specific ID.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/ConsignmentNote/Division/<ID>/Group
URL Parameters
| Parameter | Description |
|---|---|
| ID | Id to query |
Get Class By id
GET /api/ConsignmentNote/Division/Group/1/Class
curl -X 'GET' \
'https://emissaryapi.azurewebsites.net/api/ConsignmentNote/Division/Group/1/Class' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
The GET endpoint for division returns a response in JSON format:
[
{
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"groupId": 0,
"divisionId": 0
}
This endpoint returns all the necessary classes to generate the shipment.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/ConsignmentNote/Division/Group/<ID>/Class
URL Parameters
| Parameter | Description |
|---|---|
| ID | Id to query |
Inventory
Get Inventory
GET /api/inventory
curl -X 'GET' \
'https://emissaryapi.azurewebsites.net/api/inventory' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
The GET endpoint for Inventory returns a response in JSON format:
[
{
"id": 0,
"name": "string",
"sku": "string",
"barCode": "string",
"isKit": true,
"quantity": 0,
"productionQuantity": 0,
"totalQuantity": 0,
"ordersQuantity": 0,
"availableQuantity": 0,
"warehouseId": 0,
"warehouseName": "string"
}
]
This endpoint returns the inventory created in the user's warehouse.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/inventory
Orders
Get Orders
GET /api/order
curl -X 'GET' \
'https://emissaryapi.azurewebsites.net/api/order' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
The GET endpoint for Orders returns a response in JSON format:
{
"id": 0,
"userId": 0,
"userEmail": "string",
"numOrder": "string",
"createdAt": "2024-07-19T14:34:50.259Z",
"syncedDate": "2024-07-19T14:34:50.259Z",
"statusId": 0,
"status": "string",
"totalPrice": 0,
"ecommerceShippingMethod": "string",
"ecommercePaymentMethod": "string",
"ecommerceName": "string",
"ecommerceStoreName": "string",
"orderEcommerceId": "string",
"active": true,
"addressReceiver": {
"name": "string",
"email": "string",
"phone": "string",
"zipCode": "string",
"country": "string",
"state": "string",
"city": "string",
"suburb": "string",
"streetAndNumber": "string",
"reference": "string"
},
"addressSender": {
"name": "string",
"email": "string",
"phone": "string",
"zipCode": "string",
"country": "string",
"state": "string",
"city": "string",
"suburb": "string",
"streetAndNumber": "string",
"reference": "string"
},
"products": [
{
"name": "string",
"sku": "string",
"barCode": "string",
"quantity": 0,
"weight": 0,
"productFulfillmentId": 0
}
],
"shippings": [
{
"id": 0,
"statusId": 0,
"status": "string",
"price": 0,
"tracking": "string",
"shippingDate": "2024-07-19T14:34:50.259Z",
"userId": 0,
"name": "string",
"email": "string",
"cancelStatus": true,
"shippingMethod": "string",
"shippingMethodId": 0,
"fileName": "string",
"typeService": "string",
"estimatedDeliveryDate": "string",
"createUserRol": "string",
"transitTime": 0,
"carrier": {
"id": 0,
"name": "string",
"trackingUrl": "string"
},
"senderAddress": {
"id": 0,
"alias": "string",
"streetAndNumber": "string",
"suburb": "string",
"zipCode": "string",
"city": "string",
"state": "string",
"country": "string",
"name": "string",
"email": "string",
"phone": "string",
"reference": "string"
},
"receiverAddress": {
"id": 0,
"alias": "string",
"streetAndNumber": "string",
"suburb": "string",
"zipCode": "string",
"city": "string",
"state": "string",
"country": "string",
"name": "string",
"email": "string",
"phone": "string",
"reference": "string"
},
"packages": [
{
"id": 0,
"trackingNumber": "string",
"width": 0,
"height": 0,
"length": 0,
"weight": 0,
"content": "string",
"insuredValue": 0,
"quantity": 0,
"consignmentNoteClass": {
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"groupId": 0,
"divisionId": 0
}
}
],
"commodities": [
{
"description": "string",
"quantity": 0,
"unitPrice": 0
}
]
}
]
}
This endpoint returns all the user's orders.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/order
Get Order By Id
GET /api/order/1
curl -X 'GET' \
'https://emissaryapi.azurewebsites.net/api/order/1' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
The GET endpoint for Orders by ID returns a response in JSON format:
{
"id": 0,
"userId": 0,
"userEmail": "string",
"numOrder": "string",
"createdAt": "2024-07-19T14:45:06.181Z",
"syncedDate": "2024-07-19T14:45:06.181Z",
"statusId": 0,
"status": "string",
"totalPrice": 0,
"ecommerceShippingMethod": "string",
"ecommercePaymentMethod": "string",
"ecommerceName": "string",
"ecommerceStoreName": "string",
"orderEcommerceId": "string",
"active": true,
"addressReceiver": {
"name": "string",
"email": "string",
"phone": "string",
"zipCode": "string",
"country": "string",
"state": "string",
"city": "string",
"suburb": "string",
"streetAndNumber": "string",
"reference": "string"
},
"addressSender": {
"name": "string",
"email": "string",
"phone": "string",
"zipCode": "string",
"country": "string",
"state": "string",
"city": "string",
"suburb": "string",
"streetAndNumber": "string",
"reference": "string"
},
"products": [
{
"name": "string",
"sku": "string",
"barCode": "string",
"quantity": 0,
"weight": 0,
"productFulfillmentId": 0
}
],
"shippings": [
{
"id": 0,
"statusId": 0,
"status": "string",
"price": 0,
"tracking": "string",
"shippingDate": "2024-07-19T14:45:06.181Z",
"userId": 0,
"name": "string",
"email": "string",
"cancelStatus": true,
"shippingMethod": "string",
"shippingMethodId": 0,
"fileName": "string",
"typeService": "string",
"estimatedDeliveryDate": "string",
"createUserRol": "string",
"transitTime": 0,
"carrier": {
"id": 0,
"name": "string",
"trackingUrl": "string"
},
"senderAddress": {
"id": 0,
"alias": "string",
"streetAndNumber": "string",
"suburb": "string",
"zipCode": "string",
"city": "string",
"state": "string",
"country": "string",
"name": "string",
"email": "string",
"phone": "string",
"reference": "string"
},
"receiverAddress": {
"id": 0,
"alias": "string",
"streetAndNumber": "string",
"suburb": "string",
"zipCode": "string",
"city": "string",
"state": "string",
"country": "string",
"name": "string",
"email": "string",
"phone": "string",
"reference": "string"
},
"packages": [
{
"id": 0,
"trackingNumber": "string",
"width": 0,
"height": 0,
"length": 0,
"weight": 0,
"content": "string",
"insuredValue": 0,
"quantity": 0,
"consignmentNoteClass": {
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"groupId": 0,
"divisionId": 0
}
}
],
"commodities": [
{
"description": "string",
"quantity": 0,
"unitPrice": 0
}
]
}
]
}
This endpoint returns the specific order by ID.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/order/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | ID of the order to query |
Post Create Order
POST /api/Order
curl -X 'POST' \
'https://emissaryapi.azurewebsites.net/api/Order' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
Object to send for creating an Order
{
"numberOrder": "string",
"createdAt": "2024-07-22T14:30:49.867Z",
"shippingMethod": "string",
"paymentMethod": "string",
"totalPrice": 0,
"isFF": true,
"products": [
{
"name": "string",
"sku": "string",
"quantity": 1
}
],
"senderAddress": {
"name": "string",
"email": "string",
"phone": "string",
"zipCode": "string",
"country": "string",
"state": "string",
"city": "string",
"suburb": "string",
"streetAndNumber": "string",
"reference": "string"
},
"receiverAddress": {
"name": "string",
"email": "string",
"phone": "string",
"zipCode": "string",
"country": "string",
"state": "string",
"city": "string",
"suburb": "string",
"streetAndNumber": "string",
"reference": "string"
}
}
The POST endpoint for Orders returns a response in JSON format:
{
"id": 0,
"userId": 0,
"userEmail": "string",
"numOrder": "string",
"createdAt": "2024-07-22T14:30:49.873Z",
"syncedDate": "2024-07-22T14:30:49.873Z",
"statusId": 0,
"status": "string",
"totalPrice": 0,
"ecommerceShippingMethod": "string",
"ecommercePaymentMethod": "string",
"ecommerceName": "string",
"ecommerceStoreName": "string",
"orderEcommerceId": "string",
"active": true,
"addressReceiver": {
"name": "string",
"email": "string",
"phone": "string",
"zipCode": "string",
"country": "string",
"state": "string",
"city": "string",
"suburb": "string",
"streetAndNumber": "string",
"reference": "string"
},
"addressSender": {
"name": "string",
"email": "string",
"phone": "string",
"zipCode": "string",
"country": "string",
"state": "string",
"city": "string",
"suburb": "string",
"streetAndNumber": "string",
"reference": "string"
},
"products": [
{
"name": "string",
"sku": "string",
"barCode": "string",
"quantity": 0,
"weight": 0,
"productFulfillmentId": 0
}
],
"shippings": [
{
"id": 0,
"statusId": 0,
"status": "string",
"price": 0,
"tracking": "string",
"shippingDate": "2024-07-22T14:30:49.873Z",
"userId": 0,
"name": "string",
"email": "string",
"cancelStatus": true,
"shippingMethod": "string",
"shippingMethodId": 0,
"fileName": "string",
"typeService": "string",
"estimatedDeliveryDate": "string",
"createUserRol": "string",
"transitTime": 0,
"carrier": {
"id": 0,
"name": "string",
"trackingUrl": "string"
},
"senderAddress": {
"id": 0,
"alias": "string",
"streetAndNumber": "string",
"suburb": "string",
"zipCode": "string",
"city": "string",
"state": "string",
"country": "string",
"name": "string",
"email": "string",
"phone": "string",
"reference": "string"
},
"receiverAddress": {
"id": 0,
"alias": "string",
"streetAndNumber": "string",
"suburb": "string",
"zipCode": "string",
"city": "string",
"state": "string",
"country": "string",
"name": "string",
"email": "string",
"phone": "string",
"reference": "string"
},
"packages": [
{
"id": 0,
"trackingNumber": "string",
"width": 0,
"height": 0,
"length": 0,
"weight": 0,
"content": "string",
"insuredValue": 0,
"quantity": 0,
"consignmentNoteClass": {
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"groupId": 0,
"divisionId": 0
}
}
],
"commodities": [
{
"description": "string",
"quantity": 0,
"unitPrice": 0
}
]
}
]
}
This endpoint returns an Order object with the registered information.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/Order
Shipping
Cancel Shipment
DELETE /api/Shipping/1
curl -X 'DELETE' \
'https://emissaryapi.azurewebsites.net/api/Shipping/1' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
The DELETE endpoint for Orders returns a response in JSON format:
{
"id": 0,
"commentary": "string",
"date": "2024-07-31T15:12:29.716Z",
"cancelStatusId": 0,
"cancelStatus": "string",
"shipping": {
"id": 0,
"statusId": 0,
"status": "string",
"price": 0,
"tracking": "string",
"shippingDate": "2024-07-31T15:12:29.716Z",
"userId": 0,
"name": "string",
"email": "string",
"cancelStatus": true,
"shippingMethod": "string",
"shippingMethodId": 0,
"fileName": "string",
"typeService": "string",
"estimatedDeliveryDate": "string",
"createUserRol": "string",
"transitTime": 0,
"carrier": {
"id": 0,
"name": "string",
"trackingUrl": "string"
},
"senderAddress": {
"id": 0,
"alias": "string",
"streetAndNumber": "string",
"suburb": "string",
"zipCode": "string",
"city": "string",
"state": "string",
"country": "string",
"name": "string",
"email": "string",
"phone": "string",
"reference": "string"
},
"receiverAddress": {
"id": 0,
"alias": "string",
"streetAndNumber": "string",
"suburb": "string",
"zipCode": "string",
"city": "string",
"state": "string",
"country": "string",
"name": "string",
"email": "string",
"phone": "string",
"reference": "string"
},
"packages": [
{
"id": 0,
"trackingNumber": "string",
"width": 0,
"height": 0,
"length": 0,
"weight": 0,
"content": "string",
"insuredValue": 0,
"quantity": 0,
"consignmentNoteClass": {
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"groupId": 0,
"divisionId": 0
}
}
],
"commodities": [
{
"description": "string",
"quantity": 0,
"unitPrice": 0
}
]
}
}
This endpoint returns a object with current status of the cancellation and shipping info.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/Shipping/<ID>
Get Traking By Id
GET /api/Shipping/tracking/1
curl -X 'GET' \
'https://emissaryapi.azurewebsites.net/api/Shipping/tracking/1' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
The GET endpoint for traking by ID returns a response in JSON format:
{
"carrierId": 0,
"carrier": "string",
"packageStatus": "string",
"shippingMethodId": 0,
"shippingMethod": "string",
"historial": [
{
"eventDate": "string",
"eventLocation": "string",
"eventDescription": "string"
}
],
"historialExtra": [
{
"eventDate": "string",
"eventLocation": "string",
"eventDescription": "string"
}
]
}
This endpoint returns the specific traking by ID.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/Shipping/tracking/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | ID of the traking to query |
Post Generate Shipping
POST /api/Shipping
curl -X 'POST' \
'https://emissaryapi.azurewebsites.net/api/Shipping' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
Object to send for creating an Shipping
{
"userId": 0,
"orderId": 0,
"carrierID": 1,
"shippingMethodID": 1,
"createUserId": "string",
"shippingTypeId": 0,
"sender": {
"rFC": "string",
"name": "string",
"email": "string",
"phone": "string",
"zipCode": "string",
"country": "st",
"state": "string",
"city": "string",
"claveMunicipio": "string",
"suburb": "string",
"claveLocalidad": "string",
"streetAndNumber": "string",
"reference": "string"
},
"receiver": {
"rFC": "string",
"name": "string",
"email": "string",
"phone": "string",
"zipCode": "string",
"country": "st",
"state": "string",
"city": "string",
"claveMunicipio": "string",
"suburb": "string",
"claveLocalidad": "string",
"streetAndNumber": "string",
"reference": "string"
},
"packages": [
{
"id": 0,
"width": 1,
"height": 1,
"length": 1,
"weight": 1,
"alias": "string",
"sku": "string",
"content": "string",
"insuredValue": 0,
"consignmentNoteClassCode": "string",
"claveUnidad": "string",
"quantity": 0
}
],
"commodities": [
{
"description": "string",
"quantity": 1,
"unitPrice": 1
}
],
"emailReceiver": true
}
The POST endpoint for shipping returns a response in JSON format:
{
"id": 0,
"statusId": 0,
"status": "string",
"price": 0,
"tracking": "string",
"shippingDate": "2024-07-31T15:21:25.258Z",
"userId": 0,
"name": "string",
"email": "string",
"cancelStatus": true,
"shippingMethod": "string",
"shippingMethodId": 0,
"fileName": "string",
"typeService": "string",
"estimatedDeliveryDate": "string",
"createUserRol": "string",
"transitTime": 0,
"carrier": {
"id": 0,
"name": "string",
"trackingUrl": "string"
},
"senderAddress": {
"id": 0,
"alias": "string",
"streetAndNumber": "string",
"suburb": "string",
"zipCode": "string",
"city": "string",
"state": "string",
"country": "string",
"name": "string",
"email": "string",
"phone": "string",
"reference": "string"
},
"receiverAddress": {
"id": 0,
"alias": "string",
"streetAndNumber": "string",
"suburb": "string",
"zipCode": "string",
"city": "string",
"state": "string",
"country": "string",
"name": "string",
"email": "string",
"phone": "string",
"reference": "string"
},
"packages": [
{
"id": 0,
"trackingNumber": "string",
"width": 0,
"height": 0,
"length": 0,
"weight": 0,
"content": "string",
"insuredValue": 0,
"quantity": 0,
"consignmentNoteClass": {
"id": 0,
"name": "string",
"code": "string",
"type": "string",
"groupId": 0,
"divisionId": 0
}
}
],
"commodities": [
{
"description": "string",
"quantity": 0,
"unitPrice": 0
}
]
}
This endpoint returns an shipping object with the registered information.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/Shipping
Post Request quote
POST /api/Shipping/Quote
curl -X 'POST' \
'https://emissaryapi.azurewebsites.net/api/Shipping/Quote' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.....'
Object to send for obtain quotitation for shipment
{
"cashOnDelivery": true,
"cashOnDeliveryAmount": 0,
"sender": {
"zipCode": "string",
"country": "st"
},
"receiver": {
"zipCode": "string",
"country": "st"
},
"packages": [
{
"length": 1,
"width": 1,
"height": 1,
"weight": 1,
"insuredValue": 0
}
],
"carriersID": [
0
]
}
The POST endpoint for Quote returns a response in JSON format:
[
{
"carrierID": 0,
"carrier": "string",
"shippingMethodID": 0,
"shippingMethod": "string",
"price": 0,
"deliveryTime": "string",
"messages": [
"string"
],
"errorJsonCarrier": "string",
"errorMessage": "string"
}
]
This endpoint returns an quote object with the registered information.
HTTP Request
GET https://emissaryapi.azurewebsites.net/api/Shipping/Quote
Errors
The Kittn API uses the following error codes:
| Error Code | Meaning |
|---|---|
| 400 | Bad Request -- Your request is invalid. |
| 401 | Unauthorized -- Your API key is wrong. |
| 403 | Forbidden -- The kitten requested is hidden for administrators only. |
| 404 | Not Found -- The specified kitten could not be found. |
| 405 | Method Not Allowed -- You tried to access a kitten with an invalid method. |
| 406 | Not Acceptable -- You requested a format that isn't json. |
| 410 | Gone -- The kitten requested has been removed from our servers. |
| 418 | I'm a teapot. |
| 429 | Too Many Requests -- You're requesting too many kittens! Slow down! |
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |