> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Returns

> This endpoint retrieves a paginated list of return requests based on specified filters and sorting options.

### Body

<ParamField body="limit" required="true" type="string">
  This is the limit of the returns.
</ParamField>

<ParamField body="offset" required="true" type="string">
  This is the offset of the returns.
</ParamField>

<ParamField body="order_direction" required="true" type="string">
  This is the order direction of the returns.
</ParamField>

<ParamField body="status" required="true" type="string">
  This is the status of the returns.
</ParamField>

### Response

<ResponseField name="id" type="string">
  This is the id of the return.
</ResponseField>

<ResponseField name="created_date" type="string">
  This is the date the return was created.
</ResponseField>

<ResponseField name="amount" type="string">
  This is the amount of the return.
</ResponseField>

<ResponseField name="action_needed" type="string">
  This is the action needed for the return.
</ResponseField>

<ResponseField name="condition" type="string">
  This is the condition of the return.
</ResponseField>

<ResponseField name="customerEmail" type="string">
  This is the email of the customer.
</ResponseField>

<ResponseField name="customer_id" type="string">
  This is the id of the customer.
</ResponseField>

<ResponseField name="description" type="string">
  This is the description of the return.
</ResponseField>

<ResponseField name="enteredBy" type="string">
  This is the id of the user who entered the return.
</ResponseField>

<ResponseField name="flat_rate_shipping" type="string">
  This is the flat rate shipping of the return.
</ResponseField>

<ResponseField name="order_date" type="string">
  This is the date of the order.
</ResponseField>

<ResponseField name="order_id" type="string">
  This is the id of the order.
</ResponseField>

<ResponseField name="reason_category" type="string">
  This is the reason category of the return.
</ResponseField>

<ResponseField name="reported_condition" type="string">
  This is the reported condition of the return.
</ResponseField>

<ResponseField name="requested_date" type="string">
  This is the requested date of the return.
</ResponseField>

<ResponseField name="rma" type="string">
  This is the rma of the return.
</ResponseField>

<ResponseField name="serial_number" type="string">
  This is the serial number of the return.
</ResponseField>

<ResponseField name="shipped_date" type="string">
  This is the shipped date of the return.
</ResponseField>

<ResponseField name="status" type="string">
  This is the status of the return.
</ResponseField>

<ResponseField name="tax_refunded" type="string">
  This is the tax refunded of the return.
</ResponseField>

<ResponseField name="total_refunded" type="string">
  This is the total refunded of the return.
</ResponseField>

<ResponseField name="tracking_number" type="string">
  This is the tracking number of the return.
</ResponseField>

<ResponseField name="return_line_items" type="object">
  This is the line items of the return.

  <Expandable title="Show child attributes">
    <ResponseField name="id" type="string">
      This is the id of the return line item.
    </ResponseField>

    <ResponseField name="amount" type="string">
      This is the amount of the return line item.
    </ResponseField>

    <ResponseField name="condition" type="string">
      This is the condition of the return line item.
    </ResponseField>

    <ResponseField name="flat_rate_shipping" type="string">
      This is the flat rate shipping of the return line item.
    </ResponseField>

    <ResponseField name="name" type="string">
      This is the name of the return line item.
    </ResponseField>

    <ResponseField name="price" type="string">
      This is the price of the return line item.
    </ResponseField>

    <ResponseField name="return_id" type="string">
      This is the id of the return associated with the line item.
    </ResponseField>

    <ResponseField name="serial_number" type="string">
      This is the serial number of the return line item.
    </ResponseField>

    <ResponseField name="sku" type="string">
      This is the sku of the return line item.
    </ResponseField>

    <ResponseField name="tax_refunded" type="string">
      This is the tax refunded of the return line item.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request GET 'https://api.stateset.app/api/returns' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <token>' \
  --data-raw '{
      "limit": 10,
      "offset": 0,
      "order_direction": "desc",
      "status": "Requested"
  }'

  ```

  ```graphQL GraphQL theme={null}
  query ($limit: Int!, $offset: Int!, $order_direction: OrderDirection!, $status: ReturnStatus!) {
    returns(limit: $limit, offset: $offset, order_by: {created_date: $order_direction}, where: {status: {_eq: $status }}) {
      id
      created_date
      amount
      action_needed
      condition
      customerEmail
      customer_id
      description
      enteredBy
      flat_rate_shipping
      order_date
      order_id
      reason_category
      reported_condition
      requested_date
      rma
      serial_number
      shipped_date
      status
      tax_refunded
      total_refunded
      tracking_number
      return_line_items {
        id
        amount
        condition
        flat_rate_shipping
        name
        price
        return_id
        serial_number
        sku
        tax_refunded
      }
    }
  }

  ```

  ```js Node.js theme={null}
  const returns = await stateset.returns.list({
    limit: 10,
    offset: 0,
    order_direction: 'desc',
    status: 'Requested'
  });

  ```

  ```py Python theme={null}
  returns = stateset.returns.list({
    "limit": 10,
    "offset": 0,
    "order_direction": "desc",
    "status": "Requested"
  })

  ```

  ```go Golang  theme={null}
  returns, err := stateset.Returns.List(
    10,        // limit
    0,         // offset
    "desc",    // order_direction
    "Requested", // status
  )
  if err != nil {
      // Handle error
  }

  ```

  ```ruby Ruby theme={null}
  returns = Stateset::Returns.list(
    limit: 10,
    offset: 0,
    order_direction: 'desc',
    status: 'Requested'
  )

  ```

  ```java Java theme={null}
  Returns returns = Stateset.Returns.list(
    10,            // limit
    0,             // offset
    "desc",        // order_direction
    "Requested"    // status
  );

  ```

  ```csharp C# theme={null}
  Returns returns = Stateset.Returns.List(
    limit: 10,
    offset: 0,
    order_direction: "desc",
    status: "Requested"
  );

  ```

  ```php PHP theme={null}
  $returns = Stateset\Returns::list([
    'limit' => 10,
    'offset' => 0,
    'order_direction' => 'desc',
    'status' => 'Requested'
  ]);

  ```

  ```http HTTP theme={null}
  GET /api/returns HTTP/1.1
  Host: stateset-proxy-server.stateset.cloud.stateset.app
  Content-Type: application/json
  Authorization: Bearer <token>

  {
      "limit": 10,
      "offset": 0,
      "order_direction": "desc",
      "status": "Requested"
  }

  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "returns": [
          {
              "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
              "created_date": "2023-06-28T19:34:59.189838+00:00",
              "amount": "150.00",
              "action_needed": "Inspection",
              "condition": "Damaged",
              "customerEmail": "customer@example.com",
              "customer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "description": "The product arrived damaged.",
              "enteredBy": "1c0a3e4b-7e2d-4b1a-8d6c-3f2e4a5b6c7d",
              "flat_rate_shipping": "10.00",
              "order_date": "2023-06-20T15:30:00+00:00",
              "order_id": "2b8e4f64-1234-5678-9abc-def012345678",
              "reason_category": "Product Damage",
              "reported_condition": "Damaged",
              "requested_date": "2023-06-28T19:30:00+00:00",
              "rma": "RMA123456",
              "serial_number": "SN789456123",
              "shipped_date": "2023-06-29T10:00:00+00:00",
              "status": "Approved",
              "tax_refunded": "5.00",
              "total_refunded": "165.00",
              "tracking_number": "TRK1234567890",
              "return_line_items": [
                  {
                      "id": "a3f5c10b-58cc-4372-a567-0e02b2c3d480",
                      "amount": "75.00",
                      "condition": "Damaged",
                      "flat_rate_shipping": "5.00",
                      "name": "Widget Pro",
                      "price": "75.00",
                      "return_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
                      "serial_number": "SN789456123",
                      "sku": "SKU12345",
                      "tax_refunded": "2.50"
                  }
              ]
          }
      ]
  }

  ```
</ResponseExample>
