xclade
Store APIReturns

Create Return

Create a return for an order's items. The admin receives the return and process it from their side.

POST
/store/returns

Header Parameters

x-publishable-api-key*string

Publishable API Key created in the Medusa Admin.

Request Body

application/json

order_id*string

The ID of the order this return is created for.

items*

The return's items.

return_shipping*

The return's shipping details.

note?string

A note with more details about the return.

receive_now?boolean

Whether to mark the return as received.

location_id?string

The ID of the location that items are returned to.

Response Body

application/json

application/json

text/plain

application/json

application/json

application/json

application/json

curl -X POST "https://{tenant}.api.myxclade.com/store/returns" \  -H "x-publishable-api-key: string" \  -H "Content-Type: application/json" \  -d '{    "order_id": "string",    "items": [      {        "id": "string",        "quantity": 0      }    ],    "return_shipping": {      "option_id": "string"    }  }'
{
  "return": {
    "items": [
      {
        "id": "string",
        "quantity": 0,
        "received_quantity": 0,
        "damaged_quantity": 0,
        "reason_id": "string",
        "note": "string",
        "item_id": "string",
        "return_id": "string",
        "metadata": {}
      }
    ],
    "status": "received",
    "id": "string",
    "display_id": 0,
    "created_at": "2019-08-24T14:15:22Z",
    "order_id": "string",
    "location_id": "string",
    "canceled_at": "string",
    "exchange_id": "string",
    "claim_id": "string",
    "refund_amount": 0,
    "received_at": "string"
  }
}

{
  "message": "Discount must be set to dynamic",
  "type": "not_allowed"
}

"Unauthorized"
{
  "message": "Entity with id 1 was not found",
  "type": "not_found"
}
{
  "code": "unknown_error",
  "message": "The request conflicted with another request. You may retry the request with the provided Idempotency-Key.",
  "type": "QueryRunnerAlreadyReleasedError"
}
{
  "code": "invalid_request_error",
  "message": "Discount with code TEST already exists.",
  "type": "duplicate_error"
}

{
  "code": "api_error",
  "message": "An error occured while hashing password",
  "type": "database_error"
}