创建运单
请求地址
https://www.xxyb.cn/union/api/link/createWaybill
Header
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| token | 是 | string | 应用令牌 |
| cid | 是 | string | 合作ID |
| corpId | 是 | string | 企业ID |
请求参数
ApiConsignorWaybillCreateReq 创建运单请求
| 字段 | 类型 | 层级 | 描述 | 必填 | 备注 |
|---|---|---|---|---|---|
| waybillBasicDomain | ApiWaybillBasicDomain | 1 | 运单基础信息 | 是 | |
| waybillLineDomain | ApiWaybillLineDomain | 1 | 运单线路信息 | 是 | |
| waybillGoodsDomains | List<ApiWaybillGoodsDomain> | 1 | 运单货物信息 | 是 | |
| waybillSettlementDomain | ApiWaybillSettlementDomain | 1 | 运单结算信息 | 是 |
ApiWaybillBasicDomain 运单基础信息
| 字段 | 类型 | 层级 | 描述 | 必填 | 备注 |
|---|---|---|---|---|---|
| billCode | String | 2 | 客户单号 | 是 | |
| bodyId | String | 2 | 主体ID | 是 | 对接时平台提供 |
| driverPhone | String | 2 | 司机手机号 | 是 | |
| licensePlateNumber | String | 2 | 车牌号 | 是 | |
| insureBuyer | InsureBuyerEnum | 2 | 保险购买方 | 是 | 默认传OWNER |
| billGenerationTime | Date | 2 | 建单时间 | 是 | |
| remark | String | 2 | 运单备注 | 否 |
ApiWaybillLineDomain 运单线路信息
| 字段 | 类型 | 层级 | 描述 | 必填 | 备注 |
|---|---|---|---|---|---|
| sendProvince | String | 2 | 发货省 | 是 | |
| sendCity | String | 2 | 发货市 | 是 | |
| sendArea | String | 2 | 发货区 | 是 | |
| sendAddress | String | 2 | 发货详细地址 | 是 | |
| sendAddressRemark | String | 2 | 发货详细地址备注 | 否 | |
| sendLon | BigDecimal | 2 | 发货经度 | 是 | |
| sendLat | BigDecimal | 2 | 发货纬度 | 是 | |
| sendPerson | String | 2 | 发货联系人 | 否 | |
| sendPhone | String | 2 | 发货联系手机号 | 否 | |
| sendPlanTime | Date | 2 | 计划发货时间 | 否 | |
| deliveryProvince | String | 2 | 收货省 | 是 | |
| deliveryCity | String | 2 | 收货市 | 是 | |
| deliveryArea | String | 2 | 收货区 | 是 | |
| deliveryAddress | String | 2 | 收货详细地址 | 是 | |
| deliveryAddressRemark | String | 2 | 收货详细地址备注 | 否 | |
| deliveryLon | BigDecimal | 2 | 收货经度 | 是 | |
| deliveryLat | BigDecimal | 2 | 收货纬度 | 是 | |
| deliveryPerson | String | 2 | 收货联系人 | 否 | |
| deliveryPhone | String | 2 | 收货联系手机号 | 否 | |
| deliveryPlanTime | Date | 2 | 计划收货时间 | 否 |
ApiWaybillGoodsDomain 运单货物明细
| 字段 | 类型 | 层级 | 描述 | 必填 | 备注 |
|---|---|---|---|---|---|
| goodsType | String | 2 | 货物类型 | 是 | 联系平台获取 |
| goodsPrice | BigDecimal | 2 | 货值 | 是 | |
| goodsName | String | 2 | 货物名称 | 是 | |
| sendWeight | BigDecimal | 2 | 发货重量 | 是 | |
| deliveryWeight | BigDecimal | 2 | 收货重量 | 否 | |
| goodsNumber | BigDecimal | 2 | 货物数量 | 否 | "件", "支", "片", "套", "方"等计价单位时必填 |
ApiWaybillSettlementDomain 运单结算信息
| 字段 | 类型 | 层级 | 描述 | 必填 | 备注 |
|---|---|---|---|---|---|
| settlementMethod | SettlementMethodEnum | 2 | 结算吨重 | 是 | |
| feeUnit | BigDecimal | 2 | 运输单价 | 是 | |
| deductQuantity | BigDecimal | 2 | 扣杂 | 否 | |
| deductQuantityMethod | DeductQuantityMethodEnum | 2 | 扣杂计算方式 | 否 | |
| reasonableLosses | BigDecimal | 2 | 合理亏损 | 否 | settlementMethod为AUTO时必填 |
| reasonableMethod | DetailMethodEnum | 2 | 合理亏损计算方式 | 否 | settlementMethod为AUTO时必填 |
| goodsUnitPrice | BigDecimal | 2 | 货物单价 | 否 | settlementMethod为AUTO时必填 |
| detailMethod | String | 2 | 计价单位 | 是 | 默认传车 |
请求参数示例
json
{
"waybillBasicDomain": {
"billCode": "BILL20250601001",
"bodyId": "BODY_20250601_001",
"driverPhone": "DRIVER_20250601_001",
"licensePlateNumber": "VEHICLE_20250601_001",
"licensePlateColor": "BLUE",
"insureBuyer": "DRIVER",
"billGenerationTime": "2025-06-02 08:00:00",
"remark": "测试运单"
},
"waybillLineDomain": {
"sendProvince": "上海市",
"sendCity": "上海市",
"sendArea": "浦东新区",
"sendAddress": "世纪大道100号",
"sendAddressRemark": "近地铁2号线",
"sendLon": 121.4737,
"sendLat": 31.2304,
"sendPerson": "张三",
"sendPhone": "13800138000",
"sendPlanTime": "2025-06-02 08:00:00",
"deliveryProvince": "北京市",
"deliveryCity": "北京市",
"deliveryArea": "朝阳区",
"deliveryAddress": "建国路88号",
"deliveryAddressRemark": "SOHO现代城",
"deliveryLon": 116.4074,
"deliveryLat": 39.9042,
"deliveryPerson": "李四",
"deliveryPhone": "13900139000",
"deliveryPlanTime": "2025-06-03 18:00:00"
},
"waybillGoodsDomains": [
{
"goodsType": "ELECTRONICS",
"goodsPrice": 50000.00,
"goodsName": "电子产品",
"sendWeight": 10.500,
"deliveryWeight": 10.450,
"goodsNumber": 100
}
],
"waybillSettlementDomain": {
"settlementMethod": "SEND_WEIGHT",
"feeUnit": 500.00,
"deductQuantity": 0.050,
"deductQuantityMethod": "DEDUCT_FROM_WEIGHT",
"reasonableLosses": 0.010,
"reasonableMethod": "PERCENTAGE",
"goodsUnitPrice": 5000.00,
"detailMethod": "TON"
}
}