API Test Keys

Create an Order

POST
/v1/orders

Click to copy

Use this endpoint to create an order with basic details such as amount and currency.

Is this page helpful?

Curl

change language

change language

1
curl -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, 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

*

string

ISO 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
string

Receipt 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
id
string

The unique identifier of the order.

amount
integer

The amount for which the order was created, in currency subunits. For example, for an amount of ₹295, enter 29500.

entity
string

Name of the entity. Here, it is order.

amount_paid
integer

The amount paid against the order.

amount_due
integer

The amount pending against the order.

currency
string

ISO code for the currency in which you want to accept the payment. The default length is 3 characters.

receipt
string

Receipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.

status
string

The status of the order. Possible values:

  • created: When you create an order it is in the created state. It stays in this state till a payment is attempted on it.
  • attempted: An order moves from created to attempted state when a payment is first attempted on it. It remains in the attempted state till one payment associated with that order is captured.
  • paid: After the successful capture of the payment, the order moves to the paid state. No further payment requests are permitted once the order moves to the paid state. The order stays in the paid state even if the payment associated with the order is refunded.

attempts
integer

The number of payment attempts, successful and failed, that have been made against this order.

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”.

created_at
integer

Indicates the Unix timestamp when this order was created.

offer_id
string

Unique identifier of the offer associated with this order.

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 at least 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

amount: must be no less than 0.

Error Status: 400

A negative amount was sent in the request body.

Solution

The amount must be an integer.

Error Status: 400

amount was sent as a string, float or other non-integer type.

Solution

Amount exceeds maximum amount allowed.

Error Status: 400

amount exceeds the per-order maximum configured for the account or currency.

Solution

currency: validation_failure: BAD_REQUEST_INVALID_CURRENCY.

Error Status: 400

An unsupported currency value was sent (for example, XYZ) or a currency that is not enabled for your account.

Solution

receipt: the length must be no more than 40.

Error Status: 400

receipt value exceeds 40 characters.

Solution

The receipt: validation_failure: BAD_REQUEST_ENCODING_VALIDATION_FAILED.

Error Status: 400

receipt contains characters outside the supported encoding (for example, emoji or non-ASCII characters).

Solution

first_payment_min_amount should be greater than or equal to 0.

Error Status: 400

first_payment_min_amount was set to a negative value while partial_payment: true.

Solution

EOF.

Error Status: 400

The request body is malformed JSON. It may be truncated, missing a closing brace or otherwise unparseable.

Solution

Duplicate request. This request has already been processed.

Error Status: 400

An order with the same receipt value has already been created on this account. receipt is treated as an idempotency key, so a second create call with the same value is rejected.

Solution

Request failed because another order operation is in progress.

Error Status: 400

A concurrent create or update is already running against this order. Razorpay locks the order to prevent state corruption.

Solution

Bank code provided is invalid.

Error Status: 400

For TPV (third-party validation) orders, the bank value passed is not a recognised IFSC bank code.

Solution

The requested bank is not enabled for the merchant.

Error Status: 400

For TPV orders, the bank passed is valid but not enabled on your account.

Solution

Bank code should be provided in input if account number is sent.

Error Status: 400

For TPV orders, an account_number was passed without the accompanying bank field.

Solution

Account number is mandatory for this merchant.

Error Status: 400

Your account is configured to require an account_number on every order (TPV-enforced merchants), but the field is missing from the request.

Solution

Create an Order

POST
/v1/orders

Click 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, 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

*

string

ISO 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
string

Receipt 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
id
string

The unique identifier of the order.

amount
integer

The amount for which the order was created, in currency subunits. For example, for an amount of ₹295, enter 29500.

entity
string

Name of the entity. Here, it is order.

amount_paid
integer

The amount paid against the order.

amount_due
integer

The amount pending against the order.

currency
string

ISO code for the currency in which you want to accept the payment. The default length is 3 characters.

receipt
string

Receipt number that corresponds to this order. Can have a maximum length of 40 characters and has to be unique.

status
string

The status of the order. Possible values:

  • created: When you create an order it is in the created state. It stays in this state till a payment is attempted on it.
  • attempted: An order moves from created to attempted state when a payment is first attempted on it. It remains in the attempted state till one payment associated with that order is captured.
  • paid: After the successful capture of the payment, the order moves to the paid state. No further payment requests are permitted once the order moves to the paid state. The order stays in the paid state even if the payment associated with the order is refunded.

attempts
integer

The number of payment attempts, successful and failed, that have been made against this order.

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”.

created_at
integer

Indicates the Unix timestamp when this order was created.

offer_id
string

Unique identifier of the offer associated with this order.

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 at least 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

amount: must be no less than 0.

Error Status: 400

A negative amount was sent in the request body.

Solution

The amount must be an integer.

Error Status: 400

amount was sent as a string, float or other non-integer type.

Solution

Amount exceeds maximum amount allowed.

Error Status: 400

amount exceeds the per-order maximum configured for the account or currency.

Solution

currency: validation_failure: BAD_REQUEST_INVALID_CURRENCY.

Error Status: 400

An unsupported currency value was sent (for example, XYZ) or a currency that is not enabled for your account.

Solution

receipt: the length must be no more than 40.

Error Status: 400

receipt value exceeds 40 characters.

Solution

The receipt: validation_failure: BAD_REQUEST_ENCODING_VALIDATION_FAILED.

Error Status: 400

receipt contains characters outside the supported encoding (for example, emoji or non-ASCII characters).

Solution

first_payment_min_amount should be greater than or equal to 0.

Error Status: 400

first_payment_min_amount was set to a negative value while partial_payment: true.

Solution

EOF.

Error Status: 400

The request body is malformed JSON. It may be truncated, missing a closing brace or otherwise unparseable.

Solution

Duplicate request. This request has already been processed.

Error Status: 400

An order with the same receipt value has already been created on this account. receipt is treated as an idempotency key, so a second create call with the same value is rejected.

Solution

Request failed because another order operation is in progress.

Error Status: 400

A concurrent create or update is already running against this order. Razorpay locks the order to prevent state corruption.

Solution

Bank code provided is invalid.

Error Status: 400

For TPV (third-party validation) orders, the bank value passed is not a recognised IFSC bank code.

Solution

The requested bank is not enabled for the merchant.

Error Status: 400

For TPV orders, the bank passed is valid but not enabled on your account.

Solution

Bank code should be provided in input if account number is sent.

Error Status: 400

For TPV orders, an account_number was passed without the accompanying bank field.

Solution

Account number is mandatory for this merchant.

Error Status: 400

Your account is configured to require an account_number on every order (TPV-enforced merchants), but the field is missing from the request.

Solution

Curl

change language

change language

1
curl -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
}