DOCS

Create customs documentation graphql

/

Opret tolddokumentation

Generer tolddokumenter.

GraphQL

Hvis du har beregnet en landed cost og ønsker at oprette en customsSpec, der vil være knyttet til tilbuddet og den efterfølgende shipment, skal du følge disse trin nedenfor.

1

Opret en forsendelse

For at oprette en customsSpec skal du først oprette en shipment.

Mutation

1
2
3
4
5
6
7
8
9
10
11
12
13
mutation CreateShipment($createShipment: ShipmentCreateInput!) {
  shipmentCreate(input: $createShipment) {
    id
    customSpec {
      id
    }
    shipmentCartons {
      carton {
        id
      }
    }
  }
}

Variabler

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "createShipment": {
    "orderId": "order_3a369733-3046-4390-b0a4-99a2f8a1c2a2",
    "trackingNumber": "12345",
    "generateCustoms": true,
    "parties": [
      "party_2fdf56a0-2bb2-4443-b8ca-a984d335ff3g",
      "party_5c928cde-67fa-4ee4-b77a-2628fbcd5ac9"
    ],
    "serviceLevel": "custom.custom",
    "shipmentCartons": [
      {
        "height": 10,
        "length": 10,
        "width": 10,
        "weight": 1,
        "items": ["item_8a0ecee9-42ff-4544-9610-8e8d679ef0a3"]
      }
    ]
  }
}

Svar

1
2
3
4
5
6
7
8
9
10
{
  "data": {
    "shipmentCreate": {
      "id": "shipment_a125e480-369c-4606-abf8-ff34295b15cb",
      "customSpec": {
        "id": "customsSpec_a19875ec-b85c-11ed-afa1-0242ac120002"
      }
    }
  }
}
2

Hent toldoplysninger

Når customsSpec er blevet genereret, kan du bruge følgende forespørgsel til at hente detaljerne.

Forespørgsel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
query CustomsSpec($id: ID!) {
  customsSpec(id: $id) {
    id
    deliveryDutyPaid
    declarationStatement
    amountSubtotals {
      duties
      fees
      insurance
      shipping
    }
    customsItems {
      items {
        id
      }
    }
  }
}

Variabler

1
2
3
{
  "id": "customsSpec_a19875ec-b85c-11ed-afa1-0242ac120002"
}

Svar

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  "data": {
    "customsSpec": {
      "id": "customsSpec_66b544c9-439f-4a82-b5bb-1a00274e8a61",
      "declarationStatement": "I declare this is a declaration statement",
      "amountSubtotals": {
        "duties": 10.0,
        "fees": 5.0,
        "insurance": 10.0,
        "shipping": 15.99
      },
      "customsItems": [
        {
          "items": [
            {
              "id": "test_item_123"
            }
          ]
        }
      ]
    }
  }
}

Var denne side nyttig?