> ## Documentation Index
> Fetch the complete documentation index at: https://rideshare.docs.sumit-dhondikar.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Order

> Create a Razorpay payment order for a ride.

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`**

```http theme={null}
Authorization: Bearer <token>
Content-Type: application/json
```

<ParamField body="amountInInr" type="integer" required>
  The amount to charge, in Indian Rupees (INR). Must be a positive integer.
</ParamField>

<ParamField body="rideSummary" type="string">
  A short description of the ride. Optional.
</ParamField>

<ParamField body="paymentMode" type="string">
  The payment mode to associate with this order (e.g. `upi`, `card`). Optional.
</ParamField>

## Response

<ResponseField name="orderId" type="string">
  The unique Razorpay order identifier. Pass this to the Razorpay checkout SDK on the client.
</ResponseField>

<ResponseField name="amount" type="integer">
  The order amount in paise (INR × 100).
</ResponseField>

<ResponseField name="currency" type="string">
  Always `INR`.
</ResponseField>

<Note>
  All amounts in the Razorpay response are denominated in paise. For example, an `amountInInr` of `150` returns `amount: 15000`.
</Note>

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

## Example

<CodeGroup>
  ```bash cURL theme={null}
  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"
    }'
  ```

  ```json Response theme={null}
  {
    "orderId": "order_OmXy1234abcd",
    "amount": 25000,
    "currency": "INR"
  }
  ```
</CodeGroup>
