Create Order
The Create Order endpoint allows you to generate a payment order with specific details,
which the user will then complete via the payment gateway.
- Endpoint:
/create-order
- Method:
POST
- Authentication: Requires a valid access token in the
Authorization
header.
Request Parameters:
# |
Parameter |
Type |
Required |
Description |
1 |
amount |
int |
Yes |
The amount for the order. You can pass the actuall amount as integer. (50 rupees = 50) |
2 |
currency |
str |
Yes |
The currency code (e.g., "INR"). |
3 |
receipt |
str |
No |
A unique identifier for the transaction. |
4 |
notes |
dict |
No |
Additional notes to be associated with the order. This could include any
metadata (e.g., customer details) that you want to track with the
payment. |
5 |
partial_payment |
bool |
No |
Specifies whether partial payments are allowed for this order. Defaults
to False. |
6 |
first_payment_min_amount |
int |
No |
The minimum amount (in smallest currency unit) required for the first
payment if partial_payment is enabled. |
3 |
payment_capture |
bool |
No |
Whether to automatically capture the payment. Defaults to False. |
Sample Request:
{
"amount": 100,
"currency": "INR",
"receipt": "receipt#1",
"notes": {
"customer_id": "12345",
"order_type": "subscription"
},
"payment_capture": false,
"partial_payment": false
}
Sample Response:
{
"message": "Order created successfully",
"order": {
"amount": 10000,
"amount_due": 10000,
"amount_paid": 0,
"attempts": 0,
"created_at": 1729521113,
"currency": "INR",
"entity": "order",
"id": "order_PBioIo0a3ABdhj",
"notes": {
"customer_id": "12345",
"order_type": "subscription"
},
"offer_id": null,
"receipt": "receipt#1",
"status": "created"
}
}
Common Errors:
# |
Error Code |
Description |
1 |
400 |
Invalid request parameters or missing data or Razorpay Bad Request. |
2 |
401 |
Razorpay Authentication Error |
3 |
403 |
Razorpay Permission Error |
4 |
504 |
Razorpay Request Timeout |