{"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这个页面有帮助吗?