DOCS

准备海关清单

为美国货物准备海关清单。

向 Zonos 提供入站邮政货物数据。

Zonos 将准备全面的海关清单,其中包括所有必要信息,用于邮政货物入境美国。

准备请求 

创建清单需要将货物数据组织成适当的结构。该 API 使用分层方法,首先创建清单,然后添加包含单个货物详细信息的清单行。

每个组件都有特定的必需字段,以确保海关合规性和准确的文档记录。下面我们列出了基本数据结构和必需的输入。

关键输入类型

清单 API 使用几种输入类型来组织货物数据:

  • ManifestInput:高级别的货物信息,包括机场、运单类型和飞行详情
  • ManifestLineInput:与清单关联的单个货物详细信息
  • ManifestLineItemInput:用于海关分类的产品信息
  • CreatePartyInput:原产地和目的地的当事人和位置详情

在我们的 GraphQL API 参考 中查看完整的字段定义和选项。

通过 API 创建清单 

整理好货物数据后,发送 GraphQL 变更来创建清单。

步骤 1:创建清单标题

1mutation ManifestCreate($input: ManifestInput!) {
2 manifestCreate(input: $input) {
3 id
4 amount
5 arrivalDate
6 awbNumber
7 awbPrefix
8 carrierCode
9 createdAt
10 createdBy
11 destinationCode
12 operatorDestination
13 operatorOrigin
14 originCode
15 postalOperatorCode
16 serviceNumber
17 source
18 transportationMode
19 updatedAt
20 updatedBy
21 weight
22 weightUnit
23 statusTransitions {
24 createdAt
25 createdBy
26 note
27 source
28 }
29 lines(first: 5) {
30 totalCount
31 edges {
32 cursor
33 node {
34 id
35 trackingNumber
36 endUse
37 currencyCode
38 createdAt
39 createdBy
40 updatedAt
41 updatedBy
42 landedCost {
43 id
44 }
45 }
46 }
47 }
48 }
49}

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,现在可以将单个货物链接到清单。

1mutation ManifestLineCreate($manifestId: ID!, $input: ManifestLineInput!) {
2 manifestLineCreate(manifestId: $manifestId, input: $input) {
3 id
4 manifestId
5 trackingNumber
6 endUse
7 currencyCode
8 referenceNumber
9 arrivalDate
10 createdAt
11 createdBy
12 updatedAt
13 updatedBy
14 landedCost {
15 id
16 }
17 }
18}

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 数组来定义货物的原产地和目的地。

1mutation ManifestLinesCreate($manifestId: ID!, $input: [ManifestLineInput!]!) {
2 manifestLinesCreate(manifestId: $manifestId, input: $input) {
3 id
4 manifestId
5 trackingNumber
6 endUse
7 currencyCode
8 createdAt
9 }
10}

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 字段是必需的,表示更新的数据源。

1mutation ManifestUpdate($id: ID!, $input: ManifestUpdateInput!) {
2 manifestUpdate(id: $id, input: $input) {
3 id
4 amount
5 arrivalDate
6 awbNumber
7 awbPrefix
8 carrierCode
9 createdAt
10 createdBy
11 destinationCode
12 operatorDestination
13 operatorOrigin
14 originCode
15 postalOperatorCode
16 serviceNumber
17 source
18 transportationMode
19 updatedAt
20 updatedBy
21 weight
22 weightUnit
23 statusTransitions {
24 createdAt
25 createdBy
26 note
27 source
28 }
29 }
30}

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 字段接受以下值:

描述
CARDIT承运人数据交换
PRECON交运前通知
PREDES发运前通知
RESDIT发运响应
预约演示

这个页面有帮助吗?