The order_id received in the response should be passed to the checkout. This ties the order with the payment and secures the request from being tampered.
Use this endpoint to create an order using the Orders API.
POST
/orders
curl -X POST https://api.razorpay.com/v1/orders
-U [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
-H 'content-type:application/json'
-d '{
"amount": 100,
"currency": "MYR",
"receipt": "qwsaq1",
"partial_payment": true,
"first_payment_min_amount": 230,
"notes": {
"key1": "value3",
"key2": "value2"
}
}'
Request Parameters
amount
mandatory
integer The transaction amount, expressed in the currency subunit, such as Ringgit (in case of MY). For example, for an actual amount of RM 299.35 , the value of this field should be 29935.
currency
mandatory
string The currency in which the transaction should be made. Length must be of 3 characters. For example, MYR.
receipt
optional
string Your receipt id for this order should be passed here. Maximum length is 40 characters.
notes
optional
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
optional
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
optional
integer Minimum amount that must be paid by the customer as the first partial payment. For example, if an amount of RM 7,000.00 is to be received from the customer in two installments of #1 - RM 5,000, #2 - RM 2,000, then you can set this value as 500000. This parameter should be passed only if partial_payment is true.
Response Parameters
Descriptions for the response parameters are present in the
Add the Pay button on your web page using the checkout code given below. The hosted checkout page is displayed when the customers click the Pay button.
For every successful payment, razorpay_payment_id, razorpay_order_id and razorpay_signature are submitted via a POST request to the callback_url passed in payment options.
If your customer cancels the transaction or clicks the back button, they are redirected to the cancel_url via a GET request.
If the payment fails, a POST request is made to the callback_url, with the error fields as payload.
string Unique identifier of the Order, created using the Orders API.
amount
mandatory
integer Enter the amount to charge the customer in currency subunits. For example, if charging the customer INR 200, enter 20000.
currency
mandatory
string Enter the currency to be used in the payment. Ensure that currency of the payment matches the Order currency. Defaults to INR. We support more than
string Use this parameter to show a specific payment method in Checkout. Possible values:
card
netbanking
wallet
upi
paylater
prefill
The fields that can be pre-populated in the Checkout form.
name
optional
string Name of the cardholder.
email
mandatory
string Email address of the customer.
contact
mandatory
string Customer's phone number.
notes
optional
object An additional set of fields that you want to associate with the payment. For example, you can add "shipping address" and "alternate contact" in the Notes field. You can specify up to 15 note fields.
[Shipping address]
string 106, Razorpay, Bangalore
[Alternate contact]
string 9000090000
callback_url
mandatory
string Page to which the customers are redirected to after a successful payment. razorpay_payment_id, razorpay_order_id and razorpay_signature are sent as form-data through a POST request to the callback_url.
cancel_url
optional
string The URL customers are redirected to after the cancellation of a payment.
If the signature you generate on your server matches the razorpay_signature returned to you by the Checkout form, the payment received is from an authentic source.
You can use Curlec webhooks to configure and receive notifications when a specific event occurs. When one of these events is triggered, we send an HTTP POST payload in JSON to the webhook's configured URL. Know how to