{"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這個頁面有幫助嗎?