> ## Documentation Index
> Fetch the complete documentation index at: https://better-auth-razorpay.amankushwaha.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Items

> Create, retrieve, list, edit, and delete Razorpay items through the plugin endpoints.

The items endpoints let you manage Razorpay items, which represent products or services that can be attached to plans, invoices, and subscriptions.

## Create item

`POST /api/auth/razorpay/item/create`

Creates a new Razorpay item.

**Server API name:** `createItem`\
**Client method:** `authClient.razorpay.item.create(...)`

**name** `string` *required*

Item name.

**amount** `integer` *required*

Item amount in the smallest currency subunit.

**currency** `string` *required*

ISO 4217 currency code.

**description** `string`

Item description.

**active** `boolean`

Whether the item is active. Defaults to `true`.

**tax\_inclusive** `boolean`

Whether the amount includes tax.

**hsn\_code** `string`

HSN code for GST purposes.

**sac\_code** `string`

SAC code for GST purposes.

**tax\_rate** `number`

Tax rate percentage.

**tax\_id** `string`

Razorpay tax id.

**tax\_group\_id** `string`

Razorpay tax group id.

> [!NOTE]
>
> Errors: `ITEM_CREATE_FAILED`.

```ts client.ts theme={null}
const { data, error } = await authClient.razorpay.item.create({
  name: "Pro Plan Base",
  amount: 50000,
  currency: "INR",
  description: "Base fee for the Pro plan",
  active: true,
});
```

```ts server.ts theme={null}
const result = await auth.api.createItem({
  body: {
    name: "Pro Plan Base",
    amount: 50000,
    currency: "INR",
    description: "Base fee for the Pro plan",
    active: true,
  },
  headers: await headers(),
});
```

## Get item

`GET /api/auth/razorpay/item/get`

Retrieves a single Razorpay item by id.

**Server API name:** `fetchItem`\
**Client method:** `authClient.razorpay.item.get({ query: { itemId } })`

**itemId** `string` *required*

Razorpay item id.

> [!NOTE]
>
> Errors: `ITEM_NOT_FOUND`.

```ts client.ts theme={null}
const { data, error } = await authClient.razorpay.item.get({
  query: { itemId: "item_XXXX" },
});
```

```ts server.ts theme={null}
const result = await auth.api.fetchItem({
  query: { itemId: "item_XXXX" },
  headers: await headers(),
});
```

## List items

`GET /api/auth/razorpay/item/list`

Lists Razorpay items with pagination and optional filters.

**Server API name:** `listItems`\
**Client method:** `authClient.razorpay.item.list({ query: { ... } })`

**from** `integer`

Unix timestamp. Return items created after this time.

**to** `integer`

Unix timestamp. Return items created before this time.

**count** `integer`

Maximum number of items to return. Maximum value is `100`.

**skip** `integer`

Number of items to skip.

**active** `integer`

Filter by active status. Use `1` for active or `0` for inactive.

> [!NOTE]
>
> Errors: `ITEM_LIST_FAILED`.

```ts client.ts theme={null}
const { data, error } = await authClient.razorpay.item.list({
  query: { count: 10, skip: 0, active: 1 },
});
```

```ts server.ts theme={null}
const result = await auth.api.listItems({
  query: { count: 10, skip: 0, active: 1 },
  headers: await headers(),
});
```

## Edit item

`POST /api/auth/razorpay/item/edit`

Updates an existing Razorpay item.

**Server API name:** `editItem`\
**Client method:** `authClient.razorpay.item.edit(...)`

**itemId** `string` *required*

Razorpay item id to update.

**name** `string`

Updated item name.

**amount** `integer`

Updated amount in subunits.

**currency** `string`

Updated currency code.

**description** `string`

Updated description.

**active** `boolean`

Updated active status.

**tax\_inclusive** `boolean`

Updated tax inclusive setting.

**hsn\_code** `string`

Updated HSN code.

**sac\_code** `string`

Updated SAC code.

**tax\_rate** `number`

Updated tax rate.

**tax\_id** `string`

Updated tax id.

**tax\_group\_id** `string`

Updated tax group id.

> [!NOTE]
>
> Errors: `ITEM_EDIT_FAILED`.

```ts client.ts theme={null}
const { data, error } = await authClient.razorpay.item.edit({
  itemId: "item_XXXX",
  name: "Pro Plan Base Updated",
  amount: 60000,
});
```

```ts server.ts theme={null}
const result = await auth.api.editItem({
  body: {
    itemId: "item_XXXX",
    name: "Pro Plan Base Updated",
    amount: 60000,
  },
  headers: await headers(),
});
```

## Delete item

`POST /api/auth/razorpay/item/delete`

Deletes a Razorpay item.

**Server API name:** `deleteItem`\
**Client method:** `authClient.razorpay.item.delete(...)`

**itemId** `string` *required*

Razorpay item id to delete.

> [!NOTE]
>
> Errors: `ITEM_DELETE_FAILED`.

```ts client.ts theme={null}
const { data, error } = await authClient.razorpay.item.delete({
  itemId: "item_XXXX",
});
```

```ts server.ts theme={null}
const result = await auth.api.deleteItem({
  body: { itemId: "item_XXXX" },
  headers: await headers(),
});
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.