CBIC Port Message Integration Specification Document v1.0
CBIC Port Message Integration Specification Document v1.0
1
CBIC - Port Message Integration Specification Document
2
CBIC - Port Message Integration Specification Document
Table of Contents
1. Introduction.........................................................................................................................................4
2. Purpose of the Document....................................................................................................................4
3. Mode of Implementation....................................................................................................................4
3.1 Base 64 Encoded, Cryptographic & Digital Signature Approach..................................................5
4. Authentication and Authorization.......................................................................................................5
5. APIs to be Developed...........................................................................................................................6
6. API Specification..................................................................................................................................6
6.1 API communicating Conveyance Call Number (VCN)...................................................................6
6.1.1 API Overview........................................................................................................................7
6.1.2 API Format...........................................................................................................................7
6.1.3 POST API Format – Posting VCN data to ICEGATE................................................................8
6.1.4 POST API Format – VCN acknowledgement sent to Port...................................................14
6.1.5 Error Code with Description....................................................................................................19
6.2 ATE – Actual Time Event - API Reporting actual Arrival / Departure Time................................19
6.2.1 API Overview......................................................................................................................19
6.2.2 POST API Format – To post Arrival/Departure Details to Customs....................................20
6.2.3 POST API Format – Arrival/Departure Details Acknowledgment.......................................26
6.2.4 Arrival Time JSON Schema and Sample..............................................................................29
6.2.6 Error Code With Description..................................................................................................29
6.3 ELR API - API Reporting Equipment Landed / Loaded Report....................................................30
6.3.1 API Overview......................................................................................................................30
6.3.2 POST API Format – To post Equipment Landed/Loaded Data to Customs.........................30
6.3.3 POST API Format – Equipment Landed/Loaded Details Acknowledgment........................36
6.3.4 Equipment Landed JSON Schema and Sample...................................................................39
6.3.6 Error Code With Description...................................................................................................39
6.4 CCM API – API Reporting Custom Control Message (EI, EO, PC, CH)..........................................40
6.4.1 API Overview......................................................................................................................40
6.4.2 API Format.........................................................................................................................41
6.4.3 First POST API...........................................................................................................................41
6.4.4 Second POST API.......................................................................................................................44
6.4.5 CCM API – API Reporting Customs Control Message (EI,EO,PC)) – Schema & Sample files48
3
CBIC - Port Message Integration Specification Document
1. Introduction
Ports play vital role in the overall economic development. About 95 percent by volume and 70
percent by value of the India’s international trade is carried on through maritime transport.
To enabling secure exchange of information between public and private stakeholders w.r.t. port
to improve the port operations, an open electronic platform has been envisaged to be
developed for port operation. The system optimizes, manages and automates port and logistics
processes operate at ports through online submission of data.
For all Outbound messages from Customs to Ports, ICEGATE will develop and expose the
POST API. Ports system will invoke the POST API to fetch the data based on the events
defined in this document.
Upon receipt of this data Ports will store the data in its database and send an ACK back
to Customs.
The document mentioning the details of the APIs to be exchanged between Custom & Port
System. The content of this document is meant to act as a guideline for exchanging details
through API from both the end.
3. Mode of Implementation
Real time RESTful APIs will be developed at both the ends (Ports and ICEGATE). Following are the APIs to
be developed:
1. Two POST APIs shall be developed for each of the following three messages, first API to post the
data to Customs and second API (ACK API) to get the acknowledgment of the first API request:
a. Communication of Conveyance Call Number (e.g VCN)
b. Intimation of Actual Time of Arrival/Departure of Conveyance
c. Intimation of Transport Equipment’s Landed/Loaded in the conveyance
POST API Usage - The API will be developed & exposed by ICEGATE, Ports will consume the same.
4
CBIC - Port Message Integration Specification Document
2. Two POST APIs shall be developed for Customs Control Messages (e.g Entry Inwards, Entry
Outwards etc.):
a. First API is to get the details in bulk
b. Second API is to get the status of individual record
POST APIs Usage: These APIs shall be developed & exposed by ICEGATE and Ports will consume the
same.
Each payload and Acknowledgement from the respective senders will be base 64 encoded and
digitally signed.
1. Payload will be generated at Sender’s end and the same will be digitally signed by signer utility
2. Signed payload shall be encrypted with AES 256 bit encryption algorithm (with Secret key, which
would be of 32 bit).
3. Encrypted payload will be encoded using base64 encoder
1. Received encoded payload will be decoded with base64 decoder. Outcome will be encrypted
payload
2. Encrypted payload will be decrypted using AES 256 bit decryption algorithm with shared Secret
key. Outcome will be signed payload
3. Signed payload will be verified at receiver end using verify utility.
NOTE: Secret Key will be shared by ICEGATE to Ports, which is a onetime setup.
- Oauth2.0 used for ensuring Client reliability and to define access rights.
- Client application needs to be registered at Custom External API Gateway.
- CBIC External API Gateway enabled Oauth 2.0 Authentication and Authorization
Servers. To post the data in ICEGATE, sender need to invoke Auth API with registered
client-id and JWT token
- Post user validation by CBIC API Gateway, Access-Token will be generated and shared
with requesting party, as a response of their invoking request.
- Payload shared through REST POST request, hit the Custom interface with bearer
(Access-Token), for storing Payload Data at ICEGATE end.
5
CBIC - Port Message Integration Specification Document
5. APIs to be Developed
6. API Specification
This API will be invoked by sender to post data to Custom. Upon receiving the request for
Voyage Registration (CALINF) from the Authorized Sea Carrier / Authorized Sea Agent, port
generate Voyage Number Which will share with Custom for further processing. Ports will share
these details to ICGEATE through API post receiving CALINV EDI request message from the port
after receiving approval of competent port authority.
6
CBIC - Port Message Integration Specification Document
CBIC exposed POST API to take payload from the Ports application on real time basis.
Ports application will invoke this API when ready to push the details to Custom. As a response,
ACK will sent back to Ports.
This section describes standard format which will be used to define API exposed at CBIC
interface. This API will be published as stateless REST API over HTTPS.
Below table depicts the URI pattern to be used, content type, payload while defining API end
points along with API response:
API Endpoint Defined by Custom
7
CBIC - Port Message Integration Specification Document
Service Service ID
Number
Channel Customs Channel ID
Number
Flag Test (T) / production (P) indicator
Requestor ID ICEGATE ID of the Requestor
Request Payload
All the request parameters for this API shall be sent with POST request. This data will be
Base64 encoded JSON payload, digitally signed by communicating
stakeholders/partners. The browser request shall have the following parameters:
Parameter Description
Bearer/Access- Sender will obtain this parameter post successful
Token/Client- validation at CBIC external API Gateway with Client-
ID Id and Password.
Payload Data Payload generated as per defined schema at
stakeholder/partner end. This data will be encoded,
digitally signed and encrypted as per the SOP approach.
Request Sample JSON and Schema have listed for each API
payload.
6.1.3 POST API Format – Posting VCN data to ICEGATE
8
CBIC - Port Message Integration Specification Document
Parameter Description
Sender-ID- Icegate-ID of stakeholders would be like
Qualifier Port/TO/ZZ_DSC etc.
( ZZ - for all)
( VARCHAR2 (10) )
e.g: INBOM1+2019+0001
(INBOM120190001)
9
CBIC - Port Message Integration Specification Document
10
CBIC - Port Message Integration Specification Document
Below table depicts the proposed URL, content type, payload while sending API response:
API response endpoint URL URL defined by ICEGATE
Method POST
Content Type Application/JSON
URL Description
http/https All API will be published in production
over HTTPS only. HTTP protocol will be
used in non-production environments.
Response Data
Synchronous Response parameters for this API shall be sent with POST. This data will be Base64
encoded JSON payload, digitally signed by communicating stakeholders/partners. The browser
URL payload shall have the following parameters:
Response from CBIC system for this API will be in the following format:
Parameter Description
11
CBIC - Port Message Integration Specification Document
Parameter Description
Attribute Details
Attribute Data Type Mandatory Description
Name with Size / /Remarks
Optional
Requesto VARCHAR2(35) M ICEGATE ID
r ID of the
Requestor
Common VARCHAR2(25) M Common
Reference Reference
Number Number of
request
cluster
ACK-ID VARCHAR2 M Generated
(28) at Custom
end for
every
transaction,
post
successful
schema
validation
REQUEST VARCHAR2(6) M 000 for success, else
STATUS error code along
with error
appropriate brief
will be provided.
STATUS VARCHAR2(30) M ACK
DESCRIPT Message -
ION Data
successfully
inserted into
database
NAK
Message –
Data
12
CBIC - Port Message Integration Specification Document
ACK Response
{
"status": "success",
"errorCode": "000",
"comRefNum": "2019062649815390",
"message": "data integrated",
"senderID": "Port ICEGATEID ",
"ackID": "20081916573396467746447453813"
}
NAK Response
{
"status": "failure",
"errorCode": "SCERR01",
"comRefNum": "2019062649815390",
"message": "Schema Validation Failed due to bellow Error:\r\n\r\nerror: object has
missing required properties ([\"icegatePayload\"])\n level: \"error\"\n schema:
{\"loadingURI\":\"#\",\"pointer\":\"\"}\n instance: {\"pointer\":\"\"}\n
domain: \"validation\"\n keyword: \"required\"\n required: [\"icegatePayload\"]\n
missing: [\"icegatePayload\"]\ninValid json file",
"senderID": "Port ICEGATEID",
"ackID": "2008191656917722894179565488"
}
13
CBIC - Port Message Integration Specification Document
e.g: INBOM1+2019+0001
14
CBIC - Port Message Integration Specification Document
Below table depicts the proposed URL, content type, payload while sending API
response:
API response endpoint URL URL defined by ICEGATE
Method
POST
URL Description
Response Data
Synchronous Response parameters for this API shall be sent with POST/GET. This data
will be Base64 encoded JSON payload, digitally signed by communicating
stakeholders/partners. The browser URL payload shall have the following parameters:
Parameter Description
Response Data generated as per defined response schema at receiver end. This
Payload Data data will be digitally signed then encrypted and encoded as per the
SOP approach.
15
CBIC - Port Message Integration Specification Document
Attribute Details
Attribute Data Type Mandatory Description
Name with Size / /Remarks
Optional
Status VARCHAR2(15) M ACK Status
post
consumption
of Payload
Error VARCHAR2(6) M 000 for success, else
Code error code along
with error
appropriate brief
will be provided.
16
CBIC - Port Message Integration Specification Document
ACK Response
{
"status": "success",
"errorCode": "000",
"CommonRefNumber": "2019031955489454",
"Message”: "Data Integrated",
”Requestor ID”: ”JNPT”,
”ackId”: ”xyz”,
”manifestNumber/rotationNumber”: ”123456789”,
”manifestDate/rotationDate”: ”19/05/2019”
}
NAK Response
{
"status": "failure",
"errorCode": "109",
"CommonRefNumber": "2019031955489454",
"Message”: "Data not Integrated",
”Requestor ID”: ”JNPT”
”ackId”: ”xyz”
”manifestNumber/rotationNumber”: ”123456789”
”manifestDate/rotationDate”: ”19/05/2019”
}
17
CBIC - Port Message Integration Specification Document
Code Value
10 IMO ship identification number
11 Sea Going Vessel, not requiring IMO
Registration
20 Wagon number
30 Registration number of the road vehicle
40 IATA flight number
41 Registration number of the aircraft
Code Description
1 Cargo operations
2 Passenger movement
3 Taking bunkers
4 Changing crew
5 Goodwill visit
6 Taking supplies
7 Repair
8 Laid-up
9 Awaiting orders
10 Miscellaneous
11 Crew movement
12 Cruise, leisure and recreation
13 Under government order
14 Quarantine inspection
15 Refuge
16 Unloading cargo
17 Loading cargo
18 Repair in dry dock
19 Repair in wet dock
20 Cargo tank cleaning
21 Means of transport customs clearance
22 Degassing
23 Waste disposal
18
CBIC - Port Message Integration Specification Document
6.2 ATE – Actual Time Event - API Reporting actual Arrival / Departure Time
This API will be invoked by Port, after Arrival of Vessel at Port of Origin. Port Terminal
Operator will share this information with Port and Port push the details to Custom post
approval of competent authority.
Events are:
1. AT – Arrival
2. AD - Departure
CBIC exposed POST API to receive ATA details with the Port application on real time basis.
Port application will invoke this API when they are ready to push the details at Custom end. As a
response, ACK / NAK will be sent back to Port.
19
CBIC - Port Message Integration Specification Document
Payload header includes the information that is being exchanged such as the type of
document exchanged, reference number, sender & receiver identity may along with the
IDs of parties need to be notified.
The following are the list of parameters that will be passed in the payload Header of request:
Parameter Description
Doc Type TOCHI02
( VARCHAR2 (14) )
Comm Number assigned to the Payload request by sender
Ref. No. ( NUMBER (35) )
20
CBIC - Port Message Integration Specification Document
Parameter Description
Sender-ID- Icegate-ID of stakeholders would be like
Qualifier Port/TO/ZZ_DSC etc.
( ZZ - for all)
( VARCHAR2 (10) )
Format: Location
Code (6 chars) +
Year (4 digits) + 4
digits running
serial no.
e.g:
INBOM1+2019+00
01
(INBOM12019000
1)
21
CBIC - Port Message Integration Specification Document
DEP – All
Departure Time till
reported by
Harbour Master
Values: Refer
below Code List
Table – A
This would
normally be 7 digit
IMO Number for
vessel movement
(needed in case of
Departure only)
22
CBIC - Port Message Integration Specification Document
AR of VARCHAR2 M Authorized
Terminal (17) Representative of
Operator Terminal Operator.
(PAN) (PAN of AR)
(Note - Departure
done by harbor
master, not by Port
Operators)
Values would be
like:
1. Time of
23
CBIC - Port Message Integration Specification Document
Below table depicts the proposed URL, content type, payload while sending API response:
API response endpoint URL URL defined by ICEGATE
Method POST
Content Type Application/JSON
URL Description
http/https All API will be published in production
over HTTPS only. HTTP protocol will be
used in non-production environments.
Response Data
Synchronous Response parameters for this API shall be sent with POST. This data will be Base64
encoded JSON payload, digitally signed by communicating stakeholders/partners. The browser
URL payload shall have the following parameters:
Attribute Details
Attribute Data Type Mandatory Description
Name with Size / /Remarks
Optional
Requesto VARCHAR2(35) M ICEGATE ID
24
CBIC - Port Message Integration Specification Document
ACK Response
{
"status": "success",
"errorCode": "000",
"CommonRefNumber": "2019031955489454",
25
CBIC - Port Message Integration Specification Document
NAK Response
{
"status": "failure",
"errorCode": "SCERR01",
"comRefNum": "2019062649815390",
"message": "Schema Validation Failed due to bellow Error:\r\n\r\nerror: object has
missing required properties ([\"icegatePayload\"])\n level: \"error\"\n schema:
{\"loadingURI\":\"#\",\"pointer\":\"\"}\n instance: {\"pointer\":\"\"}\n
domain: \"validation\"\n keyword: \"required\"\n required: [\"icegatePayload\"]\n
missing: [\"icegatePayload\"]\ninValid json file",
"requestorID": "JNPT",
"ackid": "1234567890123456",
}
26
CBIC - Port Message Integration Specification Document
Parameter Description
Sender-ID- Icegate-ID of stakeholders would be like
Qualifier Port/TO/ZZ_DSC etc.
( ZZ - for all)
( VARCHAR2 (10) )
e.g: INBOM1+2019+0001
(INBOM120190001)
Response Data
Synchronous Response parameters for this API shall be sent with POST/GET. This data will be
Base64 encoded JSON payload, digitally signed by communicating stakeholders/partners. The
browser URL payload shall have the following parameters:
Parameter Description
Response Data generated as per defined response schema at receiver end. This
Payload Data data will be digitally signed then encrypted and encoded as per the
SOP approach.
27
CBIC - Port Message Integration Specification Document
Parameter Description
Attribute Details
Attribute Data Type Mandatory Description
Name with Size / /Remarks
Optional
Status VARCHAR2(15) M ACK Status
post
consumption
of Payload
Error VARCHAR2(6) M 000 for success, else
Code error code along
with error
appropriate brief
will be provided.
28
CBIC - Port Message Integration Specification Document
ACK Response
{
"status": "success",
"errorCode": "000",
"CommonRefNumber": "2019031955489454",
"Message”: "Data Integrated",
”Requestor ID”: ”JNPT”,
”ackId”: ”xyz”,
}
NAK Response
{
"status": "failure",
"errorCode": "109",
"CommonRefNumber": "2019031955489454",
"Message”: "Data not Integrated",
”Requestor ID”: ”JNPT”
”ackId”: ”xyz”
}
29
CBIC - Port Message Integration Specification Document
This API will be invoked by Ports, after Arrival of Vessel at Port of Origin. Port Terminal
Operator will share this information with Ports and Ports push the details to Custom
post approval of competent authority.
CBIC exposed POST API to receive event timestamp details with the Ports application on
real time basis.
Ports application will invoke this API when they are ready to push the details at Custom
end. As a response, ACK / NAK will be sent back to Ports.
Payload header includes the information that is being exchanged such as the type of document
exchanged, reference number, sender & receiver identity may along with the IDs of parties need
to be notified.
The following are the list of parameters that will be passed in the payload Header of request:
Parameter Description
Doc Type TOCHI03
( VARCHAR2 (14) )
30
CBIC - Port Message Integration Specification Document
Parameter Description
Comm Number assigned to the Payload request by Ports/
Ref. No. sender
(NUMBER (35) )
31
CBIC - Port Message Integration Specification Document
Format: Location
Code (6 chars) + Year
(4 digits) + 4 digits
running serial no.
e.g:
INBOM1+2019+0001
(INBOM120190001)
32
CBIC - Port Message Integration Specification Document
33
CBIC - Port Message Integration Specification Document
EDIFACT 8053:
BB-Breakbulk,
BL- Blocks
CH – Chassis,
CN - Container,
OBE -
Onboard
Container,
TE - Trailer
34
CBIC - Port Message Integration Specification Document
the container
carrying this cargo.
1- In Right
condition,
2- Damaged
ACK Response
{
"status": "success",
"errorCode": "000",
"CommonRefNumber": "2019031955489454",
"Message”: "Request Processed",
”Requestor ID”: ”JNPT”,
”ackId”: ”1234567890123456”,
}
NAK Response
{
"status": "failure",
"errorCode": "SCERR01",
"comRefNum": "2019062649815390",
35
CBIC - Port Message Integration Specification Document
36
CBIC - Port Message Integration Specification Document
e.g: INBOM1+2019+0001
(INBOM120190001)
Response Data
Synchronous Response parameters for this API shall be sent with POST. This data will be Base64
encoded JSON payload, digitally signed by communicating stakeholders/partners. The browser
URL payload shall have the following parameters:
Parameter Description
Response Data generated as per defined response schema at receiver end. This
Payload Data data will be digitally signed then encrypted and encoded as per the
SOP approach.
Attribute Details
37
CBIC - Port Message Integration Specification Document
ACK Response
{
"status": "success",
38
CBIC - Port Message Integration Specification Document
"errorCode": "000",
"CommonRefNumber": "2019031955489454",
"Message”: "Data Integrated",
”Requestor ID”: ”JNPT”,
”ackId”: ”xyz”,
}
NAK Response
{
"status": "failure",
"errorCode": "109",
"CommonRefNumber": "2019031955489454",
"Message”: "Data not Integrated",
”Requestor ID”: ”JNPT”
”ackId”: ”xyz”
}
39
CBIC - Port Message Integration Specification Document
6.4 CCM API – API Reporting Custom Control Message (EI, EO, PC, CH)
POST API Usage: These APIs shall be developed & exposed by ICEGATE and Ports will consume the
same.
1. The First POST API shall be used to POST details like Count of Records, Rotation Number,
Rotation Date, VCN, Custom Control Timestamp, Flag and array of records as synchronous reply
of messages left to be post.. The count of records in the will represent the number of messages
to be pulled.
2. The Second POST API will be used to seek the status of individual Control Flags based on the
required parameter to post the actual payload from ICEGATE.
3. In response to the request, messages regarding Entry Inward/Control Granted/not Granted
message will share with requester.
This API will be invoked by the Ports, to obtain Entry Inward Grant / Entry Outward Grant / Port
Clearance / Container Hold Grant permissions from Custom. Custom facilitate the request after
validating Manifest and ATA details filed by them.
Custom provides Grant details, whenever Custom is ready with such details post vetting Sender-
Request.
40
CBIC - Port Message Integration Specification Document
Payload header includes the information that is being exchanged such as the type of document
exchanged, reference number, sender & receiver identity may along with the IDs of parties need
to be notified.
The following are the list of parameters that will be passed in the payload Header of request:
Parameter Description
Doc Type CHTOI04
( VARCHAR2 (14) )
Comm Number assigned to the Payload request by Ports /
Ref. No. sender
( NUMBER (35) )
The first POST API will take the count of the messages to be post by ICEGATE.
41
CBIC - Port Message Integration Specification Document
Response Data
Synchronous Response parameters for this API shall be sent with POST. This data will be Base64
encoded JSON payload, digitally signed by communicating stakeholders/partners. The browser
URL payload shall have the following parameters:
42
CBIC - Port Message Integration Specification Document
4. CH –
Container
Hold
43
CBIC - Port Message Integration Specification Document
e.g:
INBOM1+2019+000
1
(INBOM120190001)
1.HOLD
2. RELEASE
This API will be invoked by Ports to get the actual payload against the Rotation Number and Rotation
Date received in first POST API
6.4.4.1 Attributes Details – Request Payload
44
CBIC - Port Message Integration Specification Document
e.g:
INBOM1+2019
+0001
45
CBIC - Port Message Integration Specification Document
(INBOM120190
001)
Response Data
Synchronous Response parameters for this API shall be sent with POST. This data will be Base64
encoded JSON payload, digitally signed by communicating stakeholders/partners. The browser
URL payload shall have the following parameters:
Parameter Description
Bearer/Access- Sender will obtain this parameter post successful validation at CBIC
Token/Client- external API Gateway with Client-Id and Password.
ID
Response Data generated as per defined response schema at receiver end. This
Payload Data data will be encoded, digitally signed and encrypted as per the SOP
approach.
Response Sample JSON and Schema have listed for each API.
46
CBIC - Port Message Integration Specification Document
Format:
Location
Code (6
chars) + Year
(4 digits) + 4
digits
running
serial no.
e.g:
INBOM1+20
19+0001
(INBOM120
190001)
47
CBIC - Port Message Integration Specification Document
- Type of
Equipment
( VARCHAR2
(10) )
- Equipment
Unique
Number
( VARCHAR2
(10) )
6.4.5 CCM API – API Reporting Customs Control Message (EI,EO,PC)) – Schema & Sample files
48