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
This integration method provides a default Pay with Razorpay button that invokes the Checkout form.
The Checkout form options are passed as data attributes inside a <script> tag. You can add any additional, hidden or visible fields to the form, which will be submitted along with the form.
The Checkout options are sent as form-data to the following URL in a POST request.
POST: https://www.example.com/payment/success/
The following sample code will pass the Razorpay checkout options as HTML data attributes:
data-key="YOUR_KEY_ID" // Enter the Test API Key ID generated from Dashboard → Settings → API Keys
data-amount="29935" // Amount is in currency subunits. Hence, 29935 refers to 29935 paise or ₹299.35.
data-currency="INR"// You can accept international payments by changing the currency code. Contact our Support Team to enable International for your account
data-order_id="order_CgmcjRh9ti2lP7"// Replace with the order_id generated by you in the backend.
data-buttontext="Pay with Razorpay"
data-name="Acme Corp"
data-description="A Wild Sheep Chase is the third novel by Japanese author Haruki Murakami"
Only successful authorisations are auto-submitted. For every successful payment, razorpay_payment_id, razorpay_order_id and razorpay_signature are submitted via a POST request to the callback_url.
Upon payment success, the customer is redirected to the URL provided in the code.
In case of failed payments, the customer is prompted to retry the payment on the Checkout form.
string The text you want to display on the button. For example, Buy Now!.
data-name
mandatory
string The business/company name shown in the Checkout form. For example, Acme Corp.
data-description
optional
string Description of the purchase item shown in the Checkout form. Must start with an alphanumeric character.
data-image
mandatory
string Link to an image (usually business logo) shown in the Checkout form. It can also be a base64 string, if loading the image from a network is not desirable.
data-prefill.name
optional
string Cardholder's name to be pre-filled when the Checkout opens.
data-prefill.email
optional
string Customer's email to be pre-filled when the Checkout opens. For example, gaurav.kumar@example.com.
data-prefill.contact
optional
string Customer's phone number to be pre-filled when the Checkout opens.
data-theme.color
optional
string Brand color to alter the appearance of Checkout form. For example, #F37254.
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