This endpoint currently only supports returning amazon orders. Shopify support will come at a later date.

Arguments

input

The input object contains the orderId and line items. See the ReturnOrderInput object for more details.

Returns

ReturnOrderResponse.*

Any requested field from the ReturnOrderResponse object.

Example - request

Query arguments
{
    "input": {
        "orderId": "3f25547a-9cfc-4b36-b882-3666b693c441",
        "lineItems":[
            {"id":"B0BFX4SC26", "quantity":1},
            {"id":"B0C68W65D3", "quantity":1},
            {"id":"B01AXM4WV2", "quantity":1}
        ]
    }
}
GraphQL
mutation ($input: ReturnOrderInput!) {
    returnOrder(input:$input){
        result {
        ...on ReturnAmazonOrderResult { orders { returnId amazonOrderId lineItems {status, productId, quantity} } }
        ...on ReturnShopifyOrderResult { status }
        }
        error {
            message
            code
        }
    }
}

Calling the endpoint initiates a return request. Response below is an example response for an amazon order

Example - response

Response
{
    "data": {
        "returnOrder": {
            "result": {
                "orders": [
                    {
                        "returnId": "bd93158b-3abb-411a-bc62-b1fbd786cb61",
                        "amazonOrderId": "113-3749157-9026634",
                        "lineItems": [
                            {
                                "status": "RETURN_REQUESTED",
                                "productId": "B0BFX4SC26",
                                "quantity": 1
                            },
                            {
                                "status": "RETURN_REQUESTED",
                                "productId": "B0C68W65D3",
                                "quantity": 1
                            }
                        ]
                    },
                    {
                        "returnId": "e64e4fb9-57ed-4618-89db-3a1e48911cf2",
                        "amazonOrderId": "113-0355953-0101026",
                        "lineItems": [
                            {
                                "status": "RETURN_REQUESTED",
                                "productId": "B01AXM4WV2",
                                "quantity": 1
                            }
                        ]
                    }
                ]
            },
            "error": null
        }
    }
}

Errors

The error field will display errors not related to actual status of a return request.

Response
{
    "data": {
        "returnOrder": {
            "result": null,
            "error": {
                "message": "Request with product B01AXM4WV2 is already in progress",
                "code": "RETURN_IN_PROGRESS"
            }
        }
    }
}