{"data":{"manifestUpdate":{"id":"manifest_abc123def456","amount":"150.50","arrivalDate":"2026-03-16T10:00:00.000Z","awbNumber":"5678","awbPrefix":"001","carrierCode":"BA","createdAt":"2026-01-06T12:00:00.000Z","createdBy":"organization_xyz789","destinationCode":"JFK","operatorDestination":"US","originCode":"LHR","postalOperatorCode":"J1CGBA","serviceNumber":"5678","source":"RESDIT","transportationMode":"AIR","updatedAt":"2026-01-06T14:30:00.000Z","updatedBy":"organization_xyz789","weight":"25.5","weightUnit":"KILOGRAM","statusTransitions":[{"createdAt":"2026-01-06T14:30:00.000Z","createdBy":"organization_xyz789","note":"Flight rescheduled due to weather","source":"RESDIT"}]}}}
準備海關申報單
為美國出貨準備海關申報單。
向 Zonos 提供進口郵寄貨物資料。Zonos 將準備包含郵寄貨物進入美國所需所有資訊的完整海關申報單。
準備請求
建立申報單需要將貨物資料組織成適當的結構。API 採用分層方法,首先建立申報單,然後新增包含個別貨物詳細資訊的申報單行。
每個元件都有特定的必填欄位,以確保海關合規性和準確的文件記錄。以下我們列出了基本資料結構和必填輸入。
關鍵輸入類型
申報單 API 使用多種輸入類型來組織貨物資料:
ManifestInput:高層級貨物資訊,包括機場、運單類型和飛行詳細資訊ManifestLineInput:連結至申報單的個別貨物詳細資訊ManifestLineItemInput:海關分類用的產品資訊CreatePartyInput:原產地和目的地的交易方和位置詳細資訊檢視我們 GraphQL API 參考資料 中的完整欄位定義和選項。
透過 API 建立申報單
一旦您已組織好貨物資料,就可以傳送 GraphQL 變更以建立申報單。
步驟 1:建立申報單標題
mutation ManifestCreate($input: ManifestInput!) {manifestCreate(input: $input) {idamountarrivalDateawbNumberawbPrefixcarrierCodecreatedAtcreatedBydestinationCodeoperatorDestinationoperatorOriginoriginCodepostalOperatorCodeserviceNumbersourcetransportationModeupdatedAtupdatedByweightweightUnitstatusTransitions {createdAtcreatedBynotesource}lines(first: 5) {totalCountedges {cursornode {idtrackingNumberendUsecurrencyCodecreatedAtcreatedByupdatedAtupdatedBylandedCost {id}}}}}}RESPONSE
json
{ "data": { "manifestCreate": { "id": "manifest_abc123def456", "amount": "0", "arrivalDate": "2026-03-15T14:30:00.000Z", "awbNumber": "1234", "awbPrefix": "001", "carrierCode": "AA", "createdAt": "2026-01-06T12:00:00.000Z", "createdBy": "organization_xyz789", "destinationCode": "JFK", "operatorDestination": "US", "originCode": "LHR", "postalOperatorCode": "J1CGBA", "serviceNumber": "1234", "source": "API", "transportationMode": "AIR", "updatedAt": "2026-01-06T12:00:00.000Z", "updatedBy": "organization_xyz789", "weight": "0", "weightUnit": "KILOGRAM", "statusTransitions": [], "lines": { "totalCount": 0, "edges": [] } } } }步驟 2:新增申報單行
使用從
manifestCreate變更傳回的 ID,現在可以將個別貨物連結至申報單。mutation ManifestLineCreate($manifestId: ID!, $input: ManifestLineInput!) {manifestLineCreate(manifestId: $manifestId, input: $input) {idmanifestIdtrackingNumberendUsecurrencyCodereferenceNumberarrivalDatecreatedAtcreatedByupdatedAtupdatedBylandedCost {id}}}RESPONSE
json
{ "data": { "manifestLineCreate": { "id": "manifest_line_def456ghi789", "manifestId": "manifest_abc123def456", "trackingNumber": "LX123456789GB", "endUse": "NOT_FOR_RESALE", "currencyCode": "USD", "referenceNumber": "ORDER-2026-001", "arrivalDate": "2026-03-15T14:30:00.000Z", "createdAt": "2026-01-06T12:05:00.000Z", "createdBy": "organization_xyz789", "updatedAt": "2026-01-06T12:05:00.000Z", "updatedBy": "organization_xyz789", "landedCost": null } } }步驟 3:批量新增多個申報單行
為了提高效率,您可以使用
manifestLinesCreate變更在單一請求中新增多個申報單行。每一行都需要其自己的parties陣列來定義貨物的原產地和目的地。mutation ManifestLinesCreate($manifestId: ID!, $input: [ManifestLineInput!]!) {manifestLinesCreate(manifestId: $manifestId, input: $input) {idmanifestIdtrackingNumberendUsecurrencyCodecreatedAt}}RESPONSE
json
{ "data": { "manifestLinesCreate": [ { "id": "manifest_line_aaa111bbb222", "manifestId": "manifest_abc123def456", "trackingNumber": "LX123456789GB", "endUse": "NOT_FOR_RESALE", "currencyCode": "USD", "createdAt": "2026-01-06T12:10:00.000Z" }, { "id": "manifest_line_ccc333ddd444", "manifestId": "manifest_abc123def456", "trackingNumber": "LX987654321GB", "endUse": "GIFT", "currencyCode": "USD", "createdAt": "2026-01-06T12:10:00.000Z" } ] } }步驟 4:更新申報單
如果飛行詳細資訊已變更,您可以使用下列變更來更新申報單詳細資訊。
source欄位為必填,並指示更新的資料來源。mutation ManifestUpdate($id: ID!, $input: ManifestUpdateInput!) {manifestUpdate(id: $id, input: $input) {idamountarrivalDateawbNumberawbPrefixcarrierCodecreatedAtcreatedBydestinationCodeoperatorDestinationoperatorOriginoriginCodepostalOperatorCodeserviceNumbersourcetransportationModeupdatedAtupdatedByweightweightUnitstatusTransitions {createdAtcreatedBynotesource}}}RESPONSE
json
{ "data": { "manifestUpdate": { "id": "manifest_abc123def456", "amount": "150.50", "arrivalDate": "2026-03-16T10:00:00.000Z", "awbNumber": "5678", "awbPrefix": "001", "carrierCode": "BA", "createdAt": "2026-01-06T12:00:00.000Z", "createdBy": "organization_xyz789", "destinationCode": "JFK", "operatorDestination": "US", "originCode": "LHR", "postalOperatorCode": "J1CGBA", "serviceNumber": "5678", "source": "RESDIT", "transportationMode": "AIR", "updatedAt": "2026-01-06T14:30:00.000Z", "updatedBy": "organization_xyz789", "weight": "25.5", "weightUnit": "KILOGRAM", "statusTransitions": [ { "createdAt": "2026-01-06T14:30:00.000Z", "createdBy": "organization_xyz789", "note": "Flight rescheduled due to weather", "source": "RESDIT" } ] } } }資料來源值
ManifestUpdateInput中的source欄位接受下列值:CARDITPRECONPREDESRESDIT這個頁面有幫助嗎?