Skip to content
Bitzsoft.Integrationsbitzsoft.integrations

Reference

中通快递

中通快递包的 ZtoOptions 配置字段、AppKey/AppSecret 鉴权与使用示例。

Last updated

包信息

属性
NuGet 包Bitzsoft.Integrations.Express.Zto
Provider IDzto
鉴权AppKey + AppSecret
能力全功能(轨迹、下单、面单)

配置字段(ZtoOptions)

字段类型必填默认值说明
AppKeystring应用 Key
AppSecretstring应用密钥
BaseUrlstringhttps://jwzto.zto.com中通开放平台 API 基地址
HttpClientNamestringZtoExpress命名 HttpClient

配置示例

{
"Express": {
"Zto": {
"AppKey": "your-app-key",
"AppSecret": "your-app-secret"
}
}
}

DI 注册

builder.Services.AddBitzsoftZtoExpress(builder.Configuration.GetSection("Express:Zto"));

使用示例

public class ZtoService(IExpressProvider express)
{
public async Task<ExpressWaybillResult> GenerateWaybillAsync(string orderId)
{
return await express.GenerateWaybillAsync(orderId);
}
public async Task<IReadOnlyList<ExpressQuoteResult>> GetQuoteAsync(string from, string to, double weight)
{
return await express.GetQuoteAsync(from, to, weight);
}
}

已知限制

  • 中通开放平台 API 的 BaseUrl 按合作模式可能不同(jwzto.zto.com 为标准入口)。

相关

100%

滚轮或按钮缩放 · 放大后拖动画面 · 双击切换 100% / 200%