---
displayed_sidebar: jsClientSidebar
slug: /references/js-client/ReturnReasonsResource
---

import ParameterTypes from "@site/src/components/ParameterTypes"

# ReturnReasonsResource

This class is used to send requests to [Store Return Reason API Routes](https://docs.medusajs.com/api/store#return-reasons). All its method
are available in the JS Client under the `medusa.returnReasons` property.

Return reasons are key-value pairs that are used to specify why an order return is being created.

## Methods

### list

Retrieve a list of Return Reasons. This is useful when implementing a Create Return flow in the storefront.

#### Example

```ts
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.returnReasons.list()
.then(({ return_reasons }) => {
  console.log(return_reasons.length);
})
```

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "customHeaders",
    "type": "`Record<string, any>`",
    "description": "Custom headers to attach to the request.",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/js-client/overview#expanding-fields"/>

#### Returns

<ParameterTypes parameters={[
  {
    "name": "ResponsePromise",
    "type": "ResponsePromise&#60;StoreReturnReasonsListRes&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Resolves to the list of return reasons.",
    "expandable": false,
    "children": [
      {
        "name": "return_reasons",
        "type": "[ReturnReason](../../entities/classes/entities.ReturnReason.mdx)[]",
        "description": "An array of return reasons details.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "created_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was created.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "deleted_at",
            "type": "`null` \\| `Date`",
            "description": "The date with timezone at which the resource was deleted.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "description",
            "type": "`string`",
            "description": "A description of the Reason.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "id",
            "type": "`string`",
            "description": "The return reason's ID",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "label",
            "type": "`string`",
            "description": "A text that can be displayed to the Customer as a reason.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "metadata",
            "type": "`Record<string, unknown>`",
            "description": "An optional key-value map with additional details",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "parent_return_reason",
            "type": "`null` \\| [ReturnReason](../../entities/classes/entities.ReturnReason.mdx)",
            "description": "The details of the parent reason.",
            "optional": false,
            "defaultValue": "",
            "expandable": true,
            "children": []
          },
          {
            "name": "parent_return_reason_id",
            "type": "`null` \\| `string`",
            "description": "The ID of the parent reason.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "return_reason_children",
            "type": "[ReturnReason](../../entities/classes/entities.ReturnReason.mdx)[]",
            "description": "The details of the child reasons.",
            "optional": false,
            "defaultValue": "",
            "expandable": true,
            "children": [
              {
                "name": "created_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was created.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "deleted_at",
                "type": "`null` \\| `Date`",
                "description": "The date with timezone at which the resource was deleted.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "description",
                "type": "`string`",
                "description": "A description of the Reason.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "id",
                "type": "`string`",
                "description": "The return reason's ID",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "label",
                "type": "`string`",
                "description": "A text that can be displayed to the Customer as a reason.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "metadata",
                "type": "`Record<string, unknown>`",
                "description": "An optional key-value map with additional details",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "parent_return_reason",
                "type": "`null` \\| [ReturnReason](../../entities/classes/entities.ReturnReason.mdx)",
                "description": "The details of the parent reason.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "parent_return_reason_id",
                "type": "`null` \\| `string`",
                "description": "The ID of the parent reason.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "return_reason_children",
                "type": "[ReturnReason](../../entities/classes/entities.ReturnReason.mdx)[]",
                "description": "The details of the child reasons.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "updated_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was updated.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "value",
                "type": "`string`",
                "description": "The value to identify the reason by.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              }
            ]
          },
          {
            "name": "updated_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was updated.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "value",
            "type": "`string`",
            "description": "The value to identify the reason by.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      }
    ]
  }
]} />

___

### retrieve

Retrieve a Return Reason's details.

#### Example

```ts
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.returnReasons.retrieve(reasonId)
.then(({ return_reason }) => {
  console.log(return_reason.id);
})
```

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "id",
    "type": "`string`",
    "description": "The ID of the return reason.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "customHeaders",
    "type": "`Record<string, any>`",
    "description": "Custom headers to attach to the request.",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/js-client/overview#expanding-fields"/>

#### Returns

<ParameterTypes parameters={[
  {
    "name": "ResponsePromise",
    "type": "ResponsePromise&#60;StoreReturnReasonsRes&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "Resolves to the return reason's details.",
    "expandable": false,
    "children": [
      {
        "name": "return_reason",
        "type": "[ReturnReason](../../entities/classes/entities.ReturnReason.mdx)",
        "description": "Return reason details.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "created_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was created.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "deleted_at",
            "type": "`null` \\| `Date`",
            "description": "The date with timezone at which the resource was deleted.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "description",
            "type": "`string`",
            "description": "A description of the Reason.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "id",
            "type": "`string`",
            "description": "The return reason's ID",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "label",
            "type": "`string`",
            "description": "A text that can be displayed to the Customer as a reason.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "metadata",
            "type": "`Record<string, unknown>`",
            "description": "An optional key-value map with additional details",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "parent_return_reason",
            "type": "`null` \\| [ReturnReason](../../entities/classes/entities.ReturnReason.mdx)",
            "description": "The details of the parent reason.",
            "optional": false,
            "defaultValue": "",
            "expandable": true,
            "children": []
          },
          {
            "name": "parent_return_reason_id",
            "type": "`null` \\| `string`",
            "description": "The ID of the parent reason.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "return_reason_children",
            "type": "[ReturnReason](../../entities/classes/entities.ReturnReason.mdx)[]",
            "description": "The details of the child reasons.",
            "optional": false,
            "defaultValue": "",
            "expandable": true,
            "children": [
              {
                "name": "created_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was created.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "deleted_at",
                "type": "`null` \\| `Date`",
                "description": "The date with timezone at which the resource was deleted.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "description",
                "type": "`string`",
                "description": "A description of the Reason.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "id",
                "type": "`string`",
                "description": "The return reason's ID",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "label",
                "type": "`string`",
                "description": "A text that can be displayed to the Customer as a reason.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "metadata",
                "type": "`Record<string, unknown>`",
                "description": "An optional key-value map with additional details",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "parent_return_reason",
                "type": "`null` \\| [ReturnReason](../../entities/classes/entities.ReturnReason.mdx)",
                "description": "The details of the parent reason.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "parent_return_reason_id",
                "type": "`null` \\| `string`",
                "description": "The ID of the parent reason.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "return_reason_children",
                "type": "[ReturnReason](../../entities/classes/entities.ReturnReason.mdx)[]",
                "description": "The details of the child reasons.",
                "optional": false,
                "defaultValue": "",
                "expandable": true,
                "children": []
              },
              {
                "name": "updated_at",
                "type": "`Date`",
                "description": "The date with timezone at which the resource was updated.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              },
              {
                "name": "value",
                "type": "`string`",
                "description": "The value to identify the reason by.",
                "optional": false,
                "defaultValue": "",
                "expandable": false,
                "children": []
              }
            ]
          },
          {
            "name": "updated_at",
            "type": "`Date`",
            "description": "The date with timezone at which the resource was updated.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "value",
            "type": "`string`",
            "description": "The value to identify the reason by.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      }
    ]
  }
]} />
