Create an Order
POST/v1/ordersClick to copy
Use this endpoint to create an order with basic details such as amount and currency.
Is this page helpful?
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \2-X POST https://api.razorpay.com/v1/orders \3-H "content-type: application/json" \4-d '{5"amount": 5000,6"currency": "",7"receipt": "receipt#1",8"notes": {9"key1": "value3",10"key2": "value2"11}12}'
Success
Failure
1{2"amount": 5000,3"amount_due": 5000,4"amount_paid": 0,5"attempts": 0,6"created_at": 1756455561,7"currency": "INR",8"entity": "order",9"id": "order_RB58MiP5SPFYyM",10"notes": {11"key1": "value3",12"key2": "value2"13},14"offer_id": null,15"receipt": "receipt#1",16"status": "created"17}
Request Parameters
amount *
integer Payment amount in the smallest currency sub-unit. For example, if the amount to be charged is ₹299.00, then pass 29900 in this field. In the case of three decimal currencies, such as KWD, BHD and OMR, to accept a payment of 295.991, pass the value as 295990. And in the case of zero decimal currencies such as JPY, to accept 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 charge a customer 99.991 KD for a transaction, you should pass the value for the amount parameter as 99990 and not 99991.
currency *
stringISO code for the currency in which you want to accept the payment. The default length is 3 characters. Refer to the
.Handy Tips
Razorpay 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
(May 2024).receipt stringReceipt number that corresponds to this order, set for your internal reference. Can have a maximum length of 40 characters and has to be unique.
notes json object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
Response Parameters
idstringThe unique identifier of the order.
amountinteger The amount for which the order was created, in currency subunits. For example, for an amount of ₹295.00, enter 29500.
entitystring Name of the entity. Here, it is order.
amount_paidintegerThe amount paid against the order.
amount_dueintegerThe amount pending against the order.
currencystringISO code for the currency in which you want to accept the payment. The default length is 3 characters.
receiptstringReceipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.
statusstringThe status of the order. Possible values:
created: When you create an order it is in thecreatedstate. It stays in this state till a payment is attempted on it.attempted: An order moves fromcreatedtoattemptedstate when a payment is first attempted on it. It remains in theattemptedstate till one payment associated with that order is captured.paid: After the successful capture of the payment, the order moves to thepaidstate. No further payment requests are permitted once the order moves to thepaidstate. The order stays in thepaidstate even if the payment associated with the order is refunded.
attemptsintegerThe number of payment attempts, successful and failed, that have been made against this order.
notesjson object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
created_atintegerIndicates the Unix timestamp when this order was created.
Errors
Authentication failed.
Error Status: 400
The API credentials passed in the API call differ from the ones generated on the Dashboard. Possible reasons:
- Different keys for test mode and live modes.
- Expired API key.
Solution
The amount must be atleast INR 1.00.
Error Status: 400
The amount specified is less than the minimum amount. Currency subunits, such as paise (in the case of INR), should always be greater than 100.
Solution
The field name is required.
Error Status: 400
A mandatory field is missing.
Solution
Create an Order
POST/v1/ordersClick to copy
Use this endpoint to create an order with basic details such as amount and currency.
Is this page helpful?
Request Parameters
amount *
integer Payment amount in the smallest currency sub-unit. For example, if the amount to be charged is ₹299.00, then pass 29900 in this field. In the case of three decimal currencies, such as KWD, BHD and OMR, to accept a payment of 295.991, pass the value as 295990. And in the case of zero decimal currencies such as JPY, to accept 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 charge a customer 99.991 KD for a transaction, you should pass the value for the amount parameter as 99990 and not 99991.
currency *
stringISO code for the currency in which you want to accept the payment. The default length is 3 characters. Refer to the
.Handy Tips
Razorpay 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
(May 2024).receipt stringReceipt number that corresponds to this order, set for your internal reference. Can have a maximum length of 40 characters and has to be unique.
notes json object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
Response Parameters
idstringThe unique identifier of the order.
amountinteger The amount for which the order was created, in currency subunits. For example, for an amount of ₹295.00, enter 29500.
entitystring Name of the entity. Here, it is order.
amount_paidintegerThe amount paid against the order.
amount_dueintegerThe amount pending against the order.
currencystringISO code for the currency in which you want to accept the payment. The default length is 3 characters.
receiptstringReceipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.
statusstringThe status of the order. Possible values:
created: When you create an order it is in thecreatedstate. It stays in this state till a payment is attempted on it.attempted: An order moves fromcreatedtoattemptedstate when a payment is first attempted on it. It remains in theattemptedstate till one payment associated with that order is captured.paid: After the successful capture of the payment, the order moves to thepaidstate. No further payment requests are permitted once the order moves to thepaidstate. The order stays in thepaidstate even if the payment associated with the order is refunded.
attemptsintegerThe number of payment attempts, successful and failed, that have been made against this order.
notesjson object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
created_atintegerIndicates the Unix timestamp when this order was created.
Errors
Authentication failed.
Error Status: 400
The API credentials passed in the API call differ from the ones generated on the Dashboard. Possible reasons:
- Different keys for test mode and live modes.
- Expired API key.
Solution
The amount must be atleast INR 1.00.
Error Status: 400
The amount specified is less than the minimum amount. Currency subunits, such as paise (in the case of INR), should always be greater than 100.
Solution
The field name is required.
Error Status: 400
A mandatory field is missing.
Solution
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \2-X POST https://api.razorpay.com/v1/orders \3-H "content-type: application/json" \4-d '{5"amount": 5000,6"currency": "",7"receipt": "receipt#1",8"notes": {9"key1": "value3",10"key2": "value2"11}12}'
Success
Failure
1{2"amount": 5000,3"amount_due": 5000,4"amount_paid": 0,5"attempts": 0,6"created_at": 1756455561,7"currency": "INR",8"entity": "order",9"id": "order_RB58MiP5SPFYyM",10"notes": {11"key1": "value3",12"key2": "value2"13},14"offer_id": null,15"receipt": "receipt#1",16"status": "created"17}