- Previous: Shipment API Documentation
- Up:
- Next: Global Tracking Shipment API Documentation
Booking API Documentation
Guide to Booking API
Welcome to the My JAS Connect Booking API. This service allows your business applications (such as an ERP, TMS, or e-commerce platform) to communicate directly with our core booking systems.
By integrating with this REST-based API, you can automate your entire booking creation process, enabling your systems to directly register new bookings with JAS in an easy and automated way. This guide provides a complete overview of how to use the Booking API services to get started.
Key Capabilities & Features
Our Booking API is a powerful service designed for simplicity, security, and accuracy.
- Create Bookings: The API's primary function is to create new bookings in the JAS system. Bookings are easily generated by providing basic information about the shipper, consignee, and shipment details.
- Flexible Data Formats: We support both major data formats for your convenience. You can submit your booking requests in either
application/jsonorapplication/xml. - Broad Transport Mode Support: The API can be used to book freight across our global network, including:
- Air Freight (Loose and ULD)
- Sea Freight (FCL and LCL)
- Road Freight (FTL and LCL/LTL)
- Rail Freight (FCL and LCL)
- Courier
- Secure & Encrypted: All API communication is secured. We use the OAuth 2.0 protocol for authentication, and all web calls are made over HTTPS to ensure your data is always encrypted in transit.
- Robust Error Handling: The API provides clear and accurate error handling. You will receive standard HTTP response codes (like
400 Bad Requestor401 Unauthorized) to help your team debug any issues with an integration request .
Getting Started: Authentication & Endpoints
All API requests must be securely authenticated before they can interact with the system. Accessing the API is a two-step process.
Step 1: Generate an Access Token
Before you can create a booking, you must request a bearer token using the OAuth 2.0 client_credentials grant type.
- Method:
POST - Endpoint:
https://<<URL_PROVIDED_IN_THE_PORTAL >>/oauth2/token - Headers:
Content-Type: application/x-www-form-urlencoded -
Body parameters Values grant_type client_credentials client_id <YOUR_CLIENT_ID> client_secret <YOUR_CLIENT_SECRET>
Step 2: Call the Booking API
Once you have your access token, you can call the CreateBooking endpoint. You must include the token and your unique API key in the headers of every request.
-
Required Headers: Authorization Bearer <<ACCESS_TOKEN>> x-api-key <<Key value sent by JAS Connect Team>> Content-Type application/json or application/xml - API Endpoints (Method:
POST): - Resources:
- JSON:
/v1/Booking/CreateBookingjson - XML:
/v1/Booking/CreateBookingxml
- JSON:
Understanding the API Flow
The process of creating a booking is straightforward.
1. Request Validation
When JAS receives your CreateBooking request, our system first performs a validation. This check ensures:
- Your Authentication headers (
Authorizationandx-api-key) are valid. - Your Content-Type header matches the endpoint (e.g.,
application/jsonfor theCreateBookingjsonendpoint). - Your request payload is well-formed and includes all mandatory fields. A
400 Bad Requesterror will be returned if there are mismatches or other issues with the request .
2. Create Booking & Receive Confirmation
After a successful validation, JAS creates the booking in our system. The API will return a synchronous response in the same format you sent (JSON or XML), indicating the result:
- On Success (Code
200): You will receive a response containing:"Success": true"JobNumber": "S508480248"(This is your new JAS Booking ID)
- On Failure: You will receive a response with:
"Success": false"Error": "Detailed error message..."- This can be due to business logic errors or unexpected server issues (e.g.,
500 Internal Server Error).
Core Data Structure
A booking request is built from several primary data collections. The full specification is available for download, but the key components are:
- Details : The main information about the booking, including the mandatory
ContainerModeandTransportModeCode, as well asServiceLevelCode,GoodsDescription, and total weight/volume. - ClientAddress: Information about your organization (the "client") that is placing the booking.
- ShippersAddress: The full address and contact details for the party sending the goods.
- ConsigneeAddress: The full address and contact details for the final recipient of the goods. This section contains several mandatory fields, including
Address1,City,CompanyName,CountryCode, andPostCode. - DateCollection : Contains critical dates for the booking, including the mandatory
PickupRequiredBydate and time. - OrderNumberCollection : A list where you can provide your internal order references.
- AdditionalReferenceCollection : Allows you to add other key business identifiers, such as a
Purchase Order Number(Code:PO) orClient Reference(Code:CRF) . - PackingLineCollection: A detailed, item-level list of the goods being shipped. You can include unlimited packing lines. Each line must include:
ItemNo(Line Number)GoodsDescriptionPackQty(Package Quantity)PackTypeCode(e.g.,PKG,CTN,PLT)WeightWeightUnitCode(e.g.,KG,LB)- ContainerCollection : For sea freight, this collection specifies the
ContainerType(e.g.,20GP,40HC) andQuantity.
- Previous: Shipment API Documentation
- Up:
- Next: Global Tracking Shipment API Documentation
0 Comments
Please sign in to post a comment.