自动填充海关申报
按照以下步骤启用使用来自您平台的Declaration ID的自动海关申报填充。
1. 在标签创建流程中启用Declaration ID字段
在您的邮政标签创建界面中添加Declaration ID字段。当用户输入有效的Declaration ID时,您的平台可以自动填充海关申报,消除手动数据输入。
2. 查询Declaration ID状态和海关申报详细信息
使用以下查询来检索使用Declaration ID的完整海关申报数据。这在可用时返回验证状态以及项目详细信息、值、HS代码和收件人信息
1
query DeclarationQuery($id: ID!) {2
declaration(id: $id) {3
id4
status5
paymentStatus6
landedCost {7
id8
method9
landedCostGuaranteeCode10
amountSubtotals {11
duties12
taxes13
fees14
landedCostTotal15
}16
}17
items {18
id19
sku20
productId21
amount22
currencyCode23
name24
hsCode25
description26
hsCodeSource27
countryOfOrigin28
quantity29
measurements {30
type31
value32
unitOfMeasure33
}34
}35
parties {36
id37
type38
person {39
firstName40
lastName41
email42
phone43
}44
location {45
id46
line147
line248
countryCode49
postalCode50
}51
}52
}53
}3. 处理响应并自动填充海关申报
API响应包括验证状态和海关数据。使用status信息来确定Declaration ID是否有效,然后自动填充可用的海关数据或提示手动输入。
示例响应
具有完整海关数据的有效Declaration ID:
{
"data": {
"declaration": {
"id": "0mm1993s0mdcn",
"status": "OPEN",
"paymentStatus": "OPEN",
"landedCost": {
"id": "landed_cost_eabb13ab-df23-45df-9ce8-96dd29d396d1",
"method": "DAP",
"landedCostGuaranteeCode": "NOT_APPLICABLE",
"amountSubtotals": {
"duties": 0.0,
"taxes": 0.0,
"fees": 2.62,
"landedCostTotal": 2.62
}
},
"items": [
{
"id": "item_0mm199388v57g",
"sku": "item_1",
"productId": "item_1",
"amount": 70.0,
"currencyCode": "USD",
"name": "Item 1",
"hsCode": "9504.90.4000",
"description": "This is the description for Item 1",
"hsCodeSource": "TARIFF_COMPLETED",
"countryOfOrigin": "CN",
"quantity": 2,
"measurements": [
{
"type": "WEIGHT",
"value": 1,
"unitOfMeasure": "POUND"
}
]
}
],
"parties": [
{
"id": "party_0kesb32rw5hfa",
"type": "DESTINATION",
"person": {
"firstName": "test",
"lastName": "origin",
"email": null,
"phone": "1234567890"
},
"location": {
"id": "location_c7882546-652e-49cb-81a4-98962a54c49f",
"line1": "123 Test Street",
"line2": "",
"countryCode": "US",
"postalCode": "84790"
}
},
{
"id": "party_0mjfz59bgg175",
"type": "ORIGIN",
"person": {
"firstName": "test",
"lastName": "destination",
"email": null,
"phone": "1234567890"
},
"location": {
"id": "location_0mdzb9vk8bp7c",
"line1": "998 Ridgehaven",
"line2": null,
"countryCode": "CA",
"postalCode": "N0N 0N0"
}
}
]
}
}
}
4. 创建运货单
使用来自Declaration ID的自动填充数据或手动输入的声明信息来处理标签创建。
5. 将追踪号码链接到Declaration ID
创建标签后,使用declarationShipmentCreate mutation将追踪号码与Declaration ID链接,确保正确的税费支付验证和运货单追踪。
1
mutation DeclarationShipmentCreate($input: DeclarationShipmentCreateInput!) {2
declarationShipmentCreate(input: $input)3
}您可以通过传递trackingNumbers数组和用于运货单的declarationID来创建与Declaration ID相关的运货单。
您也可以通过传递declarationID以及有关纸箱的详细信息和纸箱内的项目来创建运货单,您可以将这些信息传递到shipmentCarton中以及该纸箱的trackingNumber。
GraphQL API ReferenceTypes, inputs, and operations used in this guide
MUTATIONS
运输标签 | 验证Declaration ID
检索Declaration ID的状态并自动填充海关文件
如果您创建邮政标签,当用户提供Declaration ID时,您可以调用Zonos来检索完整的海关申报详细信息。这消除了用户手动填写海关文件的需要,创建一个无缝的运输体验,其中关税已预付,海关表格自动填充。