Skip to main content
Create a new Razorpay payment order by submitting an amount and optional ride details. You must include a valid Bearer token in the request header.

Request

POST /payments/order
Authorization: Bearer <token>
Content-Type: application/json
amountInInr
integer
required
The amount to charge, in Indian Rupees (INR). Must be a positive integer.
rideSummary
string
A short description of the ride. Optional.
paymentMode
string
The payment mode to associate with this order (e.g. upi, card). Optional.

Response

orderId
string
The unique Razorpay order identifier. Pass this to the Razorpay checkout SDK on the client.
amount
integer
The order amount in paise (INR × 100).
currency
string
Always INR.
All amounts in the Razorpay response are denominated in paise. For example, an amountInInr of 150 returns amount: 15000.
This endpoint returns 503 Service Unavailable if Razorpay is not configured in the server environment. Verify the integration is active before calling this endpoint in production.

Example

curl -X POST http://localhost:8080/payments/order \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "amountInInr": 250,
    "rideSummary": "Airport pickup — Terminal 2",
    "paymentMode": "upi"
  }'