# Create Order

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v0/orders:
    post:
      summary: Create Order
      deprecated: false
      description: >-
        :::highlight purple 📌

        Use this API to create an order. The generated order acts as a
        prerequisite for initiating a transaction and collecting payments,
        enabling a seamless and secure payment flow within your application.

        :::
      operationId: createOrder
      tags:
        - Payment Gateway/APIs - Payment Gateway /Order
        - order-controller
      parameters:
        - name: merchantAccessKey
          in: header
          description: The access key generated for your account
          required: true
          example: ZJjAg195FnUlR1535
          schema:
            type: string
        - name: Authorization
          in: header
          description: Token generated with your Access key and secret key
          required: true
          example: FgRkY5765702145869544866OAXTT
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              x-apidog-refs:
                01J1YJR753SCVTRYQKZYWPVDR5:
                  $ref: '#/components/schemas/OrderCreateRequest'
                  x-apidog-overrides: {}
              properties:
                orderId:
                  type: string
                  description: >-
                    A unique identifier for the order in your system. Accepts
                    alphanumeric characters only.
                amount:
                  type: object
                  properties:
                    value:
                      type: number
                      minimum: 0.01
                    currency:
                      type: string
                      enum:
                        - INR
                      x-apidog-enum:
                        - value: INR
                          name: ''
                          description: ''
                  x-apidog-orders:
                    - value
                    - currency
                  description: >-
                    This specifies the amount for the order, allowing up to two
                    decimal places. For example, 20.15 would represent Rs 20 and
                    15 paisa.
                  required:
                    - value
                    - currency
                  x-apidog-ignore-properties: []
                returnUrl:
                  type: string
                  description: >-
                    The URL to which the customer will be redirected after
                    completing the payment. returnUrl is required if not
                    configured at merchant level
                notifyUrl:
                  type: string
                  description: >-
                    The URL where notifications regarding the order will be
                    sent. notifyUrl is required if not configured at merchant
                    level
                customerInfo:
                  type: object
                  properties:
                    firstName:
                      type: string
                      description: >-
                        The first name of the customer. Accepts alphabetic
                        characters.
                    lastName:
                      type: string
                      description: >-
                        The last name of the customer. Accepts alphabetic
                        characters.
                    address:
                      type: object
                      properties:
                        streetName:
                          type: string
                        city:
                          type: string
                        state:
                          type: string
                        country:
                          type: string
                        zipcode:
                          type: string
                      x-apidog-orders:
                        - streetName
                        - city
                        - state
                        - country
                        - zipcode
                      description: >
                        The address of the customer. Accepts alphanumeric
                        characters and special symbols.
                      x-apidog-ignore-properties: []
                    email:
                      type: string
                      description: >
                        The email address of the customer. Must be in a valid
                        email format.
                    phoneNumber:
                      type: string
                      description: >-
                        The phone number of the customer. Please exclude +91 ISD
                        code.
                    customerIpAddress:
                      type: string
                      description: The Ip address of the customer
                  x-apidog-orders:
                    - firstName
                    - lastName
                    - address
                    - email
                    - phoneNumber
                    - customerIpAddress
                  description: ' Information about the customer associated with the order. It typically includes details such as first name, last name, address, email, and phone number.'
                  required:
                    - customerIpAddress
                  x-apidog-ignore-properties: []
                customParameters:
                  type: array
                  items:
                    customParam1: value1
                    customParam2: value2
                    type: string
                  description: >-
                    Additional custom parameters or metadata associated with the
                    order, if any. These will be key value pairs.
                description:
                  type: string
                paymentDetail:
                  type: object
                  properties:
                    accountNumber:
                      type: string
                      description: Required for UPI TPV flow for non seamless integration
                      minLength: 9
                      maxLength: 36
                    ifsc:
                      type: string
                      description: Required for UPI TPV flow for non seamless integration
                      minLength: 11
                      examples:
                        - KKBK0000432
                      maxLength: 11
                      pattern: ^[A-Z]{4}0[A-Z0-9]{6}$
                  x-apidog-orders:
                    - accountNumber
                    - ifsc
                  description: Payment related information for UPI TPV flow
                  x-apidog-ignore-properties: []
                restrictedPaymentOptions:
                  type: object
                  description: >-
                    Restricts payment options available for this order. If
                    provided, only specified modes and codes will be allowed
                    during checkout.
                  additionalProperties: false
                  properties:
                    NETBANKING:
                      type: array
                      description: List of allowed netbanking bank codes.
                      items:
                        type: string
                      examples:
                        - - NB027
                          - NB028
                          - NB031
                          - NB032
                    CREDIT_CARD:
                      type: array
                      description: List of allowed credit card schemes.
                      items:
                        type: string
                        enum:
                          - MASTERCARD
                          - VISA
                          - RUPAY
                          - DINERS
                          - AMEX
                    DEBIT_CARD:
                      type: array
                      description: List of allowed debit card schemes.
                      items:
                        type: string
                        enum:
                          - MASTERCARD
                          - VISA
                          - RUPAY
                          - DINERS
                          - AMEX
                    PREPAID_CARD:
                      type: array
                      description: List of allowed prepaid card schemes.
                      items:
                        type: string
                        enum:
                          - MASTERCARD
                          - VISA
                          - RUPAY
                          - DINERS
                          - AMEX
                    CORPORATE_CARD:
                      type: array
                      description: List of allowed corporate card schemes.
                      items:
                        type: string
                        enum:
                          - MASTERCARD
                          - VISA
                          - RUPAY
                          - DINERS
                          - AMEX
                    WALLET:
                      type: array
                      description: List of allowed wallet codes.
                      items:
                        type: string
                        examples:
                          - WA007
                      examples:
                        - - WA007
                          - WA004
                    UPI:
                      type: string
                      description: 'null'
                  x-apidog-orders:
                    - NETBANKING
                    - CREDIT_CARD
                    - DEBIT_CARD
                    - PREPAID_CARD
                    - CORPORATE_CARD
                    - WALLET
                    - UPI
                  x-apidog-ignore-properties: []
              x-apidog-orders:
                - 01J1YJR753SCVTRYQKZYWPVDR5
              required:
                - orderId
                - amount
              x-apidog-ignore-properties:
                - orderId
                - amount
                - returnUrl
                - notifyUrl
                - customerInfo
                - customParameters
                - description
                - paymentDetail
                - restrictedPaymentOptions
            examples:
              '1':
                value: ''
              '2':
                value:
                  orderId: RANDOMID123
                  amount:
                    value: 100
                    currency: INR
                  returnUrl: https://glaring-version.net/
                  notifyUrl: https://inconsequential-annual.biz/
                  customerInfo:
                    firstName: Merlin
                    lastName: Collins
                    address:
                      streetName: Jill Zemlak
                      city: Darioside
                      state: Minnesota
                      country: Angola
                      zipcode: '06422'
                    email: Emmitt37@yahoo.com
                    phoneNumber: '9889890909'
                    customerIpAddress: 1.204.130.102
                  customParameters:
                    customParam1: value
                    customParam2: value2
                  description: Order description
                  restrictedPaymentOptions:
                    UPI: null
                    NET_BANKING:
                      - NB001
                    CREDIT_CARD:
                      - MASTERCARD
                summary: Example 2
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationResponseOrderCreateResponse'
              example:
                response_code: 0
                response_message: Success
                payload:
                  redirectionUrl: >-
                    https://checkout-uat-v2.enkash.in/v1/pay/ORD1772002204785PUcI4
                  orderId: ORD1772002204785PUcI4
          headers: {}
          x-apidog-name: OK
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  response_code:
                    type: integer
                    description: Application-level status code.
                  response_message:
                    type: string
                    description: High-level description of the error
                  payload:
                    type: string
                    description: Contains additional error details
                required:
                  - response_code
                  - response_message
                  - payload
                x-apidog-orders:
                  - response_code
                  - response_message
                  - payload
                x-apidog-ignore-properties: []
              example:
                response_code: 117
                response_message: API access denied.
                payload: Token is invalid.
          headers: {}
          x-apidog-name: Bad Request
        '504':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
              example: |-
                <html>
                <head><title>504 Gateway Time-out</title></head>
                <body>
                <center><h1>504 Gateway Time-out</h1></center>
                </body>
                </html>
          headers: {}
          x-apidog-name: Bad Gateway
      security: []
      x-apidog-folder: Payment Gateway/APIs - Payment Gateway /Order
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/616243/apis/api-8990249-run
components:
  schemas:
    OrderCreateRequest:
      required:
        - orderId
        - amount
      type: object
      properties:
        orderId:
          type: string
          description: >-
            A unique identifier for the order in your system. Accepts
            alphanumeric characters only.
        amount:
          type: object
          properties:
            value:
              type: number
              minimum: 0.01
            currency:
              type: string
              enum:
                - INR
              x-apidog-enum:
                - value: INR
                  name: ''
                  description: ''
          x-apidog-orders:
            - value
            - currency
          description: >-
            This specifies the amount for the order, allowing up to two decimal
            places. For example, 20.15 would represent Rs 20 and 15 paisa.
          required:
            - value
            - currency
          x-apidog-ignore-properties: []
        returnUrl:
          type: string
          description: >-
            The URL to which the customer will be redirected after completing
            the payment. returnUrl is required if not configured at merchant
            level
        notifyUrl:
          type: string
          description: >-
            The URL where notifications regarding the order will be sent.
            notifyUrl is required if not configured at merchant level
        customerInfo:
          type: object
          properties:
            firstName:
              type: string
              description: The first name of the customer. Accepts alphabetic characters.
            lastName:
              type: string
              description: The last name of the customer. Accepts alphabetic characters.
            address:
              type: object
              properties:
                streetName:
                  type: string
                city:
                  type: string
                state:
                  type: string
                country:
                  type: string
                zipcode:
                  type: string
              x-apidog-orders:
                - streetName
                - city
                - state
                - country
                - zipcode
              description: >
                The address of the customer. Accepts alphanumeric characters and
                special symbols.
              x-apidog-ignore-properties: []
            email:
              type: string
              description: >
                The email address of the customer. Must be in a valid email
                format.
            phoneNumber:
              type: string
              description: The phone number of the customer. Please exclude +91 ISD code.
            customerIpAddress:
              type: string
              description: The Ip address of the customer
          x-apidog-orders:
            - firstName
            - lastName
            - address
            - email
            - phoneNumber
            - customerIpAddress
          description: ' Information about the customer associated with the order. It typically includes details such as first name, last name, address, email, and phone number.'
          required:
            - customerIpAddress
          x-apidog-ignore-properties: []
        customParameters:
          type: array
          items:
            customParam1: value1
            customParam2: value2
            type: string
          description: >-
            Additional custom parameters or metadata associated with the order,
            if any. These will be key value pairs.
        description:
          type: string
        paymentDetail:
          type: object
          properties:
            accountNumber:
              type: string
              description: Required for UPI TPV flow for non seamless integration
              minLength: 9
              maxLength: 36
            ifsc:
              type: string
              description: Required for UPI TPV flow for non seamless integration
              minLength: 11
              examples:
                - KKBK0000432
              maxLength: 11
              pattern: ^[A-Z]{4}0[A-Z0-9]{6}$
          x-apidog-orders:
            - accountNumber
            - ifsc
          description: Payment related information for UPI TPV flow
          x-apidog-ignore-properties: []
        restrictedPaymentOptions:
          type: object
          description: >-
            Restricts payment options available for this order. If provided,
            only specified modes and codes will be allowed during checkout.
          additionalProperties: false
          properties:
            NETBANKING:
              type: array
              description: List of allowed netbanking bank codes.
              items:
                type: string
              examples:
                - - NB027
                  - NB028
                  - NB031
                  - NB032
            CREDIT_CARD:
              type: array
              description: List of allowed credit card schemes.
              items:
                type: string
                enum:
                  - MASTERCARD
                  - VISA
                  - RUPAY
                  - DINERS
                  - AMEX
            DEBIT_CARD:
              type: array
              description: List of allowed debit card schemes.
              items:
                type: string
                enum:
                  - MASTERCARD
                  - VISA
                  - RUPAY
                  - DINERS
                  - AMEX
            PREPAID_CARD:
              type: array
              description: List of allowed prepaid card schemes.
              items:
                type: string
                enum:
                  - MASTERCARD
                  - VISA
                  - RUPAY
                  - DINERS
                  - AMEX
            CORPORATE_CARD:
              type: array
              description: List of allowed corporate card schemes.
              items:
                type: string
                enum:
                  - MASTERCARD
                  - VISA
                  - RUPAY
                  - DINERS
                  - AMEX
            WALLET:
              type: array
              description: List of allowed wallet codes.
              items:
                type: string
                examples:
                  - WA007
              examples:
                - - WA007
                  - WA004
            UPI:
              type: string
              description: 'null'
          x-apidog-orders:
            - NETBANKING
            - CREDIT_CARD
            - DEBIT_CARD
            - PREPAID_CARD
            - CORPORATE_CARD
            - WALLET
            - UPI
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - orderId
        - amount
        - returnUrl
        - notifyUrl
        - customerInfo
        - customParameters
        - description
        - paymentDetail
        - restrictedPaymentOptions
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ApplicationResponseOrderCreateResponse:
      type: object
      properties:
        response_code:
          type: integer
          format: int32
          description: Application-level status code
        response_message:
          type: string
          description: High-level status description.
        payload:
          type: object
          properties:
            redirectionUrl:
              type: string
              description: >-
                Checkout URL where the customer should be redirected to complete
                payment
            orderId:
              type: string
              description: Unique order identifier generated by the system
          x-apidog-orders:
            - redirectionUrl
            - orderId
          description: Contains order-related response data
          required:
            - redirectionUrl
            - orderId
          x-apidog-ignore-properties: []
      x-apidog-orders:
        - response_code
        - response_message
        - payload
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://ekpayout-uat.enkash.in
    description: Testing Env
security: []

```
