- What is this?
- Resources
- How to use
- Seller API
- Carrier API
This tutorial aims at helping you integrate to the NB APIs (Seller API and Carrier API). It consists in a precise and complete to-do list that will walk you through the whole shipment process and will deliberately engage you in some mistakes and errors so that you can catch the techniques to solve them in case they appear for you in the future. The tutorial is pretty complete, so when you finish it succesfully, you can consider that you are fully integrated to Nobordist APIs. This tutorial is NOT an API DOC. If this is what you are looking for, please refer to the below section.
This tutorial is divided into 2 parts:
- Seller API, used for creating packages
- Carrier API, used for gathering packages into masterboxes and embarking flights.
Please refer to your CX contact to know to which of these API you have to integrate (to both, maybe). The Carrier API needs some test orders to work properly. You can use the Seller API tutorial to create them, if you plan to integrate to Seller API. On the contrary, you can ask your CX contact to create the necessary orders so that you can start integrating.
-
API DOC The API DOC gathers the most comprehensive information of the 2 APIS. Click here to see the online API DOC for production. Click here to see the online API DOC for homologation. In both documents, you can select Carrier Docs or Seller Docs in the top right menu. Click here to download the API DOCs as an mht documents (readable off-line by any navigator).
-
Postman collections We created 2 Postman collections to help you during the integration process. Please click here to download them.
-
Tutorial You can download a PDF version of this tutorial clicking here.
-
Ultimate zip file You can download a zip file containing
- the PDF of this SOP
- the API DOC in html format
- the 2 postman collections by clicking here.
We recommend that you follow this tutorial in the natural order, without missing any section. We also highly recommend that you take a look at the API DOC during the tutorial process, as it contains more comprehensive information about some fields and requests that may not appear in this document. Last, you can use the Postman collections as a help to perform the exercises described in this tutorial.
The Nobordist Seller API allows you to create and manage orders as well as their related labels, invoice and tracking histories. Access Here Tecnical doc) https://drive.google.com/file/d/1frIxmAyczfeWl0ynMOzloGX_3ry9m4up/view?usp=sharing
- Production:
https://api.nobordist.com
- Homologation :
https://hmlapi.nobordist.com
First of all, let's authenticate to the Nobordist API. This step will give you a Bearer Token, that will be necessary to authenticate at each of your Seller API requests.
You will need to use following request: POST/authenticate/{{platform}}/seller
(Generate the API Token)
{
"email": "MY EMAIL",
"password": "MY PASS"
}
You'll receive an error with the following message:
"user_authentication": "invalid email"
This is absolutely normal as you have to first fill your actual email and password.
To do that, please refer to your CX contact to get your email and password.
IMPORTANT: Your homolog credentials and production credentials are not necessary the same, please make sure to know if you want to login to homolog or production environment
Now, susbistute "MY EMAIL" and "MY PASS" in the previous json body and call the request again. This, time, you will get a 200 response, containing a field "auth_token". You should get a response similar to this:
{
...
"auth_token": "eyJhbefakoo99998ZGciOiJIUjoihad8778728bibiu7Y78.HIOUQNiJ9.eyJ1c2VyX2lkIjoyNCjoxNzAwOTUzNTkyfQ.U7U-GeGwnV1Lw9dauMdfaiijazdjioazexuhZ_8Putn4lZLC0",
...
}
Now, just copy the value of the auth_token
field and store it for future use.
Important: this token will expire exactly 24 hours after generation. Passing this time, you will have to generate it again.
Let's now create an order! You will need to use following request: POST/v1/orders
(Create an Order)
Let's perform a first try to create an order. Please copy and paste this json and call the request. To understand the fields, please refer to the documentation.
{
"contract_id": 1,
"order_number": "20231110",
"customer_full_name": "cliente novo",
"customer_document_type": "CPF",
"customer_document_number": 14305162750,
"customer_address": "Rua Salomão",
"customer_address_number": 68,
"customer_postal_code": "05442050",
"customer_address_quarter": "Santa Ana",
"customer_city": "Sao Paulo",
"customer_state": "AAA",
"customer_country": "AAA",
"customer_phone": 11947399648,
"customer_email": "[email protected]",
"incoterm": "DDU",
"currency": "USD",
"return_insurance": false,
"collected_taxes_currency": "USD",
"prc": false,
"seller_legal_name": "Seller LTDA",
"seller_rfb_code": "999999",
"volumes_attributes": [
{
"height": 12,
"width": 12,
"length": 17,
"weight": 12,
"freight_value": 9.99,
"order_items_attributes": [
{
"name": "PS4",
"description": "bb",
"weight": 5,
"value": 10,
"hs_code": "660110",
"sku": 1,
"quantity": 1,
"origin_country": "US"
}
]
},
{
"height": 12,
"width": 12,
"length": 17,
"weight": 12,
"freight_value": 9.99,
"order_items_attributes": [
{
"name": "PS4",
"description": "PS4 Console",
"weight": 12,
"value": 10,
"hs_code": "851830",
"sku": 1,
"quantity": 1,
"origin_country": "US"
}
]
}
]
}
You'll receive a response with the following message:
"messages": "Invalid token"
This appears because we have to pass the Authentification token in the request in order to prove our identity.
To resolve that, you just need to add a header called Authorization
and fill it with the value Bearer 12345678
, where 12345678 is the token you got from the Authentication request. If you are using Postman, you can also use the Authorization tab.
Now call the request again It seems there are some (voluntary) mistakes in the body because we get a 422 response. You'll receive the following error:
{
"data": {},
"status": "ERROR",
"messages": [
{
"customer_country": [
"Wrong country code. Please use 2 letters (example: BR, US, CN ...)"
],
"contract_id": [
"Contract expired."
],
"customer_state": [
"No state AAA for , must be one of the official letters state codes(for example ...)"
]
}
]
}
All validations errors will always come in that format. As you can see, the list of erratic fields (customer_country
, contract_id
and customer_state
) are listed and for each of them, the error is described in form of a simple sentence
Let's fix these errors.
Correct the customer_country
in your body, passing for example "BR"
(Brazil).
For thecustomer_state
, pass "SP" (Sao Paulo state).
Finally, ask your CX team which contract_id
you have to use and replace the 1
by this id.
Let's call the request again using the corrected body.
Congrats! Your order is now created and you have received a response that contains all informations about your order. The beginning of the response looks like this:
{
"data": {
"id": 96712,
...
}
This 96712
is the Order ID, you internal reference number to the order. Store it for future use.
Now, we will see how to retrieve the information of an order we created, using its order_id
.
To do that, please call a request to GET/v1/orders/{order_id}
(Get Order) , where {order_id}
is the number you got in the last step. You'll receive a response that contains the details of the specific order, including the last mile tracking number (number which is on the label), found inside the volumes
object, field last_mile_tracking_number
.
Important: Note that if you create various volumes, you will also see various last mile tracking numbers. Please remember also that this number creation could take up to a few seconds, so if you call the request very quickly, a temporary "nil"
could appear in this field until the final number is generated.
What if you want to retrieve various orders of if you forgot your order_id
? You can use the GET/v1/orders
(Get All Orders) request.
{
"contract_id": 1,
"order_number": "20231111",
"customer_full_name": "cliente novo",
"customer_document_type": "CPF",
"customer_document_number": 14305162750,
"customer_address": "Rua Salomão",
"customer_address_number": 68,
"customer_postal_code": "05442050",
"customer_address_quarter": "Vila Carmela",
"customer_city": "Sao Paulo",
"customer_state": "SP",
"customer_country": "BR",
"customer_phone": 11947222348,
"customer_email": "[email protected]",
"incoterm": "DDU",
"currency": "USD",
"return_insurance": false,
"volumes_attributes": [
{
"height": 12,
"width": 12,
"length": 17,
"weight": 12,
"freight_value": 9.99,
"order_items_attributes": [
{
"name": "PS4",
"description": "bb",
"weight": 5,
"value": 10,
"hs_code": "660110",
"sku": 1,
"quantity": 1,
"origin_country": "US"
}
]
}
]
}
AND
{
"contract_id": 1,
"order_number": "20231112",
"customer_full_name": "cliente novo",
"customer_document_type": "CPF",
"customer_document_number": 14305162750,
"customer_address": "Avendia Atlantica",
"customer_address_number": 1702,
"customer_postal_code": "22021001",
"customer_city": "Rio de Janeiro",
"customer_state": "RJ",
"customer_country": "BR",
"customer_phone": 11947399148,
"customer_email": "[email protected]",
"incoterm": "DDU",
"currency": "USD",
"return_insurance": false,
"volumes_attributes": [
{
"height": 12,
"width": 12,
"length": 17,
"weight": 12,
"freight_value": 9.99,
"order_items_attributes": [
{
"name": "PS4",
"description": "bb",
"weight": 5,
"value": 10,
"hs_code": "660110",
"sku": 1,
"quantity": 1,
"origin_country": "US"
}
]
}
]
}
Call the Order Create request for these 2 bodies, successively, remembering to susbistute the contract_id
with the right number.
Now call the GET /v1/orders
request and observe the response. There are 3 fields:
- Inside the
elements
field, you will get the info of the 3 orders you have just created.
Important: By default, this request will only show the 15 first orders found (most recent first). If you want to see more orders, please use thelimit
and offset
filters. For example, if you want to see all orders between the 31th and the 40th most recent, include this body:
{
"offset": 30,
"limit": 10
}
- Inside the
ids
field, you will see the list of allorder_id
s found, even the ones who are not displayed in the offset and limit filtering. - Inside the
count
field, you will see the total amount of orders found (in other words, the number of ids in theids
field.
Let us suppose we want to see the informations of an order whose order_id
we don't know. We can find it using, for example, the order_number
field.
Let's call the request passing this body:
{
"order_number": "20231112"
}
Here it is! You found your order!
You can also apply multiple filters at the same time. Here, let us filter by customer_state
and customer_city
.
Let's call the request passing this body:
{
"customer_city": "Sao Paulo",
"customer_state": "SP"
}
Now, you will only see 2 of the 3 created orders, as only the first 2 correspond to these criteria.
Last, let's see how to filter by date using these 2 filters:
start_registration_date
: indicates that you want to see only the orders created on this date or afterend_registration_date
: indicates that you want to see only the orders created on this date or before
Let's call the request passing this body:
{
"start_registration_date": "2023-11-01",
"end_registration_date": "2023-11-10"
}
You will get no order now, this is because you have not create any order between november 1st and november 10th, 2023. Change these dates to the current date, you will see all your orders in the response.
Let's generate our first order's commercial Invoice.
To do that, please call that request PUT/v1/orders/{order_id}/commercial-invoice
(Generate Commercial Invoice) , where {order_id}
is the number you got in the 2. Create an Order
step.
After that, you'll receive a similar response body:
{
"data": {
"download_url": "https://nb-logistics-local.s3.amazonaws.com/ex5qbagkdgeh08uqwk4vgame5b9p29362b72233d"
},
"status": "SUCCESS",
"messages": [
"Commercial invoice created"
]
}
Just copy and paste the value of the download_url
field in your navigator and you will get your invoice, ready for display and download.
The generated invoice looks like that:
Let's generate our first order's shipping label.
To do that, please call that request PUT/v1/orders/{order_id}/cn23-merged
(Generate Last Mile Label) , where {order_id}
is the number you got in the 2. Create an Order
step.
After that, you'll receive a similar response body:
{
"data": {
"download_url": "https://nb-logistics-local.s3.amazonaws.com/ex5qbagkdgeh08uqwk4vgame5b9p29362b72233d"
},
"status": "SUCCESS",
"messages": [
"Label created"
]
}
Just copy and paste the value of the download_url
field in your navigator and you will get your invoice, ready for display and download.
The label looks like that:
We will now suppose you want to update your order because you passed some informations wrong. Let's test this.
To do that make a request to PUT/v1/orders/{order_id}
(Update Order)where {order_id}
is the number you got in the2. Create an Order
step
Important: You always have to pass the whole volumes_attributes
field, even if you don't want to update it.
Copy and paste this body in the request.
{
"order_number": "WZX-9999",
"customer_name": "Jack Jim",
"volumes_attributes": [
{
"height": 12,
"width": 12,
"length": 17,
"weight": 12,
"freight_value": 9.99,
"order_items_attributes": [
{
"name": "PS4",
"description": "bb",
"weight": 5,
"value": 10,
"hs_code": "660110",
"sku": 1,
"quantity": 1,
"origin_country": "US"
}
]
}
]
}
After that, you'll receive a response containing the complete order data and a success message.
To do that, please make a request to GET/v1/orders/{order_id}
passing order_id. Go look for the order_number
and customer_full_name
fields and check that they have the updated values.
Let's now change the first item value from 10 to 33.
To do that, make a request to PUT/v1/orders/{order_id}
passing the following body:
{ "volumes_attributes": [
{
"height": 12,
"width": 12,
"weight": 12,
"freight_value": 9.99,
"order_items_attributes": [
{
"name": "PS4",
"description": "bb",
"weight": 5,
"value": 35,
"hs_code": "660110",
"sku": 1,
"quantity": 1,
"origin_country": "XX"
}
]
},
{
"height": 12,
"width": 12,
"length": 17,
"weight": 12,
"freight_value": 9.99,
"order_items_attributes": [
{
"name": "PS4",
"description": "PS4 Console",
"weight": 12,
"value": 10,
"hs_code": "851830",
"sku": 1,
"quantity": 1,
"origin_country": "US"
}
]
}
]
}
You will receive a error message like that:
{
"data": {},
"status": "ERROR",
"messages": [
{
"volumes[0].order_items[0].origin_country": ["Wrong country code. Please use 2 letters (example: BR, US, CN ...)"],
"volumes[0].length": ["can't be blank"]
}
]
}
This happened because you forgot a required field and did an error passing the origin_country
field. To resolve that, correct "XX" to "US" for example, and add the "length" field, with value 12, for example.
Now, you will receive a success if you call the request again.
Just like in the 7.2, call the GET /v1/orders/{order_id}
request and look at the update data (the item value).
Let's now try to remove your order.
To delete an order, make a request to DELETE/v1/orders/{order_id}
(Delete Order) replacing {order_id}
by your order_id. After that you'll receive the following response:
{
"data": {},
"status": "SUCCESS",
"messages": [
"Order removed"
]
}
To do that, please make a request to GET/v1/orders/{order_id}
passing order_id. You will receive a 404 response showing the order has been successfully removed.
After you have created the order, it is very important you dispatch the order. This will inform us that you do not consider the order as a draft anymore and that we can start running all the necessary integrations and processes on it. Once the order is dispatched, you can not remove it or update it anymore. If you do not dispatch an order, we will not consider it as active and will not run tracking for it.
At first, let's create a new order.To do this, make a request to POST/v1/orders
using the following body request, and changing the contract_id
:
{
"contract_id": 1,
"order_number": "20231114",
"customer_full_name": "cliente novo",
"customer_document_type": "CPF",
"customer_document_number": 14305162750,
"customer_address": "Rua Salomão",
"customer_address_number": 68,
"customer_postal_code": "05442050",
"customer_address_quarter": "Vila Carmela",
"customer_city": "Sao Paulo",
"customer_state": "SP",
"customer_country": "BR",
"customer_phone_country_code": "+55",
"customer_phone": 11887313348,
"customer_email": "[email protected]",
"incoterm": "DDU",
"currency": "USD",
"return_insurance": false,
"volumes_attributes": [
{
"height": 12,
"width": 12,
"length": 17,
"weight": 12,
"freight_value": 9.99,
"order_items_attributes": [
{
"name": "PS4",
"description": "bb",
"weight": 5,
"value": 10,
"hs_code": "660110",
"sku": 1,
"quantity": 1,
"origin_country": "US"
}
]
}
]
}
Store the order_id
for the next steps.
To do that make a request to PUTv1/orders/{order_id}/dispatch
(Dispatch Order) where {order_id}
is the number you got in the last step.
Very good! You have just dispatched your order!
Let's try to update a dispatched order.To do that make a request to PUT/v1/orders/{order_id}
passing order_id.
You'll use the following body.
{
"order_number": "WZX-9999",
"customer_name": "Jack Jim"
}
After that, you'll receive a response containing an error and the following message:
{
"data": {},
"status": "ERROR",
"messages": [
"The order can not be removed because it is already dispatched"
]
}
Conclusion: it is impossible to update a dispatched order.
Let's try to delete a dispatched order.
To do that, make a request to DELETE/v1/orders/{order_id}
passing order_id. After that you'll receive the following response:
{
"data": {},
"status": "ERROR",
"messages": [
"The order can not be removed because it is already dispatched"
]
}
Conclusion: it is impossible to delete a dispatched order.
Let's get the last tracking status for a specific order by its order_id
.
To get the last tracking status for an order, make a request to GET/v1/orders/{order_id}/status
(Get Last Order Status) passing order_id. After that you'll receive a similar response:
{
"data": {
"status": {
"id": 17,
"date_iso": "2023-11-07T14:25:38.000Z",
"attachment": null,
"message": null,
"order_id": 6,
"created_at": "2023-11-07T14:25:38.726Z",
"updated_at": "2023-11-07T14:25:38.726Z",
"macro_status_id": 3,
"micro_status_id": null,
"platform_id": 1,
"macro_status": {
"id": 3,
"type": "MACRO",
"slug": "READY_TO_SHIP",
"name": "READY TO SHIP",
"description": "The order is ready to be dispatched",
"name_pt": "PRONTO PARA DESPACHAR",
"description_pt": "A remessa está pronta para ser despachado",
"title_pt": "Pedido pronto para envio",
"created_at": "2023-10-02T14:22:52.896Z",
"updated_at": "2023-10-02T14:22:52.896Z",
"tracking_code": 300,
"title": "Order ready to be dispatched",
"hierarchy_status": 300,
"is_internal": false,
"final_status": false,
"zone_code": 1
}
},
"attachments": []
},
"status": "SUCCESS",
"messages": [
"Checkpoint found"
]
}
Here, the relevant information is:
date_iso
: the date of the event occurencetitle
: a brief sentence summing up the statusdescription
: a longer sentence explaining the statustracking_code
: an internal number identifying the tracking status on our side.message
: some addictional information if provided by the transporter
You can download here the list of Nobordist checkpoints.
If you are interested in seeing not only the last status, but the whole hostory of statuses, try calling GET/v1/orders/{order_id}/checkpoints
(Get Order Tracking History) passing order_id.
You will see the list of all received statuses. Here, you would see 2 statuses corresponding to Order Creation (tracking_code 100) and Order Dispatch (tracking code 300).
The Nobordist Carrier API V1 allows you to create and manage masterboxes and flight, passing all the necessary data in order to embark the packages.
- Production:
https://api.nobordist.com
- Homologation :
https://hmlapi.nobordist.com
To test the Carrier API, you will need some test orders. 2 options:
- Use your Seller API credentials to:
- Authenticate to the Seller API
- Create 10 orders using the example body presented in the section 2.1 of the Seller API, replacing the
contract_id
by your real contract_id and changing theorder_number
for each order - Dispatch all 10 orders
- Ask for your CX contact to create 10 orders for in carrier account.
First of all, let's authenticate to the Nobordist API. This step will give you a Bearer Token, that will be necessary to authenticate at each of your Carrier API requests.
You will need to use following request: POST/authenticate/{{platform}}/carrier
(Authenticate)
Please copy and paste the following request body and call the request, replacing by your credentials given by your CX contact.
Remember to replace {{platform}}
by your actual platform (your CX contact will provide you with this information).
{
"email": "MY EMAIL",
"password": "MY PASS"
}
Just as in the Seller API, store you 24 hours valid token for future use.
Let's now see how we can see the available packages we can use to compose our flights.
You will need to use following request: GET /v1/volumes
(Generate the API Token) .
You will see all your 10 packages appear.
Important: By default, this request will only show the 15 first packages found (most recent first). If you want to see more packages, please use thelimit
and offset
filters. For example, if you want to see all packages between the 31th and the 40th most recent, include this body:
{
"offset": 30,
"limit": 10
}
Let's see how to filter by date using these 2 filters:
start_registration_date
: indicates that you want to see only the packages created on this date or afterend_registration_date
: indicates that you want to see only the packages created on this date or before
Let's call the request passing this body:
{
"start_registration_date": "2023-11-01",
"end_registration_date": "2023-11-10"
}
You will get no package now, this is because you have not created any package between november 1st and november 10th, 2023. Change these dates to the current date, you will see all your orders in the response.
Let's see how to find a package by its package number.
Let's call the request passing this body:
{
"package_number": "NB000101618CN"
}
where "NB000101618CN" is replaced by the number you want to find. This way, you will find all your package information.
The first step to embark shipments is to create a masterbox. You can understand this as a grouping of packages.
You will need to use following request: POST /v1/masterboxes
(Create Masterbox)
Let's create a masterbox using 2 of the 10 packages you have in your account. The request is straightforward, you only have to inform the list of last mile tracking numbers of the packages.
IMPORTANT: In the Seller API, this is the field called last_mile_tracking_number
inside the volumes
objects. In the Carrier API, GET /v1/volumes
request, it is the field called package_number
inside the numbers
object.
You'll use the following body.
{
"package_numbers": ["ABC123","DEF345"]
}
You will get a response explaining there are no such packages. This is correct, as ABC123
and DEF345
don't correspond to actual packages
To solve the issue, replace ABC123
and DEF345
with actual last mile tracking numbers of 2 of your packages. (If you do not have this info, use GET /v1/volumes
to see the packages information and get the numbers.
IMPORTANT: Only volumes from orders that have been dispatched (seller API) can be used to create a masterbox.
You will now receive a response like:
{
"data": {
"request_id": "274d5ed0b31e381132be62d38085da9dbc7f5d26"
},
"status": "SUCCESS",
"messages": [
"Request initiated. Please use the request_id to consult its status"
]
}
This show the masterbox creation has initiated.
Now, we can take the request_id
from the response and use it to consult the creation status. Please remember the masterbox creation can take up to a few seconds.
You will need to use following request: GET /v1/request_status/create_masterbox/{request_id}
(Consult Create Masterbox) where request_id
is the string you got in the last response.
You will get such a response:
{
"data": {
"reference": "BRNBSTNBAAAAAAA1700637267121",
"masterbox_id": 1068,
"pdf_label_url": "https://nb-logistics-production.s3.amazonaws.com/9na1b2bgd4asqotj544bn1sq27a3b5686556b9819ee635f2eccab1c65a5d0f60d20db1a0bbc53bc079",
"zpl_label_url": "https://nb-logistics-production.s3.amazonaws.com/mlztec6g91zh1ajiq0lb49cd340343aa4cea4f646f2dd43d0e10360a7dbf936f14b60dd89eb742f"
},
"status": "SUCCESS",
"messages": [
[
"Box successfully created"
]
]
}
Here, you see that the masterbox was succesfully created. You get:
- The masterbox
reference
, that you will use to create the flights in the next steps - The masterbox
id
, an internal reference to the masterbox pdf_label_url
, a link to the masterbox label in pdf formatzpl_label_url
, a link to the masterbox label in zpl format
Now, we will see how to retrieve the information of a masterbox we created, using its id
.
To do that, please call a request to GET/v1/masterboxes/{id}
(Find Masterbox) , where {id}
is the id you got in the last step.
You'll receive a response that contain the details of the specific masterbox, including the reference number, the links to the label (pdf and zpl format), the list f packages inside the masterbox.
What if you want to retrieve various masterboxes of if you forgot your id
? You can use the GET/v1/masterboxes
(View Masterboxes) request
Use the 4. Create Masterbox
section to create another masterbox, using two other packages you have not used so far.
Now call the GET /v1/masterboxes
request and observe the response. You will see your 2 masterboxes.
Important: By default, this request will only show the 15 first masterboxes found (most recent first). If you want to see more masterboxes, please use thelimit
and offset
filters. For example, if you want to see all masterboxes between the 31th and the 40th most recent, include this body:
{
"offset": 30,
"limit": 10
}
- Inside the
ids
field, you will see the list of allid
s found, even the ones who are not displayed in the offset and limit filtering. - Inside the
count
field, you will see the total amount of masterboxes found (in other words, the number of ids in theids
field.
Let us suppose we want to see the informations of an order whose id
we don't know. We can find it using, for example, the reference
field.
Let's call the request passing this body:
{
"reference": "YOUR REFERENCE"
}
where YOUR REFERENCE will be the reference of the masterbox you want to fetch.
Here it is! You found your masterbox!
.
Just like the GET /v1/volumes
request, you can use date filters.
Let's call the request passing this body:
{
"start_registration_date": "2023-11-01",
"end_registration_date": "2023-11-10"
}
changing these dates to the current date, you will see all your masterboxes in the response.
We will know follow the process and create a flight grouping the 2 already created masterboxes.
You will need to use following request: POST /v1/flights
(Create Flight)
The request is straightforward, you only have to inform the list of last mile tracking numbers of the packages.
You'll use the following body.
{
"box_numbers": ["BR12333","BR44444"]
}
where BR12333 and BR44444 should be replaced by the actual references of the 2 masterboxes you created. You will get a response similar to this
{
"data": {
"flight_id": 313
},
"status": "SUCCESS",
"messages": [
"Flight successfully created"
]
}
Very good! You have now created your flight, you can already see its id
, generated by Nobordist. Store it as you will need it for the next steps
Now, we will see how to fill the information of a flight we created, using its id
.
To do that, please call a request to PUT/v1/flights/{id}
(Update Masterbox) , where {id}
is the id you got in the last step.
Here is a body that you will copy and paste and call the request:
{
"departure_date": "2020-01-05",
"arrival_date": "2020-01-05",
"departure_time": "11:45",
"arrival_time": "13:00",
"airline": "EE",
"departure_airport": "SZX",
"arrival_airport": "RIO",
"flight_number": "1234",
"freight_value": 3200,
"mawb_number": "49846186617",
"mawb_file_format": "link",
"mawb_file": "https://web.stanford.edu/group/csp/cs21/htmlcheatsheet.pdf"
}
You will get a success response indicating the flight has been updated with the information.
IMPORTANT: Here, we informed the MAWB file as a pdf. You can also inform it as a Base64 string, to do that just fill "binary" instead of "link" in the mawb_file_format
field.
IMPORTANT: You can update flight information as many times as needed, but for security purposes you will always have to pass, at least, the mawb file in the request.
Now, we will see how to retrieve the information of an order we created, using its id
.
To do that, please call a request to GET/v1/flight/{id}
(Find Flight) , where {id}
is the id of the flight . You'll receive a response that contain the details of the specific flight, including the list of boxes.
Now, we will see how to access various flights' information.
What if you want to retrieve various flights of if you forgot your id
? You can use the GET/v1/flights
(View Flights) request
Call the GET /v1/flights
request and observe the response. You will see your flight.
Important: By default, this request will only show the 15 first flights found (most recent first). If you want to see more flights, please use thelimit
and offset
filters. For example, if you want to see all flight between the 31th and the 40th most recent, include this body:
{
"offset": 30,
"limit": 10
}
Let us suppose we want to see the informations of a flight whose id
we don't know. We can find it using, for example, the mawb_number
field.
Let's call the request passing this body:
{
"mawb_number": "YOUR MAWB"
}
The request will return no flight. Now, change "YOUR MAWB" to "49846186617" and you will see your flight in the response.
Just like the GET /v1/volumes
, request, you can use date filters.
Let's call the request passing this body:
{
"start_registration_date": "2023-11-01",
"end_registration_date": "2023-11-10"
}
changing these dates to the current date, you will see your flight in the response.
What happens if you want to add a package to one of the masterboxes of the flight? You will need to first cancel the flight, then cancel the masterbox before creating them all over again. Let's try this.
To do that, please call a request to DELETE /v1/flights/{id}
(Remove Flight) , where {id}
is the id of the flight .
IMPORTANT: Doing so, you will loose all data referring to the flight (mawb, flight number and dates, freight value, ...)
To do that, please call a request to DELETE /v1/masterboxes
(Remove Masterbox) with following body:
{
"box_number": "BRNBSTNBAAAAAAA9955309067372"
}
replacing by the box_number
(reference) of the box you want to delete.
You will now receive a response like:
{
"data": {
"request_id": "274d5ed0b31e381132be62d38085da9dbc7f5d26"
},
"status": "SUCCESS",
"messages": [
"Request initiated. Please use the request_id to consult its status"
]
}
This show the masterbox deletion has initiated.
Now, we can take the request_id
from the response and use it to consult the deletion status. Please remember the masterbox creation can take up to a few seconds.
You will need to use following request: GET /v1/request_status/remove_masterbox/{request_id}
(Consult Remove Masterbox) where request_id
is the string you got in the last response.
You will get a response indicating that the masterbox was successfully removed.
Now, you can create everything again:
- Create the Masterbox, adding an additional volume as compared to the last masterbox
- Consult the Masterbox creation Status
- Create a flight with the 2 masterboxes you have
- Update the flight information
We reached the very last step of the flow. Closing Manifest is a way for you to give us the "green light" about the shipment, indicating you have finished all the operations on the flight and itis ready to embark.
To do that, please call a request to PUT /v1/flights/{id}/close_manifest
(Close Manifest) , where {id}
is the id of the flight .
You will now receive a response like:
{
"data": {
"request_id": "274d5ed0b31e381132be62d38085da9dbc7f5d26"
},
"status": "SUCCESS",
"messages": [
"Request initiated. Please use the request_id to consult its status"
]
}
This show the manifest closing has initiated.
Now, we can take the request_id
from the response and use it to consult the closing status. Please remember the manifest closing can take up to a few seconds.
You will need to use following request: GET /v1/request_status/close_manifest/{request_id}
(Consult Close Manifest) where request_id
is the string you got in the last response.
You will get a response indicating that the flight was successfully closed.
Let's try to remove the flight. To do that, please call a request to DELETE /v1/flights/{id}
, where {id}
is the id of the flight .
You will get an error.
IMPORTANT: After Closing the Manifest, you can not remove the flight anymore, its contents (masterboxes and packages) are definitely fixed.
If you reached this step, it means you ended the process and you are now fully integrated! Congratulations! If you have suggestions, comments or complains to make about this tutorial, please feel free to send your thoughts to [email protected] .