DHL 承運商帳戶連接的運作方式
連接您的 DHL 承運商帳戶時:
- 驗證您是否已為 DHL 提供正確的憑證類型
- 向 DHL API 發出即時評級呼叫,確認憑證有效
- 將您已連接的帳戶儲存在 Zonos,供日後發貨評級及建立標籤使用
- 傳回已連接帳戶的詳細資料,包括您的 DHL 帳戶資訊及費率類型
連接後,您的 DHL 承運商帳戶即可用於根據您的議定費率(如適用)取得即時運費,並建立 DHL 運輸標籤。
連接您的 DHL 帳戶
使用 carrierAccountConnect 變更,透過您的憑證連接 DHL 承運商帳戶。
變更
使用此變更連接您的 DHL 承運商帳戶並驗證您的憑證。
1
mutation CarrierAccountConnect($input: CarrierAccountConnectInput!) {2
carrierAccountConnect(input: $input) {3
errors4
carrierAccount {5
credentialProvider6
id7
integrationType8
organization9
rateType10
carrier {11
id12
code13
name14
}15
credentials {16
type17
value18
}19
}20
}21
}變數
此變更需要 DHL 承運商代碼、費率類型,以及您的 DHL 帳戶憑證。
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 需要以下憑證類型:
API_KEY- 您的 DHL API 金鑰API_PASSWORD- 您的 DHL API 密碼ACCOUNT_NUMBER- 您的 DHL 帳戶號碼
您可以在 DHL 帳戶入口網站中找到這些憑證,或聯絡您的 DHL 帳戶代表取得。
回應範例
成功連接
當憑證有效且 DHL 成功傳回費率時:
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
}錯誤:不支援的憑證類型
如果您提供的憑證類型不受 DHL 支援:
1
{2
"data": {3
"carrierAccountConnect": {4
"errors": [5
"Credential type SITE_ID is not supported by carrier DHL"6
],7
"carrierAccount": null8
}9
}10
}錯誤:憑證無效
如果憑證類型有效,但未能成功通過 DHL 驗證:
1
{2
"data": {3
"carrierAccountConnect": {4
"errors": [5
"Failed to get rating from DHL API"6
],7
"carrierAccount": null8
}9
}10
}連接後會發生什麼事
成功連接您的 DHL 承運商帳戶後:
- 該帳戶會儲存在您的機構中,並與您的憑證連結
- 您可以使用議定費率(如適用)擷取 DHL 運費
- 您可以透過 Zonos API 建立 DHL 運輸標籤
- 承運商帳戶可用於多次發貨,無需重新連接
下一步
連接您的 DHL 承運商帳戶後:
- 建立發貨 - 使用您已連接的 DHL 承運商帳戶生成運輸標籤
- 計算 Landed Cost - 為國際發貨取得準確的關稅及稅項計算
- 查看支援的承運商 - 查看 Zonos 提供的所有承運商及服務等級
GraphQL API ReferenceTypes, inputs, and operations used in this guide
MUTATIONS
連接 DHL 承運商帳戶
安全連接您的 DHL 承運商帳戶,即可取得議定運費,並直接透過 Zonos 建立標籤。