DOCS

Retrieve order details

/

Haal bestelgegevens op

Haal uw bestelgegevens op met GraphQL.

Om details voor uw internationale bestellingen in het Zonos systeem op te halen, kunt u de GraphQL API raadplegen. Dit stelt u in staat om bestelgegevens en alle relevante informatie die aan een bestelling is gekoppeld, zoals verzendbeoordelingen, landed cost offertes, enz. op te halen.

1

Verkrijg uw API-sleutel

Registreer eerst voor een Zonos account en configureer uw account in Zonos Dashboard. U kunt dan uw API-sleutel verkrijgen, die u in staat stelt om te authenticeren met de Zonos API.

2

Beslis welke details u wilt ophalen

Vanwege de werking van GraphQL kunt u alleen de velden opvragen die u interessant vindt van de API, of u kunt ervoor kiezen om alle informatie die het systeem heeft met betrekking tot een bestelling op te vragen—de keuze is aan u. Raadpleeg de GraphQL API-referentie voor beschikbare velden.

Informatie die aan de bestelling is gekoppeld, zoals landed cost offertegegevens, verzendbeoordelingen, winkelwagentijdetails, enz. kan door het grafiek worden opgevraagd door velden van die objecten aan uw order query toe te voegen.

Minimaal heeft u een bestelnummer nodig om de API te kunnen raadplegen. Dit wordt doorgegeven in het orderId veld met de variabelen in uw GraphQL-verzoek.

Query

1
2
3
4
5
query order($orderId: String!) {
  order(orderId: $orderId) {
    # ... other field names here
  }
}

Variabelen

1
2
3
{
  "orderId": "order_88891908-5fd2-42fb-833f-b0afb11ea646"
}
3

Stuur uw verzoek

Nu u uw verzoek heeft opgebouwd en geconfigureerd, kunt u een POST verzoek naar de Zonos API sturen. Zorg ervoor dat u zich authenticeert met uw API-sleutel en de juiste versieheader in uw verzoek opneemt.

POST https://api.zonos.com/graphql/

Query

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
query order($orderId: String!) {
  order(orderId: $orderId) {
    accountOrderNumber
    amountSubtotals {
      duties
      taxes
      fees
      shipping
      items
    }
    landedCosts {
      id
      rootId
      tariffRate
      duties {
        amount
        currency
        formula
        item {
          id
          description
        }
        exchangeRate {
          rate
          sourceCurrencyCode
          targetCurrencyCode
        }
      }
      fees {
        amount
        currency
        description
        note
        formula
        type
        item {
          id
          description
        }
        exchangeRate {
          rate
        }
      }
      taxes {
        amount
        currency
        formula
        item {
          id
          description
        }
        exchangeRate {
          rate
        }
      }
      deMinimis {
        formula
        method
        note
        threshold
        type
      }
      shipmentRating {
        id
        amount
        currencyCode
        displayName
        minTransitAt
        maxTransitAt
        details {
          amount
          carrierCode
          type
        }
        amountSubtotals {
          shipping
          fuelSurcharge
          insuranceCost
          otherSurcharge
        }
        shipmentRatingCartons {
          chargeableWeight
          carton {
            length
            width
            height
            weight
          }
        }
        shippingProfile {
          id
          customServiceLevelCode
          landedCostMethod
          serviceLevel {
            code
          }
        }
      }
    }
  }
}

Variabelen

1
2
3
{
  "orderId": "order_88891908-5fd2-42fb-833f-b0afb11ea646"
}

Antwoord

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
{
  "data": {
    "order": {
      "accountOrderNumber": "10014067",
      "amountSubtotals": {
        "duties": 0,
        "taxes": 11.86,
        "fees": 7.49,
        "shipping": 37.79,
        "items": 229.99
      },
      "landedCosts": [
        {
          "id": "landed_cost_5d9ff0c2-059d-42c9-a1bc-3c9bbfaaca5b",
          "rootId": "root_df4d61f9-21cc-4b73-a466-a9794cc14963",
          "tariffRate": "ZONOS_PREFERRED",
          "duties": [
            {
              "amount": 0,
              "currency": "USD",
              "formula": "0 %",
              "item": {
                "id": "item_abfa8dc2-1ae2-4b23-82e3-0b100d0a73a9",
                "description": "Volvo & Mack Feeler Gauge & Jake Brake Tools 88880053 88880052 85111377"
              },
              "exchangeRate": null
            }
          ],
          "fees": [
            {
              "amount": 7.29,
              "currency": "USD",
              "description": "FedEx Canada Advancement Fee",
              "note": null,
              "formula": "2.500% of duties & taxes amount with a minimum of 10 cad, whichever is greater",
              "type": "advancement",
              "item": null,
              "exchangeRate": null
            },
            {
              "amount": 0.2,
              "currency": "USD",
              "description": "FedEx Currency Conversion Fee",
              "note": null,
              "formula": "1.75% of the amount converted",
              "type": "currency_conversion_fee",
              "item": null,
              "exchangeRate": null
            }
          ],
          "taxes": [
            {
              "amount": 11.4995,
              "currency": "USD",
              "formula": "5%",
              "item": {
                "id": "item_abfa8dc2-1ae2-4b23-82e3-0b100d0a73a9",
                "description": "Volvo & Mack Feeler Gauge & Jake Brake Tools 88880053 88880052 85111377"
              },
              "exchangeRate": null
            },
            {
              "amount": 0,
              "currency": "USD",
              "formula": "5%",
              "item": {
                "id": "item_abfa8dc2-1ae2-4b23-82e3-0b100d0a73a9",
                "description": "Volvo & Mack Feeler Gauge & Jake Brake Tools 88880053 88880052 85111377"
              },
              "exchangeRate": null
            },
            {
              "amount": 0.36,
              "currency": "USD",
              "formula": "5%",
              "item": null,
              "exchangeRate": null
            }
          ],
          "deMinimis": [
            {
              "formula": "(cost {'<='} 150 cad and hs_code not_starts_with \"2203,2204,2205,2206,2208,24\")",
              "method": "FOB",
              "note": "Items value less than 150 CAD and not containing alcohol, tobacco, or other excluded items",
              "threshold": "ABOVE",
              "type": "DUTY"
            },
            {
              "formula": "(cost {'<='} 40 cad and hs_code not_starts_with \"2203,2204,2205,2206,2208,24\")",
              "method": "FOB",
              "note": "Items value less than 40 CAD and not containing alcohol, tobacco, or other excluded items",
              "threshold": "ABOVE",
              "type": "TAX"
            }
          ],
          "shipmentRating": {
            "id": "shipment_rating_5551cd40-9477-47b4-9354-6be457f17b6d",
            "amount": 37.79,
            "currencyCode": "USD",
            "displayName": "FedEx International Priority",
            "minTransitAt": "2022-10-19T17:00:00Z",
            "maxTransitAt": null,
            "details": [
              {
                "amount": 120.56,
                "carrierCode": "retail_shipping",
                "type": "PUBLISHED_RATE"
              },
              {
                "amount": -96.2,
                "carrierCode": "discount",
                "type": "DISCOUNT"
              },
              {
                "amount": 1,
                "carrierCode": "carrier_fee",
                "type": "SURCHARGE"
              },
              {
                "amount": 5.3,
                "carrierCode": "carrier_fee",
                "type": "SURCHARGE"
              },
              {
                "amount": 7.13,
                "carrierCode": "fuel_surcharge",
                "type": "FUEL_SURCHARGE"
              }
            ],
            "amountSubtotals": {
              "shipping": 37.79,
              "fuelSurcharge": 7.13,
              "insuranceCost": null,
              "otherSurcharge": 6.3
            },
            "shipmentRatingCartons": [],
            "shippingProfile": {
              "id": "shipping_profile_28632acb-81d2-46ff-8c8e-699c9eafe288",
              "customServiceLevelCode": "INTERNATIONAL_PRIORITY",
              "landedCostMethod": "DDP_FORCED",
              "serviceLevel": {
                "code": "fedex.international_priority"
              }
            }
          }
        }
      ]
    }
  }
}

Was deze pagina nuttig?