Bitzsoft.Integrations.Express.ChinaPost 1.0.0-alpha.3

This is a prerelease version of Bitzsoft.Integrations.Express.ChinaPost.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Bitzsoft.Integrations.Express.ChinaPost --version 1.0.0-alpha.3
                    
NuGet\Install-Package Bitzsoft.Integrations.Express.ChinaPost -Version 1.0.0-alpha.3
                    
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.ChinaPost" Version="1.0.0-alpha.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.Express.ChinaPost" Version="1.0.0-alpha.3" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.Express.ChinaPost" />
                    
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.ChinaPost --version 1.0.0-alpha.3
                    
#r "nuget: Bitzsoft.Integrations.Express.ChinaPost, 1.0.0-alpha.3"
                    
#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.ChinaPost@1.0.0-alpha.3
                    
#: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.ChinaPost&version=1.0.0-alpha.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.Express.ChinaPost&version=1.0.0-alpha.3&prerelease
                    
Install as a Cake Tool

Bitzsoft.Integrations.Express.ChinaPost

中国邮政/EMS 物流服务实现,基于《中小电商企业接口规范 V2.7》的公共请求信封对接。

功能特性

  • EMS 三要素认证:apiCode + senderNo + authorization
  • 支持运单轨迹查询、白名单订阅、订单接入、订单取消、预估邮费、面单查询
  • 支持 EMS 常见单号规则的本地承运商识别

安装

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

配置

{
  "Express": {
    "ChinaPost": {
      "SenderNo": "协议客户号",
      "Authorization": "测试或生产授权码",
      "BaseUrl": "https://api.ems.com.cn",
      "UserCode": "可选用户编码",
      "Version": "V1.0.0",
      "HttpClientName": "ChinaPostExpress"
    }
  }
}
参数 必填 默认值 说明
SenderNo - EMS 协议客户号
Authorization - 授权码,区分测试和生产
BaseUrl https://api.ems.com.cn API 基地址
UserCode - 用户编码
Version V1.0.0 EMS API 版本
HttpClientName ChinaPostExpress 命名 HttpClient 名称

注册服务

services.AddBitzsoftChinaPostExpress(configuration, "Express:ChinaPost");

实现状态

方法 EMS 接口 apiCode 状态
TrackAsync 运单轨迹信息获取 040001 已实现
BatchTrackAsync 无批量接口 - 并发调用 TrackAsync
SubscribeAsync 白名单订阅 020005 已实现
CreateShipmentAsync 订单接入 020003 已实现
CancelShipmentAsync 订单取消 020006 已实现
GetQuoteAsync 预估邮费 050005 已实现
GenerateWaybillAsync 面单查询 010004 已实现
DetectCarrierAsync 无官方识别接口 - 本地规则识别

EMS 扩展参数

ExpressShipmentOrder.Extra 可传 EMS 特有字段:

Key 说明
logisticsOrderNo 客户内部物流订单号;不传则自动生成
waybillNo 预分配运单号;不传则由订单接入接口分配
ecommerceUserId 电商客户标识;不传则自动生成
bizProductNo 业务产品分类,默认 1(特快专递)
contentsAttribute 内件性质,默认 3(物品)
waybillTemplateType 面单模板类型,默认 129
getWaybillUrl 设置为 true 时请求面单下载 URL

取消订单时 EMS 需要同时传 logisticsOrderNowaybillNo。统一接口只有 orderId 参数,因此可传:

logisticsOrderNo|waybillNo|cancelReason

或 JSON:

{"logisticsOrderNo":"O202203281508328002352578560","waybillNo":"1295838760599","cancelReason":"客户取消"}

注意事项

  • EMS 要求地址使用国标全称,例如 浙江省杭州市
  • 统一模型中的重量单位为千克,Provider 会转换为 EMS 的克。
  • GetQuoteAsync 使用 EMS 国内特快物品默认产品代码 112104302300991
  • GenerateWaybillAsync 如果未在 Extra["waybillNo"] 中传单号,会先调用订单接入接口创建订单,再查询面单。

相关包

包名 说明
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.ChinaPost:

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 51 7/1/2026
1.0.0-alpha.7 66 6/16/2026
1.0.0-alpha.6 69 6/16/2026
1.0.0-alpha.5 57 6/14/2026
1.0.0-alpha.3 60 6/7/2026