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 voloManifestLineInput: dettagli della singola spedizione collegati a un manifestoManifestLineItemInput: informazioni sul prodotto per la classificazione doganaleCreatePartyInput: 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
mutation ManifestCreate($input: ManifestInput!) { manifestCreate(input: $input) { id amount arrivalDate awbNumber awbPrefix carrierCode createdAt createdBy destinationCode operatorDestination operatorOrigin originCode postalOperatorCode serviceNumber source transportationMode updatedAt updatedBy weight weightUnit statusTransitions { createdAt createdBy note source } lines(first: 5) { totalCount edges { cursor node { id trackingNumber endUse currencyCode createdAt createdBy updatedAt updatedBy landedCost { id } } } } }}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.
mutation ManifestLineCreate($manifestId: ID!, $input: ManifestLineInput!) { manifestLineCreate(manifestId: $manifestId, input: $input) { id manifestId trackingNumber endUse currencyCode referenceNumber arrivalDate createdAt createdBy updatedAt updatedBy landedCost { id } }}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.
mutation ManifestLinesCreate($manifestId: ID!, $input: [ManifestLineInput!]!) { manifestLinesCreate(manifestId: $manifestId, input: $input) { id manifestId trackingNumber endUse currencyCode createdAt }}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.
mutation ManifestUpdate($id: ID!, $input: ManifestUpdateInput!) { manifestUpdate(id: $id, input: $input) { id amount arrivalDate awbNumber awbPrefix carrierCode createdAt createdBy destinationCode operatorDestination operatorOrigin originCode postalOperatorCode serviceNumber source transportationMode updatedAt updatedBy weight weightUnit statusTransitions { createdAt createdBy note source } }}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:
| Valore↕ | Descrizione↕ |
|---|---|
CARDIT | Scambio dati del vettore |
PRECON | Avviso di pre-consegna |
PREDES | Avviso di pre-spedizione |
RESDIT | Risposta alla spedizione |
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.