1. 退货单模块API
API URL
post {HTTP(S)地址}/api/{version}/returnOrder
1.1. 退货单创建接口
1.1.1. SERVICE_TYPE
CREATE_RETURN_ORDER
1.1.2. 请求参数
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
orderNumber | N | String | “S200305115680” | 千易系统单号 |
warehouse | Y | String | “FBA美国” | 退货仓库,最大50个字符 |
shop | Y | String | “测试店铺” | 退货店铺,最大50个字符。如果填写了orderNumber,订单所属店铺必须和shop一样 |
expectArriveTime | N | String | “2020-03-06” | 预计到货时间 yyyy-MM-dd |
reason | N | String | “买错了” | 退货原因,最大512个字符 |
remark | N | String | 备注 | |
carrier | N | String | 承运商,最大50个字符 | |
customNumber | N | String | 跟踪号,最大50个字符 | |
autoCommit | N | Boolean | true / false | 是否自动提交,true:用户无需在千易ERP中手动点击提交 |
returnSkuList | List<ReturnSku> | 详见ReturnSku | ||
refundCustomFieldValueVOList | N | List<SkuCustomFieldValueVO> |
ReturnSku(退货SKU)
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
orderSkuId | O | Number | 113 | 销售订单商品ID,从订单查询接口获取。如果是组合品,只取子品。(orderSkuId、sku选一填写。传了orderNumber时,都填以orderSkuId为准) |
sku | O | String | 千易商品SKU(单品的SKU,可确认具体的明细行)(orderSkuId、sku选一填写,都填以orderSkuId为准)(不传orderNumber时,sku一定要传并且不可以是组合品) | |
quantity | Y | Number | 1 | 退货数量 |
storageLocationCode | N | String | 库位,默认系统库位 | |
remark | N | String | 备注 |
SkuCustomFieldValueVO(自定义栏位)
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
customFieldId | Y | Long | 3 | SERVICE_TYPE中的CUSTOMER_FIELD_QUERY接口返回的id |
value | Y | String | “张三” | 自定义栏位对应的值 |
1.1.3. 返回参数
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
errorCode | Y | String | “DATA_INPUT_ERROR” | 错误码 |
errorMsg | Y | String | “输入参数不对” | 业务错误信息 |
state | Y | String | success | 请求结果 |
result | Y | ReturnOrder | 详见ReturnOrder |
请求示例:
curl --location --request POST 'https://gerp-test1.800best.com/api/v1/returnOrder' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--form 'appId="TEST"' \
--form 'serviceType="CREATE_RETURN_ORDER"' \
--form 'bizParam="{
\"warehouse\":\"best warehouse(测试用)\",
\"shop\":\"测试1\",
\"returnSkuList\":[{
\"sku\":\"DP001\",
\"quantity\":1
}]
}"' \
--form 'timestamp="1731742317"' \
--form 'sign="776505df88f4dd3cd6a4d76db75a9103"'
返回示例:
{
"state": "success",
"errorCode": "",
"errorMsg": "",
"bizContent": "{\"notSuccess\":false,\"result\":{\"createTime\":1757644953059,\"returnNumber\":\"B250912149639\",\"returnSkuList\":[{\"quantity\":1,\"selected\":1,\"sku\":\"DP001\"}],\"shop\":\"测试1\",\"status\":\"NEW\",\"type\":\"SALES_RETURN\",\"warehouse\":\"best warehouse(测试用)\",\"withoutType\":false},\"state\":\"success\"}",
"requestId": "0b529993-a579-40ec-b6da-14c28a88b172"
}
1.2. 退货单关闭接口
1.2.1. SERVICE_TYPE
CLOSE_RETURN_ORDER
1.2.2. 请求参数
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
returnNumber | Y | String | “B200308115691” | 退货单号 |
1.2.3. 返回参数
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
errorCode | Y | String | “DATA_INPUT_ERROR” | 错误码 |
errorMsg | Y | String | “输入参数不对” | 业务错误信息 |
state | Y | String | success | 请求结果 |
请求示例:
curl --location --request POST 'https://gerp-test1.800best.com/api/v1/returnOrder' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--form 'appId="TEST"' \
--form 'serviceType="CLOSE_RETURN_ORDER"' \
--form 'bizParam="{
\"returnNumber\":\"B250912149639\"
}"' \
--form 'timestamp="1731742317"' \
--form 'sign="6e7c8da4cb35bf496f607745c3accd15"'
返回示例:
{
"state": "success",
"errorCode": "",
"errorMsg": "",
"bizContent": "{\"notSuccess\":false,\"state\":\"success\"}",
"requestId": "2ffaa7df-073b-4e74-8aaa-02bf1bd45e18"
}
1.3. 退货单查询接口
1.3.1. SERVICE_TYPE
QUERY_RETURN_ORDER_LIST
1.3.2. 请求参数
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
returnNumber | N | String | “S200222115613” | 系统退货单号,最大50个字符 |
warehouse | N | String | 千易仓库名称,最大50个字符 | |
status | N | String | 状态见枚举 | |
fromCreateTime | N | String | “2020-03-04” | 开始创建时间 yyyy-MM-dd HH:mm:ss |
toCreateTime | N | String | “2020-03-26” | 结束创建时间 yyyy-MM-dd HH:mm:ss |
updateTimeFrom | N | String | 2021-08-01 | 退货单更新时间,精确到“天” |
updateTimeTo | N | String | 2021-08-01 | 退货单更新时间,精确到“天” |
finishTimeFrom | N | String | 2023-08-01 | 退货单完成时间,精确到“时分秒” |
finishTimeTo | N | String | 2023-08-01 | 退货单完成时间,精确到“时分秒” |
shopIdList | N | List<Long> | [1,2,3] | 批量店铺id |
shopGroupIdList | N | List<Long> | [1,2,3] | 批量店铺组id |
page | Y | Number | 1 | 页码,默认1 |
pageSize | Y | Number | 50 | 每页条数.不超过200条; 默认100 |
withoutType | N | Boolean | True | 同时返回退款单、退货单、补发货单 |
withCommitTime | N | Boolean | True | 同时返回提交时间 |
1.3.3. 返回参数
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
errorCode | Y | String | “DATA_INPUT_ERROR” | 错误码 |
errorMsg | Y | String | “输入参数不对” | 业务错误信息 |
state | Y | String | success | 请求结果 |
total | Y | Number | 100 | 总条数 |
result | Y | List<ReturnOrder> | 详见ReturnOrder |
ReturnOrder(退货单)
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
returnNumber | Y | String | “B200305115684” | 退货单号 |
createTime | Y | timestamp | 1583410532000 | 时间戳, 单位毫秒 |
updateTime | Y | timestamp | 1583410532000 | 时间戳, 单位毫秒 |
commitTime | N | timestamp | 1583410532000 | 时间戳, 单位毫秒 |
finishTime | N | timestamp | 1583410532000 | 时间戳, 单位毫秒 |
orderNumber | N | String | 销售订单号 | |
onlineOrderNumber | N | String | “DA200221115559” | 线上订单,关联订单 |
buyerId | N | String | “user123” | 买家ID |
warehouse | Y | String | “GWMS” | 仓库 |
status | Y | String | “FINISH” | 状态 |
returnSkuList | Y | List<ReturnSku> | 详见退货SKU | |
carrier | N | String | 承运商 | |
customNumber | N | String | 跟踪号 | |
reason | N | String | “买错了” | 退货原因 |
shop | N | String | 店铺名称 | |
currency | N | String | CNY | 货币单位 |
orderRefundAmount | N | BigDecimal | 订单退款总金额 | |
asnNumber | N | String | 入库单号 | |
asnId | N | String | 入库单ID | |
type | Y | String | RETURN(退款单)、SALES_RETURN(退货单)、RESHIP(补发货单) | |
refundCustomFieldValueVOList | N | List<SkuCustomFieldValueVO> | 自定义栏位 | |
totalAmount | N | BigDecimal | 退款金额 |
SkuCustomFieldValueVO(自定义栏位信息)
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
tableName | Y | String | SYS_REFUND | SYS_ITEM:系统商品自定义栏位; SYS_ORDER:订单自定义栏位; SYS_ODO:出库单自定义栏位; SYS_ASN:入库单自定义栏位; SYS_REFUND:售后管理。 |
columType | Y | String | NUMBER | 筛选不同填入类型的自定义栏位 NUMBER:数字; DATE:日期; STRING:字符串; SELECT:下拉框。 |
columName | Y | String | 生产日期 | 用户自己定义的栏位名称 |
defaultValue | N | String | "1970/01/01"(无双引号) | 自定义栏位默认值 |
candidateValue | N | String | ["1970/01/01","1970/01/02"] | 下拉框的候选值 |
remark | N | String | 上架日期区分于出厂日期 | 备注 |
required | N | Integer | 1 | 是否只查询必填栏位 1:true;0:false |
isQuery | N | Integer | 1 | 是否只查询支持查询的栏位 1:true;0:false |
isShow | N | Integer | 1 | 是否只查询支持列配置的栏位 1:true;0:false |
ReturnSku(退货SKU)
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
sku | Y | String | “abc” | 商品SKU |
orderSkuId | Y | Number | 销售订单商品ID | |
quantity | Y | Number | 1 | 实际退货数量 |
itemRefundAmount | N | BigDecimal | 订单商品退款总金额 | |
selected | Y | Number | 1 | 退货单明细在页面上是否可见,1: 可见, 0: 不可见 |
storageLocationCode | N | String | "SYS LOC" | 库位信息 |
refundAmount | N | BigDecimal | 明细退款金额 | |
goodQuantity | N | Number | 良品数量 | |
badQuantity | N | Number | 不良品数量 | |
locAndQuantityList | N | List <LocAndQuantity> |
库位和实收数量列表 |
LocAndQuantity(returnSku关联入库单明细的收货信息)
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
storageLocationCode | Y | String | 库位编码 | |
receiveQuantity | Y | Number | 实收数量 |
请求示例:
curl --location --request POST 'https://gerp-test1.800best.com/api/v1/returnOrder' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--form 'appId="TEST"' \
--form 'serviceType="QUERY_RETURN_ORDER_LIST"' \
--form 'bizParam="{
\"page\":1,
\"pageSize\":2
}"' \
--form 'timestamp="1731742317"' \
--form 'sign="9b108435872826df205820d32e296be4"'
返回示例:
{
"state": "success",
"errorCode": "",
"errorMsg": "",
"bizContent": "{\"notSuccess\":false,\"result\":[{\"createTime\":1757642599000,\"isDeleted\":0,\"orderRefundAmount\":0,\"reason\":\"退款测试\",\"refundCustomFieldValueVOList\":[{\"candidateValue\":[],\"columCode\":5,\"columName\":\"网上订单号\",\"columType\":\"STRING\",\"customFieldId\":43,\"customFieldValueVOList\":[],\"customerId\":3,\"customerIdForUser\":3,\"defaultValue\":\"\",\"id\":43,\"isQuery\":1,\"isShow\":1,\"required\":1,\"value\":\"1234\"}],\"remark\":\"破损退货\",\"returnNumber\":\"B250912149637\",\"returnSkuList\":[{\"isDeleted\":0,\"itemRefundAmount\":0,\"quantity\":1,\"remark\":\"破损退货\",\"selected\":1,\"sku\":\"hmsku090901-1\",\"storageLocationCode\":\"SYS LOC\"}],\"shop\":\"shopee111PH\",\"status\":\"WAIT_STORAGE\",\"type\":\"SALES_RETURN\",\"updateTime\":1757642613000,\"warehouse\":\"best warehouse(测试用)\",\"warehouseEntryID\":46060,\"warehouseEntryNumber\":\"A250912149638\",\"withoutType\":false},{\"buyerId\":\"408\",\"carrier\":\"jt\",\"createTime\":1755853887000,\"currency\":\"VND\",\"customNumber\":\"801100620944\",\"finishTime\":1755854697000,\"isDeleted\":0,\"onlineOrderNumber\":\"2508071639020252990324083\",\"orderNumber\":\"S250807148097\",\"orderRefundAmount\":0,\"reason\":\"与商家协商一致\",\"refundCustomFieldValueVOList\":[{\"candidateValue\":[],\"columCode\":5,\"columName\":\"网上订单号\",\"columType\":\"STRING\",\"customFieldId\":43,\"customFieldValueVOList\":[],\"customerId\":3,\"customerIdForUser\":3,\"defaultValue\":\"\",\"id\":43,\"isQuery\":1,\"isShow\":1,\"required\":1}],\"remark\":\"\",\"returnNumber\":\"B250822148831\",\"returnSkuList\":[{\"badQuantity\":0,\"goodQuantity\":3,\"isDeleted\":0,\"itemRefundAmount\":0,\"locAndQuantityList\":[{\"receiveQuantity\":3,\"storageLocationCode\":\"SYS LOC\"}],\"orderSkuId\":92169604,\"quantity\":3,\"selected\":1,\"sku\":\"110015015005\",\"storageLocationCode\":\"SYS LOC\"},{\"badQuantity\":0,\"goodQuantity\":6,\"isDeleted\":0,\"itemRefundAmount\":0,\"locAndQuantityList\":[{\"receiveQuantity\":6,\"storageLocationCode\":\"SYS LOC\"}],\"orderSkuId\":92169605,\"quantity\":6,\"selected\":1,\"sku\":\"110015019002\",\"storageLocationCode\":\"SYS LOC\"}],\"shop\":\"Solaso-ERP\",\"status\":\"FINISH\",\"type\":\"SALES_RETURN\",\"updateTime\":1755854697000,\"warehouse\":\"solaso-huzhiming\",\"warehouseEntryID\":45838,\"warehouseEntryNumber\":\"A250822148832\",\"withoutType\":false}],\"state\":\"success\",\"total\":1089}",
"requestId": "dda0be94-be73-4f20-b0d2-4c3fc414b3fb"
}
1.4. 退货单完成信息推送接口
1.4.1. SERVICE_TYPE
PUSH_RETURN_ORDER_INFO
1.4.2. 推送消息内容
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
returnNumber | Y | String | “B200308115691” | 退货单号 |
orderNumber | Y | String | “S200222115613” | 销售订单号 |
onlineOrderNumber | Y | String | “DA200221115559” | 关联线上单号 |
status | Y | String | “FINISH” | 状态 |
returnSkuList | Y | List<ReturnSku> | 详见退货SKU |
ReturnSku(退货SKU)
参数 | 是否必须 | 类型 | 示例 | 备注 |
---|---|---|---|---|
sku | Y | String | “abc” | 商品SKU |
orderSkuId | Y | Number | 销售订单商品ID | |
quantity | Y | Number | 1 | 实际退货数量 |
JSON type:
{"serviceType":"PUSH_RETURN_ORDER_INFO","appId":"15167732016","sign":"b55826f1b417bd398aacf61aaa8abe23","bizParam":"{\"orderNumber\":\"THTZD000859\",\"returnSkuList\":[{\"orderSkuId\":45,\"quantity\":1,\"sku\":\"JCDF692024YH002\"}],\"onlineOrderNumber\":\"THTZD000859\",\"returnNumber\":\"B250801537077\",\"status\":\"WAIT_STORAGE\"}","timestamp":"1754033260116"}
FORM-DATA type:
{serviceType=PUSH_RETURN_ORDER_INFO,appId=15167732016,sign=b55826f1b417bd398aacf61aaa8abe23,bizParam={\"orderNumber\":\"THTZD000859\",\"returnSkuList\":[{\"orderSkuId\":45,\"quantity\":1,\"sku\":\"JCDF692024YH002\"}],\"onlineOrderNumber\":\"THTZD000859\",\"returnNumber\":\"B250801537077\",\"status\":\"WAIT_STORAGE\"},timestamp=1754033260116}