This method allows to create a return good request with the desired products.

It creates a new return request in Pending status.

Use

Method Url
POST /restful/ghost/returnedgoods/request/new

Authentication

Remember to authenticate properly, using HTTP Basic Authentication with your API-Key as username and your password.

Request Headers

This method works using JSON or XML format, set the following headers to choose the format you want to use:

Key Value
Accept application/xml or application/json
Content-type application/xml or application/json

Request Body

The request body contains the orderId of the order and a list of desired products that will return. Each product has four attributes:

Reason Code

reasonCode Reason
0 Other
1 Purchased by mistake
2 Damaged item
3 Wrong item
4 Defective
5 Unordered
6 Not my size
7 Don't like product
8 Missing

Not all reason code listed above are available for all suppliers. Please contact your supplier to find the list of reason codes available.

Example XML Body

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<returnedGoodRequest orderId="912120">
    <returnedGoodRequestItem stockModelId="182179" quantity="1" reasonCode="2" notes="the item was damaged" requestExtRef="123"/>
    <returnedGoodRequestItem stockModelId="182180" quantity="1" reasonCode="3" notes="" requestExtRef="124"/>
    <returnedGoodRequestItem stockModelId="182180" quantity="2" reasonCode="1" notes="" requestExtRef="125"/>
</returnedGoodRequest>

Example JSON Body

{
    "orderId": "131",
    "returnedGoodRequestItem": [
      {
        "stockModelId": "3601",
        "quantity": "1",
        "reasonCode": "3",
        "notes": "the good was ripped apart",
        "requestExtRef": "123"
      }
    ]
}

Response Body

The response body contains the status of the request.

Example XML Response

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response message="" code="0" status="true"/>

Example JSON Response

{
    "ids": null,
    "status": true,
    "code": 0,
    "message": ""
}

Notes