# Create After Sales

# Dxplaination of Interface Call Request

An error code of 100000 is returned when the original status of the order is 10,200,250

When finish_all_aftersale = 1, the order status will flow to 200 (all aftersale ends, no aftersale can be continued)

This interface supports re-entry by order number

http请求方式:POST
https://api.weixin.qq.com/shop/aftersale/add?access_token=xxxxxxxxx

# Example of request parameters

{
    "out_order_id": "xxxxx",
    "out_aftersale_id": "xxxxxx",   // 商家售后ID
    "openid": "oTVP50O53a7jgmawAmxKukNlq3XI",
    "type": 1,          // 1:退款,2:退款退货,3:换货
    "create_time": "2020-12-01 00:00:00",
    "status": 1, 
    "finish_all_aftersale": 0, 
    "path": "/pages/aftersale.html?out_aftersale_id=xxxxx",
    "refund": 100,
    "product_infos":
    [
        {
            "out_product_id": "234245",
            "out_sku_id": "23424",
            "product_cnt": 5
        },
        ...
    ]
}

# Examples of back-up

{
    "errcode": 0,
    "errmsg":"ok"
}

# Dxplaination of request parameters

参数 type Is it compulsory? Introductions
out_order_id string yes Merchant Custom Order ID
out_aftersale_id string yes Merchant custom after-sales ID
path string yes Merchant Weixin Mini Program The page path for the order, if it does not exist, use the order path
refund number yes Amount of refund, in units: units
openid string yes User's openid
type number yes Aftersales Type, 1: Refund, 2: Refund Return, 3: Exchange
create_time string yes Time to initiate application, yyyy-MM-dd HH: mm: ss
status number yes 0: Not accepted, 1: User cancelled, 2: Merchant accepted, 3: Merchant overdue not processed, 4: Merchant refuses to refund, 5: Merchant declines to refund the item, 6: Purchase returned, 7: Return refund closed, 8: Merchant receiving, 11: Merchant refunded, 12: Merchant past due No refund, 13: Refund completed, 14: Return completed Refund finished, 15: Exchange completed, 16: Shipment pending delivery by merchant, 17: Customer confirmed receipt, 18: Merchant refused to exchange, 19: Merchant received
finish_all_aftersale number yes 0: There are items available for sale on the order, 1: All items on the order are completed after sale (order dimension)
product_infos object array yes List of return related items
product_infos[].out_product_id string yes Merchant Custom Item ID
product_infos[].out_sku_id string yes Business custom sku ID, if not then do not fill
product_infos[].product_cnt number Required when product_infos exists Number of items involved in after sales
refund_reason string no Reasons for refund

# Dxplaination of callback parameters

参数 type Introductions
errcode number Error code
errmsg string Error message