DHL 承运人账户连接如何工作
连接您的 DHL 承运人账户:
- 验证您为 DHL 提供的凭证类型是否正确
- 对 DHL API 进行实时评级调用以确认凭证有效
- 在 Zonos 中存储您的已连接账户,供将来的货运评级和标签创建使用
- 返回已连接的账户详情,包括您的 DHL 账户信息和运费类型
连接后,您的 DHL 承运人账户可用于获取基于协商运费(如适用)的实时运费,以及创建 DHL 运单。
连接您的 DHL 账户
使用 carrierAccountConnect mutation 来连接您的 DHL 承运人账户及凭证。
Mutation
使用此 mutation 连接您的 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
}变量
该 mutation 需要 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 直接创建标签。