---
title: "Create Razorpay Order"
method: POST
path: "/api/payments/razorpay/{environment}/orders"
tags: ["Razorpay Payments"]
---

# Create Razorpay Order

`POST /api/payments/razorpay/{environment}/orders`

Create a local Razorpay Order record with the caller's user context, create a Razorpay Order, and return Checkout options for the client-side Razorpay Checkout script.

## Path parameters

- `environment` 'test' | 'live', required

## Request body

- CreateRazorpayOrderBody — Notes keys starting with insforge_ are reserved and rejected.
  - `amount` integer, required
  - `currency` string, required
  - `receipt` string, nullable
  - `description` string, nullable
  - `subject` BillingSubject
    - `type` string, required
    - `id` string, required
  - `customerName` string, nullable
  - `customerEmail` string, email, nullable
  - `customerContact` string, nullable
  - `callbackUrl` string, uri, nullable
  - `notes` Metadata

## Response `201`

Razorpay Order created

- CreateRazorpayOrderResponse
  - `order` RazorpayOrder, required
    - `id` string, uuid, required
    - `environment` 'test' | 'live', required
    - `status` 'initialized' | 'created' | 'attempted' | 'paid' | 'failed', required
    - `subjectType` string, nullable, required
    - `subjectId` string, nullable, required
    - `customerName` string, nullable, required
    - `customerEmail` string, email, nullable, required
    - `customerContact` string, nullable, required
    - `orderId` string, nullable, required
    - `receipt` string, nullable, required
    - `amount` integer, required
    - `amountPaid` integer, nullable, required
    - `amountDue` integer, nullable, required
    - `currency` string, required
    - `attempts` integer, nullable, required
    - `verifiedPaymentId` string, nullable, required
    - `verifiedAt` string, date-time, nullable, required
    - `notes` Metadata, required
    - `lastError` string, nullable, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
  - `checkoutOptions` object, required
    - `key` string, required
    - `amount` integer, required
    - `currency` string, required
    - `order_id` string, required
    - `name` string, nullable
    - `description` string, nullable
    - `callback_url` string, nullable
    - `prefill` RazorpayCheckoutPrefill, required
      - `name` string, nullable
      - `email` string, email, nullable
      - `contact` string, nullable

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal server error

---

[API](https://skmtc.dev/insforge/apis/insforge-authentication-api.md) · [All operations](https://skmtc.dev/insforge/apis/insforge-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/insforge/insforge-authentication-api/revisions/a935bb49f932/schema)
