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": 50000,
6
"currency": "INR",
7
"receipt": "receipt#1",
8
"notes": {
9
"key1": "value3",
10
"key2": "value2"
11
}
12
}'

Success

Failure

1
{
2
"id": "order_EKwxwAgItmmXdp",
3
"entity": "order",
4
"amount": 50000,
5
"amount_paid": 0,
6
"amount_due": 50000,
7
"currency": "INR",
8
"receipt": "receipt#1",
9
"offer_id": null,
10
"status": "created",
11
"attempts": 0,
12
"notes": [],
13
"created_at": 1582628071
14
}
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

*

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

partial_payment
boolean

Indicates whether the customer can make a partial payment. Possible values:

  • true : The customer can make partial payments.
  • false (default) : The customer cannot make partial payments.

first_payment_min_amount
integer

Minimum amount that must be paid by the customer as the first partial payment. For example, if an amount of ₹700.00 is to be received from the customer in two installments of #1 - ₹500.00, #2 - ₹200.00, then you can set this value as 50000. This parameter should be passed only if partial_payment is true.

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.00, 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.

Errors

The API <key/secret> provided is invalid.

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

*

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

partial_payment
boolean

Indicates whether the customer can make a partial payment. Possible values:

  • true : The customer can make partial payments.
  • false (default) : The customer cannot make partial payments.

first_payment_min_amount
integer

Minimum amount that must be paid by the customer as the first partial payment. For example, if an amount of ₹700.00 is to be received from the customer in two installments of #1 - ₹500.00, #2 - ₹200.00, then you can set this value as 50000. This parameter should be passed only if partial_payment is true.

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.00, 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.

Errors

The API <key/secret> provided is invalid.

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

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": 50000,
6
"currency": "INR",
7
"receipt": "receipt#1",
8
"notes": {
9
"key1": "value3",
10
"key2": "value2"
11
}
12
}'

Success

Failure

1
{
2
"id": "order_EKwxwAgItmmXdp",
3
"entity": "order",
4
"amount": 50000,
5
"amount_paid": 0,
6
"amount_due": 50000,
7
"currency": "INR",
8
"receipt": "receipt#1",
9
"offer_id": null,
10
"status": "created",
11
"attempts": 0,
12
"notes": [],
13
"created_at": 1582628071
14
}