## Overview

In order to create a new RMA, you can consume the endpoint presented in this article. To consume it, you must:

- Be an authenticated user

For information on how you can authenticate, see: [Authentication](https://developer.sellercloud.com/dev-article/authentication/)

As soon as you do authentication and receive a valid token, it needs to be passed to the service call.

## Endpoint

Example for such endpoint for **TT** server is:

https://tt.api.sellercloud.com/rest/api/Rma

For your server endpoint will be:

https://{your_server_id}.api.sellercloud.com/rest/api/Rma

## Request

- Method Type: **HttpPost**
- Authorization: Use **Bearer Token** (where ‘Token’ is the token received from token authentication)
- Header info: **Content-Type: application/json**
- Request Body:

```
{
  "OrderID": 0,
  "OrderItems": [
    {
      "OrderItemID": 0,
      "QtyToReturn": 0,
      "ReasonID": 0,
      "Description": "string",
      "BundleItems": [
        {
          "ProductID": "string",
          "QtyToReturn": 0,
          "ReasonID": 0,
          "Description": "string"
        }
      ]
    }
  ]
}
```

| **Parameter**                     | **Data Type** | **Description**                                                                                                   | **Is Required** |
|-----------------------------------|----------------|-------------------------------------------------------------------------------------------------------------------|------------------|
| OrderID                           | integer        | ID of existing order                                                                                               | true             |
| OrderItems                        | List           | List of order items for which to create RMA                                                                      | true             |
| OrderItem.OrderItemID            | integer        | ID of order item                                                                                                   | true             |
| OrderItem.QtyToReturn            | int            | Qty of this order item to return. If the OrderItem is a kit this property has to be omitted and BundleItems have to be provided.<br>RMA cannot be created for kit parent. Exception is the independent kit for which RMA can be created either for the order item or its kit items meaning that either OrderItem.QtyToReturn or OrderItem.BundleItems can be provided. | false            |
| OrderItem.ReasonID               | integer        | ID of return reason.<br>List of possible return reasons can be obtained from service “Get RMA Items Return Reasons List”. | false            |
| OrderItem.Description             | string         | Description for why the item is returned                                                                           | false            |
| OrderItem.BundleItems             | List           | List of kit items in case the order item is a kit or if RMA for independent kit items needs to be created.<br>This property is required for non-independent kits. | false            |
| OrderItem.BundleItem.ProductID    | string         | Product ID of the bundle item                                                                                      | true             |
| OrderItem.BundleItem.QtyToReturn  | integer        | Quantity to return                                                                                                | true             |
| OrderItem.BundleItem.ReasonID     | integer        | ID of return reason.<br>List of possible return reasons can be obtained from service “Get RMA Items Return Reasons List”. | true             |
| OrderItem.BundleItem.Description   | string         | Description for why the item is returned                                                                           | false            |

## Response

- If the user is authenticated and the creation of RMA is successful, then the response will be **Status Code 200 => OK** and the ID of the created RMA will be returned.
- If the user is not authenticated, then the response will be **Status Code 401 => Not Valid Token**.
- In case of an error, the response will be **Status Code 500 => Internal Server Error**.
