DOCS

Preparare il manifesto doganale

Preparare un manifesto doganale per le spedizioni negli Stati Uniti.

Fornire Zonos con i dati della spedizione postale in entrata.

Zonos preparerà manifesti doganali completi che includono tutte le informazioni necessarie per le spedizioni postali negli Stati Uniti.

Prepara la richiesta 

La creazione di un manifesto richiede l'organizzazione dei dati di spedizione nella struttura corretta. L'API utilizza un approccio gerarchico in cui prima crei il manifesto, quindi aggiungi le righe del manifesto contenenti i dettagli della singola spedizione.

Ogni componente ha campi obbligatori specifici per garantire la conformità doganale e una documentazione accurata. Di seguito abbiamo delineato la struttura dei dati essenziali e gli input richiesti.

Tipi di input chiave

L'API del manifesto utilizza diversi tipi di input per organizzare i dati della spedizione:

  • ManifestInput: informazioni di alto livello sulla spedizione, inclusi aeroporti, tipo di lettera di vettura e dettagli del volo
  • ManifestLineInput: dettagli della singola spedizione collegati a un manifesto
  • ManifestLineItemInput: informazioni sul prodotto per la classificazione doganale
  • CreatePartyInput: dettagli sulla parte e sull'ubicazione per origine e destinazione

Visualizza le definizioni e le opzioni complete dei campi nel nostro GraphQL API riferimento.

Crea un manifesto tramite API 

Una volta organizzati i dati della spedizione, invia la mutazione GraphQL per creare il manifesto.

Passaggio 1: crea l'intestazione del manifesto

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}

RISPOSTA

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": []
      }
    }
  }
}

Passaggio 2: aggiungi le righe del manifesto

Utilizzando l'ID restituito dalla mutazione manifestCreate, ora puoi collegare le singole spedizioni al manifesto.

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}

RISPOSTA

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
    }
  }
}

Passaggio 3: aggiungi più righe del manifesto (in batch)

Per efficienza, puoi aggiungere più righe del manifesto in un'unica richiesta utilizzando la mutazione manifestLinesCreate. Ogni riga richiede il proprio array parties per definire l'origine e la destinazione della spedizione.

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}

RISPOSTA

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"
      }
    ]
  }
}

Passaggio 4: aggiorna il manifesto

Nel caso in cui i dettagli del volo siano cambiati, puoi aggiornare i dettagli del manifesto utilizzando la seguente mutazione. Il campo source è obbligatorio e indica l'origine dei dati per l'aggiornamento.

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}

RISPOSTA

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"
        }
      ]
    }
  }
}

Valori dell'origine dati

Il campo source in ManifestUpdateInput accetta i seguenti valori:

ValoreDescrizione
CARDITScambio dati del vettore
PRECONAvviso di pre-consegna
PREDESAvviso di pre-spedizione
RESDITRisposta alla spedizione

Questa pagina è stata utile?