Bitzsoft.Integrations.Express.Cainiao 1.0.0-alpha.8

This is a prerelease version of Bitzsoft.Integrations.Express.Cainiao.
dotnet add package Bitzsoft.Integrations.Express.Cainiao --version 1.0.0-alpha.8
                    
NuGet\Install-Package Bitzsoft.Integrations.Express.Cainiao -Version 1.0.0-alpha.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bitzsoft.Integrations.Express.Cainiao" Version="1.0.0-alpha.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.Express.Cainiao" Version="1.0.0-alpha.8" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.Express.Cainiao" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bitzsoft.Integrations.Express.Cainiao --version 1.0.0-alpha.8
                    
#r "nuget: Bitzsoft.Integrations.Express.Cainiao, 1.0.0-alpha.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bitzsoft.Integrations.Express.Cainiao@1.0.0-alpha.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bitzsoft.Integrations.Express.Cainiao&version=1.0.0-alpha.8&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.Express.Cainiao&version=1.0.0-alpha.8&prerelease
                    
Install as a Cake Tool

Bitzsoft.Integrations.Express.Cainiao

菜鸟速递 EDI 服务实现,对接菜鸟速递开放平台 B2C 订单管理接口。

功能特性

  • 基于菜鸟速递 EDI form-urlencoded 公共信封,业务报文使用 JSON
  • 认证方式:logistic_provider_id + data_digest = Base64(MD5(logistics_interface + secretKey))
  • 支持轨迹查询、轨迹订阅、三合一下单、运单取消、时效表达、电子面单取号与预分拣

安装

dotnet add package Bitzsoft.Integrations.Express.Cainiao
<PackageReference Include="Bitzsoft.Integrations.Express.Cainiao" Version="*" />

配置

{
  "Express": {
    "Cainiao": {
      "AppKey": "菜鸟提供的对接码",
      "AppSecret": "双方约定的secretKey",
      "BaseUrl": "https://edi-daily.xpm.cainiao.com",
      "HttpClientName": "CainiaoExpress"
    }
  }
}
参数 必填 默认值 说明
AppKey 菜鸟侧提供的对接码,对应 logistic_provider_id
AppSecret 双方约定的签名密钥
BaseUrl https://edi-daily.xpm.cainiao.com API 基地址;生产环境需配置菜鸟提供的正式网关
HttpClientName CainiaoExpress 命名 HttpClient 名称

注册服务

services.AddBitzsoftCainiaoExpress(configuration, "Express:Cainiao");

第三方请求日志

内置 Bitzsoft.Integrations.RequestLogging 出站请求记录管道,默认 NullRequestLogStore 不持久化。

// ① 默认:启用记录管道但不持久化(日志丢弃)
services.AddBitzsoftCainiaoExpress(options => { /* ... */ });

// ② 持久化:宿主注册 IRequestLogStore 实现后,所有出站请求自动落库
services.AddRequestLogging<MyRequestLogStore>(opts =>
{
    opts.MaxBodyLength = 8192;
    opts.SensitiveFields.Add("mySecret");
});
services.AddBitzsoftCainiaoExpress(options => { /* ... */ });

实现状态

方法 状态 说明
TrackAsync 已实现 调用物流轨迹查询接口
BatchTrackAsync 已实现 并发逐单查询
SubscribeAsync 已实现 调用物流轨迹订阅接口;回调接收需按菜鸟推送接口另行暴露服务
CreateShipmentAsync 已实现 调用三合一订单下发接口,返回运单号
CancelShipmentAsync 已实现 调用运单取消接口;参数可传 mailNomailNo|reason 或 JSON
GetQuoteAsync 部分实现 调用时效表达接口,仅返回截单/揽收时效,不返回运费
GenerateWaybillAsync 部分实现 调用电子面单和预分拣接口获取运单号,公开接口不直接返回 HTML/PDF
DetectCarrierAsync 不支持 菜鸟 B2C EDI 文档未提供独立承运商识别接口

API 端点

常量 接口 用途
PathTrack /ext/gateway/ediPracticeTrace/ediStandardPracticeTrace/api 物流轨迹查询
PathSubscribe /ext/gateway/ediStandardTraceSubscribe/api 物流轨迹订阅
PathOrderAccept /ext/gateway/orderAccept/commonReceive/api 三合一订单下发
PathWaybillAndSort /ext/gateway/ediStandardWaybillAndSort/ediStandardWaybillAndSort/api 电子面单取号和预分拣
PathCancel /ext/gateway/ediStandardWaybillCancel/api 运单取消
PathQuote /ext/gateway/ediStandardExpectCollectTimeQuery/api 时效表达

注意事项

  • 公开文档中的 edi-daily.xpm.cainiao.com 为测试网关域名,生产地址、对接码和密钥需由菜鸟侧提供
  • SubscribeAsync 只提交订阅运单号,回调 URL 不属于该接口入参;回调服务需按菜鸟“物流轨迹推送接口”另行实现
  • GenerateWaybillAsync 只能返回取号结果,HTML/PDF 打印内容需结合菜鸟打印组件或淘系专用能力补充
  • GetQuoteAsync 对应下单前预计揽收信息,不是按单运费报价

相关包

包名 说明
Bitzsoft.Integrations.Express 抽象层
Bitzsoft.Integrations.Express.All 聚合包
Bitzsoft.Integrations.Compatibility 基础工具库
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.Express.Cainiao:

Package Downloads
Bitzsoft.Integrations.Express.All

快递物流服务聚合包 — 包含所有供应商实现

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.8 42 7/1/2026
1.0.0-alpha.7 62 6/16/2026
1.0.0-alpha.6 62 6/16/2026
1.0.0-alpha.5 55 6/14/2026
1.0.0-alpha.3 65 6/7/2026