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派遣回應
預約演示

這個頁面有幫助嗎?