DOCS

Forbind via API

Forbind DHL Carrier Account

Forbind sikkert din DHL carrier account for at få adgang til forhandlede shipping rates og oprette labels direkte via Zonos.

Kom i gang 

DHL carrier account-forbindelsen validerer credentials og sikrer korrekt konfiguration til rates og labels. Ved forbindelse laver Zonos et test rating-kald for at verificere, før credentials gemmes.

For at registrere hos DHL Express eller opsætte via Zonos Dashboard, følg trinene i denne guide.

Sådan virker DHL carrier account-forbindelse 

Forbindelse af DHL carrier account:

  • Validerer korrekte credential-typer for DHL
  • Laver live rating-kald til DHL API for at bekræfte credentials
  • Gemmer forbundet konto i Zonos til fremtidig rating og labeloprettelse
  • Returnerer kontodetaljer inkl. DHL account information og rate type

Når forbundet kan kontoen bruges til realtids shipping rates (forhandlede, hvis relevant) og DHL labels.

Forbind din DHL-konto 

Brug carrierAccountConnect-mutationen til at forbinde DHL carrier account med credentials.

Mutation

Brug denne mutation til at forbinde DHL carrier account og validere credentials.

1mutation CarrierAccountConnect($input: CarrierAccountConnectInput!) {
2 carrierAccountConnect(input: $input) {
3 errors
4 carrierAccount {
5 credentialProvider
6 id
7 integrationType
8 organization
9 rateType
10 carrier {
11 id
12 code
13 name
14 }
15 credentials {
16 type
17 value
18 }
19 }
20 }
21}

Variables

Mutationen kræver DHL carrier code, rate type og DHL credentials.

1{
2 "input": {
3 "carrierCode": "DHL",
4 "rateType": "NEGOTIATED",
5 "credentials": [
6 {
7 "type": "API_KEY",
8 "value": "actual_api_key_value"
9 },
10 {
11 "type": "API_PASSWORD",
12 "value": "actual_api_password_value"
13 },
14 {
15 "type": "ACCOUNT_NUMBER",
16 "value": "actual_account_number_value"
17 }
18 ]
19 }
20}

DHL kræver følgende credential-typer:

  • API_KEY - Din DHL API key
  • API_PASSWORD - Dit DHL API password
  • ACCOUNT_NUMBER - Dit DHL account number

Find credentials i DHL account portal eller via din DHL account representative.

Response-eksempler

Vellykket forbindelse

Når credentials er gyldige og DHL returnerer rates:

1{
2 "data": {
3 "carrierAccountConnect": {
4 "errors": [],
5 "carrierAccount": {
6 "credentialProvider": "ORGANIZATION",
7 "id": "carrier_account_123",
8 "integrationType": "REST",
9 "organization": "organization_id",
10 "rateType": "NEGOTIATED",
11 "carrier": {
12 "id": "carrier_123",
13 "code": "dhl",
14 "name": "DHL"
15 },
16 "credentials": [
17 {
18 "type": "API_KEY",
19 "value": "actual_api_key_value"
20 },
21 {
22 "type": "API_PASSWORD",
23 "value": "actual_api_password_value"
24 },
25 {
26 "type": "ACCOUNT_NUMBER",
27 "value": "actual_account_number_value"
28 }
29 ]
30 }
31 }
32 }
33}

Fejl: Unsupported credential type

Hvis du angiver en credential type, DHL ikke understøtter:

1{
2 "data": {
3 "carrierAccountConnect": {
4 "errors": [
5 "Credential type SITE_ID is not supported by carrier DHL"
6 ],
7 "carrierAccount": null
8 }
9 }
10}

Fejl: Invalid credentials

Hvis credential-typerne er gyldige, men autentificering mod DHL fejler:

1{
2 "data": {
3 "carrierAccountConnect": {
4 "errors": [
5 "Failed to get rating from DHL API"
6 ],
7 "carrierAccount": null
8 }
9 }
10}

Efter forbindelse

Når DHL carrier account er forbundet:

  • Kontoen gemmes i organisationen og linkes til credentials
  • Du kan hente DHL shipping rates med forhandlede rates (hvor relevant)
  • Du kan oprette DHL labels via Zonos API
  • Carrier account kan bruges på tværs af forsendelser uden genforbindelse

Næste skridt 

Efter forbindelse af DHL carrier account:

GraphQL API ReferenceTypes, inputs, and operations used in this guide
Book en demo

Var denne side nyttig?