> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-60c89f9a-mintlify-audit-missing-sections-1778528421.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an Order

> Creates a new order. An order represents a payment intent. You must create an order before accepting a payment from a customer.



## OpenAPI

````yaml /openapi/core.json post /orders
openapi: 3.1.0
info:
  title: Razorpay Core Resources API
  description: >-
    The Razorpay Core Resources API provides endpoints for managing Orders,
    Payments, Refunds, and Settlements. Use HTTP Basic Auth with your Key ID as
    the username and Key Secret as the password.
  version: 1.0.0
  contact:
    name: Razorpay Support
    url: https://razorpay.com/support
servers:
  - url: https://api.razorpay.com/v1
    description: Razorpay Production API
security:
  - basicAuth: []
tags:
  - name: Orders
    description: >-
      Orders represent payment intents. Create an order before accepting a
      payment from a customer.
  - name: Payments
    description: >-
      Payments represent individual payment transactions. Fetch, list, and
      capture payments.
  - name: Refunds
    description: >-
      Refunds represent the reversal of a payment back to the customer. Initiate
      full or partial refunds against captured payments.
  - name: Settlements
    description: >-
      Settlements represent the transfer of funds collected from payments to
      your registered bank account.
paths:
  /orders:
    post:
      tags:
        - Orders
      summary: Create an Order
      description: >-
        Creates a new order. An order represents a payment intent. You must
        create an order before accepting a payment from a customer.
      operationId: createOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCreateRequest'
            example:
              amount: 50000
              currency: INR
              receipt: receipt_1001
              notes:
                customer_name: John Doe
                order_type: premium
              partial_payment: false
      responses:
        '200':
          description: The order was successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
              example:
                id: order_IluGWxBm9U8zJ8
                entity: order
                amount: 50000
                amount_paid: 0
                amount_due: 50000
                currency: INR
                receipt: receipt_1001
                status: created
                attempts: 0
                notes:
                  customer_name: John Doe
                  order_type: premium
                created_at: 1595491008
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
components:
  schemas:
    OrderCreateRequest:
      type: object
      description: Request body for creating a new order.
      required:
        - amount
        - currency
      properties:
        amount:
          type: integer
          description: >-
            The transaction amount in the smallest currency sub-unit (e.g.,
            paise for INR). For example, 50000 represents ₹500. Must be a
            positive integer.
          example: 50000
        currency:
          type: string
          description: >-
            The ISO 4217 currency code for the transaction. Currently only `INR`
            is supported.
          example: INR
        receipt:
          type: string
          description: >-
            A unique receipt number for the order, for your internal reference.
            Maximum length is 40 characters.
          example: receipt_1001
        notes:
          type: object
          description: >-
            A key-value store of custom metadata to attach to the order. Maximum
            15 key-value pairs, with keys and values up to 256 characters each.
          additionalProperties:
            type: string
          example:
            customer_name: John Doe
            order_type: premium
        partial_payment:
          type: boolean
          description: >-
            Whether the order allows partial payments. If `true`, the customer
            can pay the amount in multiple installments.
          example: false
    Order:
      type: object
      description: A Razorpay Order object representing a payment order.
      properties:
        id:
          type: string
          description: Unique identifier for the order.
          example: order_IluGWxBm9U8zJ8
        entity:
          type: string
          description: Entity type, always `order` for order objects.
          example: order
        amount:
          type: integer
          description: >-
            The order amount in the smallest currency sub-unit (e.g., paise for
            INR). For example, 50000 represents ₹500.
          example: 50000
        amount_paid:
          type: integer
          description: >-
            The amount paid against the order, in the smallest currency
            sub-unit.
          example: 0
        amount_due:
          type: integer
          description: >-
            The remaining amount to be paid against the order, in the smallest
            currency sub-unit.
          example: 50000
        currency:
          type: string
          description: The ISO 4217 currency code for the order.
          example: INR
        receipt:
          type: string
          description: >-
            A unique receipt number provided by the merchant for internal
            reference.
          example: receipt_1001
        status:
          type: string
          description: The current status of the order.
          enum:
            - created
            - attempted
            - paid
          example: created
        attempts:
          type: integer
          description: The number of payment attempts made against this order.
          example: 0
        notes:
          type: object
          description: >-
            A key-value store of custom metadata to attach to the order. Values
            must be strings.
          additionalProperties:
            type: string
          example:
            customer_name: John Doe
            order_type: premium
        created_at:
          type: integer
          description: Unix timestamp (in seconds) at which the order was created.
          example: 1595491008
    ErrorResponse:
      type: object
      description: An error response returned by the API.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A machine-readable error code.
              example: BAD_REQUEST_ERROR
            description:
              type: string
              description: A human-readable description of the error.
              example: The amount must be at least 100 paise.
            source:
              type: string
              description: The source of the error (e.g., `business` or `customer`).
              example: business
            step:
              type: string
              description: The step at which the error occurred.
              example: payment_initiation
            reason:
              type: string
              description: A brief reason for the error.
              example: input_validation_failed
            metadata:
              type: object
              description: Additional metadata about the error.
              additionalProperties: true
  responses:
    BadRequestError:
      description: The request was invalid or contained incorrect parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnauthorizedError:
      description: Authentication credentials are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Use your Razorpay Key ID as the username and Key Secret as the password.

````