自動填充海關申報
按照以下步驟啟用使用您平台的聲明 ID 的自動海關申報填充。
1. 在標籤建立流程中啟用聲明 ID 欄位
將聲明 ID 欄位新增到您的郵政標籤建立介面。當用戶輸入有效的聲明 ID 時,您的平台可以自動填充海關申報,消除手動數據輸入。
2. 查詢聲明 ID 狀態和海關申報詳情
使用以下查詢來使用聲明 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 資訊來判斷聲明 ID 是否有效,然後自動填充可用的海關數據或提示手動輸入。
範例回應
有效的聲明 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. 建立送貨
使用來自聲明 ID 的自動填充數據或手動輸入的申報資訊處理標籤建立。
5. 將追蹤號碼連結到聲明 ID
建立標籤後,使用 declarationShipmentCreate 變更來連結追蹤號碼與聲明 ID,確保適當的稅費付款驗證和送貨追蹤。
1
mutation DeclarationShipmentCreate($input: DeclarationShipmentCreateInput!) {2
declarationShipmentCreate(input: $input)3
}您可以透過傳遞 trackingNumbers 陣列和用於送貨的 declarationID 來建立與聲明 ID 相關的送貨。
您亦可以透過傳遞 declarationID 以及有關紙箱的詳情,以及紙箱內的項目,您可以在 shipmentCarton 中傳遞這些內容,以及該紙箱的 trackingNumber,來建立送貨。
GraphQL API ReferenceTypes, inputs, and operations used in this guide
MUTATIONS
送貨標籤 | 驗證聲明 ID
檢索聲明 ID 的狀態並自動填充海關文件
如果您建立郵政標籤,您可以致電 Zonos 來檢索完整的海關申報詳情,當用戶提供聲明 ID 時。這消除了用戶手動填寫海關文件的需要,建立了一個無縫的運送體驗,其中稅費已預付,海關表格會自動填充。