帮助中心
3.2.3 港区订阅查询_v2

# 1. 描述

  • 接口功能

    该接口可根据【提单号、箱号、订舱号】主动订阅和查询港区(支持的港区 (opens new window))公布物流的信息

  • 注意事项

    1. 该接口以订阅参数中 港区代码+订阅类型+订阅单号+进出口标识(如果传了) 为同一笔订阅查询判断标准
    2. 第一次调用相当于订阅操作,在壹沓数据获取成功后(2秒-30分钟内,一般10秒内),下次调用(查询)时将会返回数据,如果配置了数据推送接口,数据获取成功或者变更后会自动推送
    3. V2接口和V1接口的主要区别是对接口的请求响应报文的结构和部分字段逻辑做了优化,极大降低字段取值逻辑复杂度

# 2. 请求URL

  • https://openapi.1datatech.net/ocean/api/port/query/v2

# 3. 请求方式

  • POST
  • Content-Type :application/json

# 4. 请求头

参数 说明
accessToken 调用接口的凭证,通过获取Token 接口获得
nonce 签名时生成的随机数
timestamp 签名时生成的时间戳
sign 接口签名

# 5. 请求参数

参数名 必选 类型 说明
subType Integer 订阅类型,1-提单号/订舱号,2-箱号 (部分港区支持,可见支持的港区代码 (opens new window)
carrierCd string 港区代码 如:CNSHK 可见支持的港区代码 (opens new window)
subNo string 订阅单号 可见支持的港区代码 (opens new window)
extraInfo json 扩展信息(回调时会原样返回)注意:如果每次以相同的订阅参数(数据源+订阅类型+订阅单号+进出口标识)调用接口,但拓展字段中的内容不一样则会覆盖上一次的,只保留最新的
importAndExportFlag String 进出口标识(I-进口,E-出口),默认查询出口,查询进口需传I

# 6. 请求参数示例

 [
        {
            "subType": 1,
        		"carrierCd": "CNTAO",
        		"subNo": "225201002" ,
         		"importAndExportFlag": "E"           
        }
 ]

1
2
3
4
5
6
7
8
9

# 7. 响应参数

参数名 类型 说明
subNo string 订阅单号 (订阅时的传参)
subType Integer 订阅类型 (订阅时的传参)
carrierCd string 港区代码 (订阅时的传参)
importAndExportFlag string 进出口标识(订阅时的传参)
extraInfo string 扩展信息(订阅时的传参)
resultCode Integer 查询结果代码(1:订阅成功 2:查询成功 3:暂未查询到结果或官网查询无数据 )
resultMessage String 查询结果信息
resultData object 查询结果
importAndExport string 整单进出口标识
isCompleted string 整单流程是否结束 Y-是 N-否
blNo string 提单号
carrier string 港区名称
pol string 起运港
polCd string 起运港简称
dtp string 目的港
dtpCd string 目的港简称
transshipmentPort string 中转港
dischargePort string 卸货港
terminalCd string 码头代码
terminal string 码头名称
vslNameEn string 英文船名(如果importAndExport是进口,则代表是进口船名,反之则是出口船名)
vslNameZh string 中文船名(如果importAndExport是进口,则代表是进口船名,反之则是出口船名)
voy string 航次(如果importAndExport是进口,则代表是进口航次,反之则是出口航次)
containerInfoList Array 集装箱信息
containerNo string 箱号
blNo string 箱子所属的提单号
size string 尺寸
containerType string 箱型
sealNo string 铅封号
boxPosition string 场箱位
statusDesc string 箱状态描述
containerHolder string 箱属(持箱人)
containerPieces string 箱总件数
containerWeight string 箱总毛重
containerVolume string 箱总体积
tareWeight string 箱皮重
approachMode string 进场方式
approachTime string 进场时间
appearanceMode string 出场方式
appearanceTime string 出场时间
customsClearance string 海放(官方原始值) , 部分港区支持,具体见 支持的港区 (opens new window)
customsClearanceFlag string 海放标记(壹沓标准映射,Y/N) , 部分港区支持,具体见 支持的港区 (opens new window)
terminalClearance string 码放(官方原始值) , 部分港区支持,具体见 支持的港区 (opens new window)
terminalClearanceFlag string 码放标记(壹沓标准映射,Y/N) , 部分港区支持,具体见 支持的港区 (opens new window)
customsClearanceTime string 海放时间,部分港区支持,具体见 支持的港区 (opens new window)
terminalClearanceTime string 码放时间 , 部分港区支持,具体见 支持的港区 (opens new window)
configurationLoad string 配载(官方原始值)
configurationLoadFlag string 配载标记 (壹沓标准映射,Y/N)
importVessel string 进口英文船名
importVesselName string 进口中文船名
importVoyage string 进口航次
vslNameZh string 出口中文船名
vslNameEn string 出口船名
voy string 出口航次
loadingPort string 装货港
dischargePort string 卸货港
transshipmentPort string 转运港
loadshipTime string 装船时间
unloadTime string 卸船时间
emptyOrFull string 空重 (官方原始值)
emptyOrFullFlag string 空重标记 (壹沓标准映射,E/F)
vgmFlag string vgm标识 (部分港区支持,具体见支持的港区 (opens new window)
vgmWharfWeighing string VGM码头称重
vgmShip string VGM称重(船公司)
vgmMessageReceiving string VGM报文接收时间
shipTo string 运抵状态(官方原始值)
shipToFlag String 运抵状态标记(壹沓标准映射,Y/N)
arrivalMessageReceivingTime string 运抵报文接收时间
arrivalMessageSendingTime string 运抵报文发送时间
maritimeAffairs string 海事
nationalInspection string 国检
externalManagement string 外理
storageDays string 堆存天数
triplicate string 三联单状态
manifest string 预配舱单 (部分港区支持,具体见支持的港区 (opens new window)
manifestSendingTime string 舱单发送时间 (部分港区支持,具体见支持的港区 (opens new window)) )
customsInspection string 海关查验
ataPol string 实际到港时间 (目前只支持天津港,其他港区需调用船计划接口获取)
atd string 实际离港时间 (目前只支持天津港,其他港区需调用船计划接口获取)
importAndExport string 箱子进出口标志
customsArea string 关区 (部分港区支持,具体见支持的港区 (opens new window)
messageType string 报文类型 (部分港区支持,具体见支持的港区 (opens new window)
receiptContent string 回执内容 (部分港区支持,具体见支持的港区 (opens new window)
carNumber string 拖车号
freezerSign string 冷冻箱标志 (部分港区支持,具体见支持的港区 (opens new window)
freezingTemperature string 冷冻温度 (部分港区支持,具体见支持的港区 (opens new window)
ventilation string 通风 (部分港区支持,具体见支持的港区 (opens new window)
heightExceed string 超高 (部分港区支持,具体见支持的港区 (opens new window)
unNumber string 危险品/联合国编号 (部分港区支持,具体见支持的港区 (opens new window)
overrunCode string 超限代码 (部分港区支持,具体见支持的港区 (opens new window)
frontBackExceed string 前/后超长(CM) (部分港区支持,具体见支持的港区 (opens new window)
leftRightExceed string 左/右超宽(CM) (部分港区支持,具体见支持的港区 (opens new window)
declareInfoList Array 报关信息
subOrderNo string 分提单号
importAndExport string 进出口标识 , 建议优先取最外层的importAndExport
pieces string 件数
weight string 重量
volume string 体积
customsDeclarationNo string 报关单号
customsClearance string 海关放行
customsClearanceTime string 海放时间
operation string 船公司操作
detailsPlanList Array 集装箱改配计划集合
planType string 计划类型
operationProcess string 操作过程
acceptanceTime string 受理时间
scheduledStartTime string 计划开始时间
scheduledEndTime string 计划结束时间
status string 状态

# 8. 响应示例

# 8.1 订阅成功响应示例

{
    "success": true,
    "code": 200,
    "message": "请求成功",
    "data": [
        {           
            "subType": 1,
        		"carrierCd": "CNTAO",
        		"subNo": "225201002" ,
         		"importAndExportFlag": "E",
					  "resultData": null,          
            "resultCode": 1,
            "resultMessage": "订阅成功",
            "extraInfo": {             
                "isExport": "E"
            }
        }
    ]
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# 8.2 未查询到结果响应示例

{
    "success": true,
    "code": 200,
    "message": "请求成功",
    "data": [
        {					
					  "subType": 1,
        		"carrierCd": "CNTAO",
        		"subNo": "225201002" ,
         		"importAndExportFlag": "E",  
            "resultData": null,            
            "resultCode": 3,           
            "resultMessage": "暂未查询到结果/官网查询无数据",
            "extraInfo": {               
                "isExport": "E"
            }
        }
    ]
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# 8.3 查询到结果响应示例

{
    "success": true,
    "code": 200,
    "message": "请求成功",
    "data": [
        {
            "importAndExportFlag": "E",
            "resultData": {
                "dtp": "",
                "terminalCd": "",
                "voy": "307S",
                "importAndExport": "E",
                "blNo": "",
                "bkgNo": "",
                "terminal": "QQCT码头",
                "pol": "",
                "containerInfoList": [
                    {
                        "blNo": "",
                        "containerHolder": "MKL",
                        "freezingTemperature": "",
                        "containerVolume": "",
                        "atd": null,
                        "transshipmentPort": "",
                        "importVessel": "",
                        "messageType": "",
                        "unloadTime": null,
                        "terminalClearance": "是",
                        "shipToFlag": "",
                        "importVoyage": "",
                        "loadShipTime": "2023-02-25 18:40:00",
                        "configurationLoadFlag": "Y",
                        "maritimeAffairs": "",
                        "triplicate": "",
                        "frontBackExceed": "",
                        "dischargePort": "KRPUS",
                        "terminalClearanceTime": null,
                        "carNumber": "",
                        "vgmShip": "",
                        "freezerSign": "N",
                        "size": "40",
                        "vslNameEn": "SAN FELIX",
                        "approachTime": "2023-02-24 05:15:00",
                        "emptyOrFull": "F",
                        "vslNameZh": "圣菲利克斯",
                        "customsArea": "4258",
                        "customsClearanceFlag": "Y",
                        "containerNo": "MMAU1429062",
                        "importAndExport": "外贸",
                        "vgmWharfWeighing": "",
                        "manifestSendingTime": null,
                        "ventilation": "",
                        "ataPol": null,
                        "containerWeight": "32300",
                        "receiptContent": "",
                        "approachMode": "闸口收箱",
                        "appearanceTime": "2023-02-25 18:40:00",
                        "arrivalMessageReceivingTime": "2023-02-24 12:20:03",
                        "externalManagement": "15301 理货报告传输成功,比对结果为:理货正常。",
                        "storageDays": "2",
                        "unNumber": "",
                        "customsClearance": "放行",
                        "declareInfoList": [
                            {
                                "pieces": "105",
                                "volume": "",
                                "subOrderNo": "225201002",
                                "importAndExport": "",
                                "customsClearance": "放行",
                                "customsDeclarationNo": "422720230000151453",
                                "weight": "108480.0",
                                "customsClearanceTime": "2023-02-26 06:55:00",
                                "operation": ""
                            }
                        ],
                        "appearanceMode": "装船",
                        "heightExceed": "",
                        "terminalClearanceFlag": "Y",
                        "voy": "307S",
                        "customsInspection": "不扣押",
                        "overrunCode": "",
                        "importVesselName": "",
                        "statusDesc": "",
                        "sealNo": "M/CN1926849",
                        "nationalInspection": "",
                        "containerType": "RH",
                        "manifest": "",
                        "customsClearanceTime": "2023-02-26 06:55:00",
                        "leftRightExceed": "",
                        "vgmFlag": "",
                        "detailsPlanList": [],
                        "containerPieces": "105.000",
                        "boxPosition": "",
                        "arrivalMessageSendingTime": "2023-02-24 12:12:38",
                        "configurationLoad": "放行",
                        "loadingPort": "",
                        "vgmMessageReceiving": null,
                        "emptyOrFullFlag": "F",
                        "tareWeight": "",
                        "shipTo": ""
                    },
                    {
                        "blNo": "",
                        "containerHolder": "MKL",
                        "freezingTemperature": "",
                        "containerVolume": "",
                        "atd": null,
                        "transshipmentPort": "",
                        "importVessel": "",
                        "messageType": "",
                        "unloadTime": null,
                        "terminalClearance": "是",
                        "shipToFlag": "",
                        "importVoyage": "",
                        "loadShipTime": "2023-02-26 02:55:00",
                        "configurationLoadFlag": "Y",
                        "maritimeAffairs": "",
                        "triplicate": "",
                        "frontBackExceed": "",
                        "dischargePort": "KRPUS",
                        "terminalClearanceTime": null,
                        "carNumber": "",
                        "vgmShip": "",
                        "freezerSign": "N",
                        "size": "40",
                        "vslNameEn": "SAN FELIX",
                        "approachTime": "2023-02-24 13:04:00",
                        "emptyOrFull": "F",
                        "vslNameZh": "圣菲利克斯",
                        "customsArea": "4258",
                        "customsClearanceFlag": "Y",
                        "containerNo": "MMAU1429993",
                        "importAndExport": "外贸",
                        "vgmWharfWeighing": "",
                        "manifestSendingTime": null,
                        "ventilation": "",
                        "ataPol": null,
                        "containerWeight": "32300",
                        "receiptContent": "",
                        "approachMode": "闸口收箱",
                        "appearanceTime": "2023-02-26 02:55:00",
                        "arrivalMessageReceivingTime": "2023-02-24 13:09:53",
                        "externalManagement": "15301 理货报告传输成功,比对结果为:理货正常。",
                        "storageDays": "3",
                        "unNumber": "",
                        "customsClearance": "放行",
                        "declareInfoList": [
                            {
                                "pieces": "105",
                                "volume": "",
                                "subOrderNo": "225201002",
                                "importAndExport": "",
                                "customsClearance": "放行",
                                "customsDeclarationNo": "422720230000151453",
                                "weight": "108480.0",
                                "customsClearanceTime": "2023-02-26 06:55:00",
                                "operation": ""
                            }
                        ],
                        "appearanceMode": "装船",
                        "heightExceed": "",
                        "terminalClearanceFlag": "Y",
                        "voy": "307S",
                        "customsInspection": "不扣押",
                        "overrunCode": "",
                        "importVesselName": "",
                        "statusDesc": "",
                        "sealNo": "M/CN1726286",
                        "nationalInspection": "",
                        "containerType": "RH",
                        "manifest": "",
                        "customsClearanceTime": "2023-02-26 06:55:00",
                        "leftRightExceed": "",
                        "vgmFlag": "",
                        "detailsPlanList": [],
                        "containerPieces": "105.000",
                        "boxPosition": "",
                        "arrivalMessageSendingTime": "2023-02-24 13:04:44",
                        "configurationLoad": "放行",
                        "loadingPort": "",
                        "vgmMessageReceiving": null,
                        "emptyOrFullFlag": "F",
                        "tareWeight": "",
                        "shipTo": ""
                    },
                    {
                        "blNo": "",
                        "containerHolder": "MKL",
                        "freezingTemperature": "",
                        "containerVolume": "",
                        "atd": null,
                        "transshipmentPort": "",
                        "importVessel": "",
                        "messageType": "",
                        "unloadTime": null,
                        "terminalClearance": "是",
                        "shipToFlag": "Y",
                        "importVoyage": "",
                        "loadShipTime": "2023-02-26 03:22:00",
                        "configurationLoadFlag": "Y",
                        "maritimeAffairs": "",
                        "triplicate": "",
                        "frontBackExceed": "",
                        "dischargePort": "KRPUS",
                        "terminalClearanceTime": null,
                        "carNumber": "",
                        "vgmShip": "",
                        "freezerSign": "N",
                        "size": "40",
                        "vslNameEn": "SAN FELIX",
                        "approachTime": "2023-02-25 14:00:00",
                        "emptyOrFull": "F",
                        "vslNameZh": "圣菲利克斯",
                        "customsArea": "4258",
                        "customsClearanceFlag": "Y",
                        "containerNo": "MMAU1430295",
                        "importAndExport": "外贸",
                        "vgmWharfWeighing": "",
                        "manifestSendingTime": null,
                        "ventilation": "",
                        "ataPol": null,
                        "containerWeight": "28150",
                        "receiptContent": "",
                        "approachMode": "闸口收箱",
                        "appearanceTime": "2023-02-26 03:22:00",
                        "arrivalMessageReceivingTime": "2023-02-25 14:08:24",
                        "externalManagement": "15301 理货报告传输成功,比对结果为:理货正常。",
                        "storageDays": "2",
                        "unNumber": "",
                        "customsClearance": "放行",
                        "declareInfoList": [
                            {
                                "pieces": "105",
                                "volume": "",
                                "subOrderNo": "225201002",
                                "importAndExport": "",
                                "customsClearance": "放行",
                                "customsDeclarationNo": "422720230000151453",
                                "weight": "108480.0",
                                "customsClearanceTime": "2023-02-26 06:55:00",
                                "operation": ""
                            }
                        ],
                        "appearanceMode": "装船",
                        "heightExceed": "",
                        "terminalClearanceFlag": "Y",
                        "voy": "307S",
                        "customsInspection": "不扣押",
                        "overrunCode": "",
                        "importVesselName": "",
                        "statusDesc": "",
                        "sealNo": "M/CN1723539",
                        "nationalInspection": "",
                        "containerType": "RH",
                        "manifest": "",
                        "customsClearanceTime": "2023-02-26 06:55:00",
                        "leftRightExceed": "",
                        "vgmFlag": "",
                        "detailsPlanList": [],
                        "containerPieces": "105.000",
                        "boxPosition": "",
                        "arrivalMessageSendingTime": "2023-02-25 14:00:49",
                        "configurationLoad": "放行",
                        "loadingPort": "",
                        "vgmMessageReceiving": null,
                        "emptyOrFullFlag": "F",
                        "tareWeight": "",
                        "shipTo": "Y"
                    },
                    {
                        "blNo": "",
                        "containerHolder": "MKL",
                        "freezingTemperature": "",
                        "containerVolume": "",
                        "atd": null,
                        "transshipmentPort": "",
                        "importVessel": "",
                        "messageType": "",
                        "unloadTime": null,
                        "terminalClearance": "是",
                        "shipToFlag": "",
                        "importVoyage": "",
                        "loadShipTime": "2023-02-25 23:47:00",
                        "configurationLoadFlag": "Y",
                        "maritimeAffairs": "",
                        "triplicate": "",
                        "frontBackExceed": "",
                        "dischargePort": "KRPUS",
                        "terminalClearanceTime": null,
                        "carNumber": "",
                        "vgmShip": "",
                        "freezerSign": "N",
                        "size": "40",
                        "vslNameEn": "SAN FELIX",
                        "approachTime": "2023-02-24 13:21:00",
                        "emptyOrFull": "F",
                        "vslNameZh": "圣菲利克斯",
                        "customsArea": "4258",
                        "customsClearanceFlag": "Y",
                        "containerNo": "MMAU1430470",
                        "importAndExport": "外贸",
                        "vgmWharfWeighing": "",
                        "manifestSendingTime": null,
                        "ventilation": "",
                        "ataPol": null,
                        "containerWeight": "32300",
                        "receiptContent": "",
                        "approachMode": "闸口收箱",
                        "appearanceTime": "2023-02-25 23:47:00",
                        "arrivalMessageReceivingTime": "2023-02-24 13:29:58",
                        "externalManagement": "15301 理货报告传输成功,比对结果为:理货正常。",
                        "storageDays": "2",
                        "unNumber": "",
                        "customsClearance": "放行",
                        "declareInfoList": [
                            {
                                "pieces": "105",
                                "volume": "",
                                "subOrderNo": "225201002",
                                "importAndExport": "",
                                "customsClearance": "放行",
                                "customsDeclarationNo": "422720230000151453",
                                "weight": "108480.0",
                                "customsClearanceTime": "2023-02-26 06:55:00",
                                "operation": ""
                            }
                        ],
                        "appearanceMode": "装船",
                        "heightExceed": "",
                        "terminalClearanceFlag": "Y",
                        "voy": "307S",
                        "customsInspection": "不扣押",
                        "overrunCode": "",
                        "importVesselName": "",
                        "statusDesc": "",
                        "sealNo": "M/CN1726264",
                        "nationalInspection": "",
                        "containerType": "RH",
                        "manifest": "",
                        "customsClearanceTime": "2023-02-26 06:55:00",
                        "leftRightExceed": "",
                        "vgmFlag": "",
                        "detailsPlanList": [],
                        "containerPieces": "105.000",
                        "boxPosition": "",
                        "arrivalMessageSendingTime": "2023-02-24 13:21:23",
                        "configurationLoad": "放行",
                        "loadingPort": "",
                        "vgmMessageReceiving": null,
                        "emptyOrFullFlag": "F",
                        "tareWeight": "",
                        "shipTo": ""
                    }
                ],
                "dischargePort": "KRPUS",
                "polCd": "",
                "transshipmentPort": "",
                "carrier": "",
                "vslNameEn": "SAN FELIX",
                "dtpCd": "",
                "isCompleted": "Y",
                "vslNameZh": "圣菲利克斯"
            },
            "carrierCd": "CNTAO",
            "resultCode": 2,
            "subNo": "225201002",
            "subType": 1,
            "resultMessage": "查询成功",
            "extraInfo": {
                "isExport": "E"
            }
        }
    ]
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
最近更新时间: { "value": "2023-07-21", "effect": true }