curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-H "Content-Type: application/json" \
-X POST https://api.razorpay.com/v1/items \
-d '{
"name":"Book / English August",
"description":"An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
}'
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
JSONObject itemRequest = new JSONObject();
itemRequest.put("name","Book / English August");
itemRequest.put("description","An indian story, Booker prize winner.");
itemRequest.put("amount", 20000);
itemRequest.put("currency","SGD");
Item item = razorpay.items.create(itemRequest);
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.item.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
Razorpay::Item.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
});
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data:= map[string]interface{}{
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD",
}
body, err := client.Item.Create(data, nil)
$api = new Api($key_id, $secret);
$api->Item->create(array("name" => "Book / English August","description" => "An indian story, Booker prize winner.","amount" => 20000,"currency" => "SGD"));
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.Items.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
Razorpay::Item.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
});
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
Dictionary<string, object> itemRequest = new Dictionary<string, object>();
itemRequest.Add("name", "Book / English August");
itemRequest.Add("description", "An indian story, Booker prize winner.");
itemRequest.Add("amount", 20000);
itemRequest.Add("currency", "SGD");
Item item = client.Item.Create(itemRequest);
razorpay invoices items create \
--name "Master Cloud Computing in 30 Days" \
--amount 399 \
--currency INR \
--description "Book by Ravena Ravenclaw"
{
"id": "item_JInaSLODeDUQiQ",
"active": true,
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"unit_amount": 20000,
"currency": "SGD",
"type": "invoice",
"unit": null,
"tax_inclusive": false,
"hsn_code": null,
"sac_code": null,
"tax_rate": null,
"tax_id": null,
"tax_group_id": null,
"created_at": 1649843796
}
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The api key provided is invalid",
"source": "NA",
"step": "NA",
"reason": "NA",
"metadata": {}
}
}
Invoices
Create an Item
Create an Item with basic details such as name and amount.
POST
/
v1
/
items
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-H "Content-Type: application/json" \
-X POST https://api.razorpay.com/v1/items \
-d '{
"name":"Book / English August",
"description":"An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
}'
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
JSONObject itemRequest = new JSONObject();
itemRequest.put("name","Book / English August");
itemRequest.put("description","An indian story, Booker prize winner.");
itemRequest.put("amount", 20000);
itemRequest.put("currency","SGD");
Item item = razorpay.items.create(itemRequest);
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.item.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
Razorpay::Item.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
});
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data:= map[string]interface{}{
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD",
}
body, err := client.Item.Create(data, nil)
$api = new Api($key_id, $secret);
$api->Item->create(array("name" => "Book / English August","description" => "An indian story, Booker prize winner.","amount" => 20000,"currency" => "SGD"));
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.Items.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
Razorpay::Item.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
});
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
Dictionary<string, object> itemRequest = new Dictionary<string, object>();
itemRequest.Add("name", "Book / English August");
itemRequest.Add("description", "An indian story, Booker prize winner.");
itemRequest.Add("amount", 20000);
itemRequest.Add("currency", "SGD");
Item item = client.Item.Create(itemRequest);
razorpay invoices items create \
--name "Master Cloud Computing in 30 Days" \
--amount 399 \
--currency INR \
--description "Book by Ravena Ravenclaw"
{
"id": "item_JInaSLODeDUQiQ",
"active": true,
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"unit_amount": 20000,
"currency": "SGD",
"type": "invoice",
"unit": null,
"tax_inclusive": false,
"hsn_code": null,
"sac_code": null,
"tax_rate": null,
"tax_id": null,
"tax_group_id": null,
"created_at": 1649843796
}
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The api key provided is invalid",
"source": "NA",
"step": "NA",
"reason": "NA",
"metadata": {}
}
}
Available in🇮🇳 India🇲🇾 Malaysia🇸🇬 Singapore🇺🇸 United States
Use this endpoint to create an item with basic details such as name and amount. After an item is created, it appears on the list of created items and in the drop-down menu at the time of invoice creation.
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-H "Content-Type: application/json" \
-X POST https://api.razorpay.com/v1/items \
-d '{
"name":"Book / English August",
"description":"An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
}'
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
JSONObject itemRequest = new JSONObject();
itemRequest.put("name","Book / English August");
itemRequest.put("description","An indian story, Booker prize winner.");
itemRequest.put("amount", 20000);
itemRequest.put("currency","SGD");
Item item = razorpay.items.create(itemRequest);
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.item.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
Razorpay::Item.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
});
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data:= map[string]interface{}{
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD",
}
body, err := client.Item.Create(data, nil)
$api = new Api($key_id, $secret);
$api->Item->create(array("name" => "Book / English August","description" => "An indian story, Booker prize winner.","amount" => 20000,"currency" => "SGD"));
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.Items.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
Razorpay::Item.create({
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"currency": "SGD"
});
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
Dictionary<string, object> itemRequest = new Dictionary<string, object>();
itemRequest.Add("name", "Book / English August");
itemRequest.Add("description", "An indian story, Booker prize winner.");
itemRequest.Add("amount", 20000);
itemRequest.Add("currency", "SGD");
Item item = client.Item.Create(itemRequest);
razorpay invoices items create \
--name "Master Cloud Computing in 30 Days" \
--amount 399 \
--currency INR \
--description "Book by Ravena Ravenclaw"
{
"id": "item_JInaSLODeDUQiQ",
"active": true,
"name": "Book / English August",
"description": "An indian story, Booker prize winner.",
"amount": 20000,
"unit_amount": 20000,
"currency": "SGD",
"type": "invoice",
"unit": null,
"tax_inclusive": false,
"hsn_code": null,
"sac_code": null,
"tax_rate": null,
"tax_id": null,
"tax_group_id": null,
"created_at": 1649843796
}
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The api key provided is invalid",
"source": "NA",
"step": "NA",
"reason": "NA",
"metadata": {}
}
}
Request Parameters
string
required
Name of the item.
string
A brief description about the item.
integer
required
The price of the item. In the case of three decimal currencies, such as KWD, BHD and OMR, to refund a payment of 295.991, pass the value as
295990. And in the case of zero decimal currencies such as JPY, to refund a payment of 295, pass the value as 295.Watch Out!As per payment guidelines, you should pass the last decimal number as 0 for three decimal currency payments. For example, if you want to refund a customer 99.991 KD for a transaction, you should pass the value for the amount parameter as
99990 and not 99991.string
required
The currency in which the amount should be charged. Check the list of supported currencies.
Handy TipsRazorpay has added support for zero decimal currencies, such as JPY, and three decimal currencies, such as KWD, BHD, and OMR, allowing businesses to accept international payments in these currencies. Know more about Currency Conversion (May 2024).
Response Parameters
string
The unique identifier of the item.
boolean
Indicates the status of the item. Possible values:
true(default): Item is in the active state.false: Item is in the inactive state.
string
The name of the item.
string
A text description about the item.
integer
The price of the item.
integer
The per unit billing amount for each individual unit.
string
The currency in which the amount should be charged. Check the list of supported currencies.
string
Here, it must be
invoice.integer
The number of units of the item billed in the invoice.
boolean
Indicates whether the base amount includes tax.
true: The base amount includes tax.false: The base amount does not include tax. By default, the value is set tofalse.
integer
The 8-digit code used to classify the product as per the Harmonised System of Nomenclature.
integer
The 6-digit code used to classify the service as per the Services Accounting Code.
string
The percentage at which an individual or a corporation is taxed.
string
The identification number that gets displayed on invoices issued to the customer.
string
The identification number for the tax group. A tax group is a collection of taxes that can be applied as a single set of rules.
integer
Unix timestamp, at which the item was created. For example,
1649843796.Errors
The API `<key/secret>
` provided is invalid.
The API `<key/secret> ` provided is invalid.
Code:
4xxThe API credentials passed in the API call differ from the ones generated on the Dashboard.- Different keys for test mode and live modes.
- Expired API key.
The currency field is required.
The currency field is required.
Code:
400The currency field is blank.Solution: Ensure that the currency field is added with a valid currency code.The merchant doesn't have international activated
The merchant doesn't have international activated
Code:
400This happens when an international currency code is added.Solution: Ensure that the currency field is added with a valid currency code.The amount must be at least INR 1.00
The amount must be at least INR 1.00
Code:
400This happens when the amount added in the amount field is less than INR 1.Solution: Ensure that the amount is INR 1 or greater.The name field is required.
The name field is required.
Code:
400The name field was not included in the request body, or the body was empty.Solution: Always pass name in the request body.The amount field is required when unit amount is not present.
The amount field is required when unit amount is not present.
Code:
400Neither the amount field nor unit_amount field was included in the request body.Solution: Pass either amount (in currency subunits) or unit_amount.The name may not be greater than 512 characters.
The name may not be greater than 512 characters.
Code:
400The name value exceeds the 512-character limit.Solution: Keep name to 512 characters or fewer.Was this page helpful?