1. Refound
API URL
post {HTTP(S)host} /api/{version}/returnOrder
1.1. create refound order
1.1.1. SERVICE_TYPE
CREATE_RETURN_ORDER
1.1.2. Request
| Params | Require | DataType | Sample | Description |
|---|---|---|---|---|
| orderNumber | N | String | “S200305115680” | QERP System order number |
| warehouse | Y | String | “FBA美国” | Return warehouse, up to 50 characters |
| shop | Y | String | “测试 Shop ” | Refund Shopwith a maximum of 50 characters. If you fill in the orderNumber, the order must belong to the same shop as shop |
| expectArriveTime | N | String | “2020-03-06” | Estimated time of arrival yyyy-MM-dd |
| reason | N | String | “买错了” | The reason for the return, up to 512 characters |
| remark | N | String | Description | |
| carrier | N | String | carrierwith a maximum of 50 characters | |
| customNumber | N | String | Tracking numberwith a maximum of 50 characters | |
| autoCommit | N | Boolean | true / false | Whether it is submitted automatically, true: the user does not need to manually click submit in Qianyi ERP |
| returnSkuList | List<ReturnSku> | See ReturnSku | ||
| refundCustomFieldValueVOList | N | List<SkuCustomFieldValueVO> | Custom fields |
ReturnSku(refund details)
| Params | Require | DataType | Sample | Description |
|---|---|---|---|---|
| orderSkuId | O | Number | 113 | The product ID of the sales order is obtained from the Order query interface. If it is a combination product, only the sub-product is taken. (Fill in orderSkuId or sku.) When the orderNumber is passed, the orderSkuId shall prevail) |
| sku | O | String | QERP sku(For the SKU of a single product, you can confirm the specific detail line) (orderSkuId and sku can be filled in, and orderSkuId shall prevail) (when the orderNumber is not passed, the sku must be passed and cannot be a combination) | |
| quantity | Y | Number | 1 | Number of returns |
| storageLocationCode | N | String | Storage location code, if null get SYS LOC | |
| remark | N | String | Description |
SkuCustomFieldValueVO(Custom fields)
| 参数 | 是否必须 | 类型 | 示例 | 备注 |
|---|---|---|---|---|
| customFieldId | Y | Long | 3 | CUSTOMER_FIELD_QUERY in SERVICE_TYPE Specifies the id returned by the interface |
| value | Y | String | “Zhang SAN” | Custom values for fields |
1.1.3. Reponse
| Params | Require | DataType | Sample | Description |
|---|---|---|---|---|
| errorCode | Y | String | “DATA_INPUT_ERROR” | Error Code |
| errorMsg | Y | String | “The input of Params is incorrect” | Business Error Messages |
| state | Y | String | success | Response State |
| result | Y | ReturnOrder | See ReturnOrder |
Request:
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"'
Response:
{
"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. Cancel refound
1.2.1. SERVICE_TYPE
CLOSE_RETURN_ORDER
1.2.2. Request
| Params | Require | DataType | Sample | Description |
|---|---|---|---|---|
| returnNumber | Y | String | “B200308115691” | refound order number |
1.2.3. Reponse
| Params | Require | DataType | Sample | Description |
|---|---|---|---|---|
| errorCode | Y | String | “DATA_INPUT_ERROR” | Error Code |
| errorMsg | Y | String | “The input of Params is incorrect” | Business Error Messages |
| state | Y | String | success | Response State |
Request:
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"'
Response:
{
"state": "success",
"errorCode": "",
"errorMsg": "",
"bizContent": "{\"notSuccess\":false,\"state\":\"success\"}",
"requestId": "2ffaa7df-073b-4e74-8aaa-02bf1bd45e18"
}
1.3. Query refund order list
1.3.1. SERVICE_TYPE
QUERY_RETURN_ORDER_LIST
1.3.2. Request
| Params | Require | DataType | Sample | Description |
|---|---|---|---|---|
| returnNumber | N | String | “S200222115613” | System return number, up to 50 characters |
| warehouse | N | String | Warehouse name,with a maximum of 50 characters | |
| status | N | String | Return order status. For After-sales Management (New), use returnStatus | |
| statusList | N | List |
["FINISH","CLOSE"] | Return status list. For After-sales Management (New), use returnStatusList |
| returnStatus | N | String | FINISH | After-sales Management (New) return status, use this instead of status. See enums |
| returnStatusList | N | List |
["FINISH","CLOSE"] | After-sales Management (New) return status list, use this instead of statusList |
| refundStatus | N | String | WAIT_PAYMENT | After-sales Management (New) refund status. See enums |
| refundStatusList | N | List |
["WAIT_PAYMENT","FINISH"] | After-sales Management (New) refund status list |
| fromCreateTime | N | String | “2020-03-04” | Begin of Creation time yyyy-MM-dd HH:mm:ss |
| toCreateTime | N | String | “2020-03-26” | End of Creation time yyyy-MM-dd HH:mm:ss |
| updateTimeFrom | N | String | 2021-08-01 | Refund Update time , accurate to the "day" |
| updateTimeTo | N | String | 2021-08-01 | Refund Update time , accurate to the "day" |
| finishTimeFrom | N | String | 2023-08-01 | Refund Completion time to the "hour, minute, second" |
| finishTimeTo | N | String | 2023-08-01 | Refund Completion time to the "hour, minute, second" |
| receiveTimeFrom | N | String | 2023-08-01 | Receipt time from, accurate to the "hour, minute, second" |
| receiveTimeTo | N | String | 2023-08-01 | Receipt time to, accurate to the "hour, minute, second" |
| shopIdList | N | List<Long> | [1,2,3] | Shop id list |
| shopGroupIdList | N | List<Long> | [1,2,3] | ShopGroupId list |
| page | Y | Number | 1 | Page number, default 1 |
| pageSize | Y | Number | 50 | Number of records per page. no more than 200; Default is 100 |
| withoutType | N | Boolean | True | At the same time, the refund note, refund, and replacement invoice will be returned |
| withCommitTime | N | Boolean | True | The submission time is also returned |
| orderStatus | N | String | "CLOSED", "SHIPPED", "WAIT_AUDIT", "WAIT_SHIP" | System Status Of Order |
1.3.3. After-sales status compatibility
returnStatus/returnStatusListcannot be combined with legacystatus/statusList. If any non-empty new return condition and any non-empty legacy return condition are supplied together, the API returnsreturn.order.status.param.conflict, even when their values are identical.refundStatus/refundStatusListmay be combined with either return-status field set. Conditions across dimensions, and a scalar plus list in the same dimension, are evaluated with AND semantics and never silently override each other.- The new request and response fields use the original main after-sales order status. If Lazada detail refund statuses differ, the main
refundStatusmay be omitted; filtering only matches the main order and does not aggregate detail statuses. - Refund-only orders are not forced to return
NO_NEED_RETURN; historical main-order statuses are returned unchanged. - Nulls, blank strings, and empty lists are treated as absent. Blank or invalid elements in a non-empty list are rejected, and a status list may contain at most 200 items.
1.3.4. Reponse
| Params | Require | DataType | Sample | Description |
|---|---|---|---|---|
| errorCode | Y | String | “DATA_INPUT_ERROR” | Error Code |
| errorMsg | Y | String | “The input of Params is incorrect” | Business Error Messages |
| state | Y | String | success | Response State |
| total | Y | Number | 100 | Total num |
| result | Y | List<ReturnOrder> | See ReturnOrder |
ReturnOrder(Refund )
| Params | Require | DataType | Sample | Description |
|---|---|---|---|---|
| returnNumber | Y | String | “B200305115684” | return number |
| createTime | Y | timestamp | 1583410532000 | Timestamp, in milliseconds |
| updateTime | Y | timestamp | 1583410532000 | Timestamp, in milliseconds |
| commitTime | N | timestamp | 1583410532000 | Timestamp, in milliseconds |
| finishTime | N | timestamp | 1583410532000 | Timestamp, in milliseconds |
| receiveTime | N | timestamp | 1583410532000 | Receipt time, timestamp in milliseconds |
| orderNumber | N | String | Sales Order number | |
| onlineOrderNumber | N | String | “DA200221115559” | online Order ,ref Order |
| buyerId | N | String | “user123” | Buyer ID |
| warehouse | Y | String | “GWMS” | warehouse |
| warehouseId | N | Long | 1001 | ERP warehouse primary key; use this when warehouse name may change |
| status | Y | String | “FINISH” | Refund order status. For After-sales Management (New), see returnStatus |
| returnStatus | N | String | “FINISH” | After-sales Management (New) return status, use this instead of status |
| refundStatus | N | String | “WAIT_PAYMENT” | After-sales Management (New) refund status |
| returnSkuList | Y | List<ReturnSku> | See refund SKU | |
| carrier | N | String | carrier | |
| customNumber | N | String | Tracking number | |
| reason | N | String | “Bought the wrong one” | Reason for return |
| shop | N | String | Shop name | |
| currency | N | String | CNY | Monetary unit |
| orderRefundAmount | N | BigDecimal | The total refunded amount of order | |
| asnNumber | N | String | Inbound order number | |
| asnId | N | String | Inbound order ID | |
| type | Y | String | RETURN(退款单)、SALES_RETURN(Refund )、RESHIP(补发货单) | |
| refundCustomFieldValueVOList | N | List<SkuCustomFieldValueVO> | ||
| totalAmount | N | BigDecimal | Total amount | |
| orderStatus | N | String | "CLOSED", "SHIPPED", "WAIT_AUDIT", "WAIT_SHIP" | System Status Of Order |
SkuCustomFieldValueVO(Custom fields)
| 参数 | 是否必须 | 类型 | 示例 | 备注 |
|---|---|---|---|---|
| tableName | Y | String | SYS_REFUND | SYS_ITEM: system item custom field; SYS_ORDER: order custom field; SYS_ODO: custom field of the outbound ticket; SYS_ASN: custom field of entry ticket; SYS_REFUND: indicates after-sales management. |
| columType | Y | String | NUMBER | Filters custom fields for different fill types NUMBER: number; DATE: date; STRING: indicates a character string. SELECT: indicates the drop-down box. |
| columName | Y | String | Production date | User-defined field name |
| defaultValue | N | String | "1970/01/01"(unparalleled quotes) | Custom field defaults |
| candidateValue | N | String | ["1970/01/01","1970/01/02"] | The candidate value of the drop-down box |
| remark | N | String | The date of release is different from the date of delivery | remark |
| required | N | Integer | 1 | whether to check only the required columns 1:true;0:false |
| isQuery | N | Integer | 1 | Whether to query only the columns that support query 1:true;0:false |
| isShow | N | Integer | 1 | Whether to query only columns that support column configuration 1:true;0:false |
ReturnSku(refund sku details)
| Params | Require | DataType | Sample | Description |
|---|---|---|---|---|
| sku | Y | String | “abc” | sku |
| orderSkuId | Y | Number | orderSkuId | |
| quantity | Y | Number | 1 | The actual number of returns |
| itemRefundAmount | N | BigDecimal | The total refunded amount for the order item | |
| selected | Y | Number | 1 | Whether the Refund details are visible on the page, 1: Visible, 0: Invisible |
| storageLocationCode | N | String | "SYS LOC" | Warehouse location information |
| refundAmount | N | BigDecimal | Refund amount of detail | |
| goodQuantity | N | Number | Quantity of good product | |
| badQuantity | N | Number | Quantity of defective product | |
| locAndQuantityList | N | List <LocAndQuantity> |
Warehouse location code and receive quantity from inbound order |
LocAndQuantity(Warehouse location code and receive quantity from inbound order)
| Params | Require | DataType | Sample | Description |
|---|---|---|---|---|
| storageLocationCode | Y | String | Warehouse location code | |
| receiveQuantity | Y | Number | Receive quantity |
Request:
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"'
Response:
{
"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"
}