安全地连接您的 DHL 承运人账户,以访问协商运费并通过 Zonos 直接创建标签。
DHL 承运人账户连接过程验证您的凭证并确保您的账户被正确配置以检索运费和生成运单。当您连接您的 DHL 账户时,Zonos 会执行测试评级调用,以验证连接在存储您的凭证之前是否正常工作。
要向 DHL Express 注册或通过您的 Zonos Dashboard 进行设置,请按照本指南中的步骤操作。
连接您的 DHL 承运人账户:
连接后,您的 DHL 承运人账户可用于获取基于协商运费(如适用)的实时运费,以及创建 DHL 运单。
使用 carrierAccountConnect mutation 来连接您的 DHL 承运人账户及凭证。
carrierAccountConnect
使用此 mutation 连接您的 DHL 承运人账户并验证您的凭证。
mutation CarrierAccountConnect($input: CarrierAccountConnectInput!) {
carrierAccountConnect(input: $input) {
errors
carrierAccount {
credentialProvider
id
integrationType
organization
rateType
carrier {
code
name
}
credentials {
type
value
该 mutation 需要 DHL 承运人代码、运费类型和您的 DHL 账户凭证。
{
"input": {
"carrierCode": "DHL",
"rateType": "NEGOTIATED",
"credentials": [
"type": "API_KEY",
"value": "actual_api_key_value"
},
"type": "API_PASSWORD",
"value": "actual_api_password_value"
"type": "ACCOUNT_NUMBER",
"value": "actual_account_number_value"
]
DHL 需要以下凭证类型:
API_KEY
API_PASSWORD
ACCOUNT_NUMBER
您可以在您的 DHL 账户门户中找到这些凭证,或通过联系您的 DHL 账户代表来获取。
当凭证有效且 DHL 成功返回运费时:
"data": {
"carrierAccountConnect": {
"errors": [],
"carrierAccount": {
"credentialProvider": "ORGANIZATION",
"id": "carrier_account_123",
"integrationType": "REST",
"organization": "organization_id",
"carrier": {
"id": "carrier_123",
"code": "dhl",
"name": "DHL"
如果您提供 DHL 不支持的凭证类型:
"errors": [
"Credential type SITE_ID is not supported by carrier DHL"
],
"carrierAccount": null
如果凭证是有效类型但无法与 DHL 成功进行身份验证:
"Failed to get rating from DHL API"
连接 DHL 承运人账户成功后:
连接您的 DHL 承运人账户后:
CarrierAccountConnectInput
通过 API 连接
连接 DHL 承运人账户
安全地连接您的 DHL 承运人账户,以访问协商运费并通过 Zonos 直接创建标签。
开始使用
DHL 承运人账户连接过程验证您的凭证并确保您的账户被正确配置以检索运费和生成运单。当您连接您的 DHL 账户时,Zonos 会执行测试评级调用,以验证连接在存储您的凭证之前是否正常工作。
要向 DHL Express 注册或通过您的 Zonos Dashboard 进行设置,请按照本指南中的步骤操作。
DHL 承运人账户连接如何工作
连接您的 DHL 承运人账户:
连接后,您的 DHL 承运人账户可用于获取基于协商运费(如适用)的实时运费,以及创建 DHL 运单。
连接您的 DHL 账户
使用
carrierAccountConnectmutation 来连接您的 DHL 承运人账户及凭证。Mutation
使用此 mutation 连接您的 DHL 承运人账户并验证您的凭证。
mutation CarrierAccountConnect($input: CarrierAccountConnectInput!) {carrierAccountConnect(input: $input) {errorscarrierAccount {credentialProvideridintegrationTypeorganizationrateTypecarrier {idcodename}credentials {typevalue}}}}变量
该 mutation 需要 DHL 承运人代码、运费类型和您的 DHL 账户凭证。
{"input": {"carrierCode": "DHL","rateType": "NEGOTIATED","credentials": [{"type": "API_KEY","value": "actual_api_key_value"},{"type": "API_PASSWORD","value": "actual_api_password_value"},{"type": "ACCOUNT_NUMBER","value": "actual_account_number_value"}]}}DHL 需要以下凭证类型:
API_KEY- 您的 DHL API 密钥API_PASSWORD- 您的 DHL API 密码ACCOUNT_NUMBER- 您的 DHL 账户号您可以在您的 DHL 账户门户中找到这些凭证,或通过联系您的 DHL 账户代表来获取。
响应示例
成功连接
当凭证有效且 DHL 成功返回运费时:
{"data": {"carrierAccountConnect": {"errors": [],"carrierAccount": {"credentialProvider": "ORGANIZATION","id": "carrier_account_123","integrationType": "REST","organization": "organization_id","rateType": "NEGOTIATED","carrier": {"id": "carrier_123","code": "dhl","name": "DHL"},"credentials": [{"type": "API_KEY","value": "actual_api_key_value"},{"type": "API_PASSWORD","value": "actual_api_password_value"},{"type": "ACCOUNT_NUMBER","value": "actual_account_number_value"}]}}}}错误:不支持的凭证类型
如果您提供 DHL 不支持的凭证类型:
{"data": {"carrierAccountConnect": {"errors": ["Credential type SITE_ID is not supported by carrier DHL"],"carrierAccount": null}}}错误:无效的凭证
如果凭证是有效类型但无法与 DHL 成功进行身份验证:
{"data": {"carrierAccountConnect": {"errors": ["Failed to get rating from DHL API"],"carrierAccount": null}}}连接后会发生什么
连接 DHL 承运人账户成功后:
后续步骤
连接您的 DHL 承运人账户后:
CarrierAccountConnectInput
carrierAccountConnect
这个页面有帮助吗?