API ReferenceIntegrationsKnowledge Base

Items API

Items are products or services that you can add in Invoices and bill customers for. You can create an item using API.

API Gateway URL The API Gateway URL is https://api.razorpay.com/v1

Before executing these APIs, please read through the Pre-requisite and Generate API keys sections.

Generate API Keys#

  1. Log into your Dashboard with appropriate credentials.
  2. Select the mode (Test or Live) for which you want to generate the API key. Note:
    You have to generate separate API Keys for the test and live modes. No real money is used in test mode.
  3. Navigate to SettingsAPI KeysGenerate Key to generate key for the selected mode.

The Key Id and Key Secret appear in a pop-out window as shown below:

Note:
After generating the keys from the Dashboard, download and save them securely. If you do not remember your API Keys, you need to re-generate it from the Dashboard and replace it wherever required.

Postman Collection#

We have a Postman collection to make the integration quicker and easier. Click the Download Postman Collection button below to get started.

Instructions to use the Postman Collection#

  • All Razorpay APIs are authorized using Basic Authorization.
    • Generate API Keys from the Dashboard .
    • Add your API Keys in Postman. Selected the required API → Auth → Type = Basic Auth → Username = <Your_Key_ID>; Password = <Your_Key_secret>
  • Some APIs in the collection require data specific to your account such as item_id (Item ID) as a path parameter.
    • For example, the Fetch Item by ID API requires you to add the item_id as a path parameter.
    • Such parameters are enclosed in {} in the collection. For example, {item_id}.
    • The API throws an error if these values are incorrect or do not exist in your system. # Create an Item

Use this API endpoint to create an item.

/items

Request Parameters#

name mandatory
string Name of the item.
description optional
string A brief description about the item.
amount mandatory
integer The price of the item in the lowest unit of currency.
currency mandatory
string The currency in which the amount should be charged. We support international currencies.

Response Parameters#

id
string The unique identifier of the item.
name
string Name of the item.
description
string A brief description about the item.
amount _
integer The price of the item in the lowest unit of currency.
currency
string The currency in which the amount should be charged. We support international currencies.
active
boolean Indicates the status of the item. Possible values:
- true - Item is in active state.
- false - Item is in inactive state. By default, the item is in active state.

Fetch an Item#

Use this API endpoint retrieve to an item using its unique id.

/items/:id

Sample request and response to retrieve an item with id item_7Oxp4hmm6T4SCn is shown below:

Path Parameter#

id mandatory
string The unique identifier of the item whose details are to be fetched.

Response Parameters#

id
string The unique identifier of the item.
name
string Name of the item.
description
string A brief description about the item.
amount _
integer The price of the item in the lowest unit of currency.
currency
string The currency in which the amount should be charged. We support international currencies.
active
boolean Indicates the status of the item. Possible values:
- true - Item is in active state.
- false - Item is in inactive state. By default, the item is in active state.

Fetch Multiple Items#

Use this API endpoint to retrieve all the items created by you.

/items

Update an Item#

Use this API endpoint to modify the information of an existing item.

/items/:id

The request and response for updating an item with id item_7Oy8OMV6BdEAac is shown below:

Path Parameter#

id mandatory
string The unique identifer of the item whose details are to be updated.

Request Parameters#

name optional
string Name of the item.
description optional
string A brief description about the item.
amount optional
integer The price of the item in the lowest unit of currency.
currency optional
string The currency in which the amount should be charged. We support international currencies.
active optional
boolean Indicates the status of the item. Possible values:
- true - Item is in active state.
- false - Item is in inactive state. By default, the item is in active state.

Response Parameters#

id
string The unique identifier of the item.
name
string Name of the item.
description
string A brief description about the item.
amount
integer The price of the item in the lowest unit of currency.
currency
string The currency in which the amount should be charged. We support international currencies.
active
boolean Indicates the status of the item. Possible values:
- true - Item is in active state.
- false - Item is in inactive state. By default, the item is in active state.

Delete an Item#

Use this API endpoint to delete an existing item.

Note:
You cannot delete an item with which invoices have been created already. However, you can make it inactive using the Update an Item API.

/items/:id

The request and response for deleting an item id: item_7Oy8OMV6BdEAac is shown below:

×