> ## Documentation Index
> Fetch the complete documentation index at: https://www.cashfree.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Order

> ### Order
An order is an entity which has a amount and currency associated with it. It is something for which you want to collect payment for.
Use this API to create orders with Cashfree from your backend to get a `payment_sessions_id`. 
You can use the `payment_sessions_id` to create a transaction for the order.




## OpenAPI

````yaml /openapi/payments/v2022-09-01.yaml post /orders
openapi: 3.0.0
info:
  version: '2022-09-01'
  title: Cashfree Payment Gateway APIs
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    email: developers@cashfree.com
    name: API Support
    url: https://discord.com/invite/QdZkNSxXsB
  description: >-
    Cashfree's Payment Gateway APIs provide developers with a streamlined
    pathway to integrate advanced payment processing capabilities into their
    applications, platforms and websites.
servers:
  - url: https://sandbox.cashfree.com/pg
    description: Sandbox server
  - url: https://api.cashfree.com/pg
    description: Production server
security: []
tags:
  - name: Orders
    description: Collection of APIs to handle orders.
  - name: Payments
    description: Collection of APIs to handle payments.
  - name: Refunds
    description: Collection of APIs to handle refunds.
  - name: Settlements
    description: Collection of APIs to handle settlements.
  - name: Payment Links
    description: Collection of APIs to handle payment links.
  - name: Token Vault
    description: >-
      Collection of APIs to use Cashfree's token Vault. This helps you save
      cards and tokenize them in a PCI complaint manner. We support creation of
      network tokens which can be used across acquiring banks
  - name: softPOS
    description: Collection of APIs to manage softPOS' agent and order
  - name: Offers
    description: Collection of APIs to handle offers
  - name: Eligibility
    description: >-
      Collection of APIs to check eligibile entities - payment methods, offer,
      affordibility
  - name: Settlement Reconciliation
    description: Collection of APIs to handle settlements
  - name: PG Reconciliation
    description: Collection of APIs to handle reconciliation
paths:
  /orders:
    post:
      tags:
        - Orders
      summary: Create Order
      description: >
        ### Order

        An order is an entity which has a amount and currency associated with
        it. It is something for which you want to collect payment for.

        Use this API to create orders with Cashfree from your backend to get a
        `payment_sessions_id`. 

        You can use the `payment_sessions_id` to create a transaction for the
        order.
      operationId: PGCreateOrder
      parameters:
        - $ref: '#/components/parameters/apiVersionHeader'
        - $ref: '#/components/parameters/xRequestIDHeader'
        - $ref: '#/components/parameters/xIdempotencyKeyHeader'
      requestBody:
        $ref: '#/components/requestBodies/CreateOrderRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderEntity'
          headers:
            x-api-version:
              $ref: '#/components/headers/x-api-version'
            x-ratelimit-limit:
              $ref: '#/components/headers/x-ratelimit-limit'
            x-ratelimit-remaining:
              $ref: '#/components/headers/x-ratelimit-remaining'
            x-ratelimit-retry:
              $ref: '#/components/headers/x-ratelimit-retry'
            x-ratelimit-type:
              $ref: '#/components/headers/x-ratelimit-type'
            x-request-id:
              $ref: '#/components/headers/x-request-id'
            x-idempotency-key:
              $ref: '#/components/headers/x-idempotency-key'
            x-idempotency-replayed:
              $ref: '#/components/headers/x-idempotency-replayed'
        '400':
          $ref: '#/components/responses/Response400'
        '401':
          $ref: '#/components/responses/Response401'
        '404':
          $ref: '#/components/responses/Response404'
        '409':
          $ref: '#/components/responses/Response409'
        '422':
          $ref: '#/components/responses/Response422'
        '429':
          $ref: '#/components/responses/Response429'
        '500':
          $ref: '#/components/responses/Response500'
      callbacks:
        PaymentWebhook:
          object Object:
            description: payment webhook object
            post:
              summary: Received payment success webhook
              security: []
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/PaymentSuccessWebhook'
              responses:
                '200':
                  description: OK
                4XX:
                  description: NOT OK. Webhook will be retried
                5XX:
                  description: NOT OK. Webhook will be retried
              method: post
              type: path
            path: object Object
      deprecated: false
      security:
        - XClientID: []
          XClientSecret: []
        - XClientID: []
          XPartnerAPIKey: []
        - XClientID: []
          XClientSignatureHeader: []
        - XPartnerMerchantID: []
          XPartnerAPIKey: []
components:
  parameters:
    apiVersionHeader:
      in: header
      name: x-api-version
      required: true
      description: API version to be used. Format is in YYYY-MM-DD
      schema:
        type: string
        description: API version to be used
        default: '2022-09-01'
      example: '2022-09-01'
    xRequestIDHeader:
      in: header
      name: x-request-id
      description: >-
        Request id for the API call. Can be used to resolve tech issues.
        Communicate this in your tech related queries to cashfree
      required: false
      schema:
        type: string
      example: 4dfb9780-46fe-11ee-be56-0242ac120002
    xIdempotencyKeyHeader:
      in: header
      name: x-idempotency-key
      required: false
      description: >
        Idempotency works by saving the resulting status code and body of the
        first request made for any given idempotency key, regardless of whether
        it succeeded or failed. Subsequent requests with the same key return the
        same result, including 500 errors.


        Currently supported on all POST calls that uses x-client-id &
        x-client-secret. To use enable, pass x-idempotency-key in the request
        header. The value of this header must be unique to each operation you
        are trying to do. One example can be to use the same order_id that you
        pass while creating orders 
      schema:
        type: string
        format: UUID
      example: 47bf8872-46fe-11ee-be56-0242ac120002
  requestBodies:
    CreateOrderRequest:
      description: Request body to create an order at cashfree
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateOrderRequest'
          examples:
            order_minimum:
              $ref: '#/components/examples/order_minimum'
            order_orderid:
              $ref: '#/components/examples/order_orderid'
            order_customer:
              $ref: '#/components/examples/order_customer'
            order_with_return_url:
              $ref: '#/components/examples/order_with_return_url'
            order_with_webhook_url:
              $ref: '#/components/examples/order_with_webhook_url'
            order_with_payment_methods:
              $ref: '#/components/examples/order_with_payment_methods'
            order_expiry:
              $ref: '#/components/examples/order_expiry'
            order_note:
              $ref: '#/components/examples/order_note'
            order_tags:
              $ref: '#/components/examples/order_tags'
            order_splits_amount:
              $ref: '#/components/examples/order_splits_amount'
            order_splits_cent:
              $ref: '#/components/examples/order_splits_cent'
            order_invoice:
              $ref: '#/components/examples/order_invoice'
            order_customer_tpv:
              $ref: '#/components/examples/order_customer_tpv'
  schemas:
    OrderEntity:
      title: OrderEntity
      type: object
      description: The complete order entity
      example:
        $ref: '#/components/examples/order_entity_list_example/value/0'
      properties:
        cf_order_id:
          type: integer
          format: int64
          description: unique id generated by cashfree for your order
        order_id:
          type: string
          description: order_id sent during the api request
        entity:
          type: string
          description: Type of the entity.
        order_currency:
          type: string
          description: Currency of the order. Example INR
        order_amount:
          type: number
        order_status:
          type: string
          description: >
            Possible values are 

            - `ACTIVE`: Order does not have a sucessful transaction yet

            - `PAID`: Order is PAID with one successful transaction

            - `EXPIRED`: Order was not PAID and not it has expired. No
            transaction can be initiated for an EXPIRED order.
        payment_session_id:
          type: string
        order_expiry_time:
          type: string
          format: date-time
        order_note:
          type: string
          description: Additional note for order
          nullable: true
        created_at:
          type: string
          format: date-time
          description: When the order was created at cashfree's server
          example: '2022-08-16T14:45:38+05:30'
        order_splits:
          type: array
          items:
            $ref: '#/components/schemas/VendorSplit'
        customer_details:
          $ref: '#/components/schemas/CustomerDetails'
        order_meta:
          $ref: '#/components/schemas/OrderMeta'
        payments:
          $ref: '#/components/schemas/PaymentURLObject'
        settlements:
          $ref: '#/components/schemas/SettlementURLObject'
        refunds:
          $ref: '#/components/schemas/RefundURLObject'
        order_tags:
          $ref: '#/components/schemas/OrderTags'
    PaymentSuccessWebhook:
      title: PaymentSuccessWebhook
      description: object for payment success webhook
      type: object
      properties:
        data:
          $ref: '#/components/schemas/WHdata'
        event_time:
          type: string
          example: '2021-10-07T19:42:44+05:30'
        type:
          type: string
          example: PAYMENT_SUCCESS_WEBHOOK
      example:
        data:
          $ref: '#/components/schemas/WHdata/example'
        event_time: '2021-10-07T19:42:44+05:30'
        type: PAYMENT_SUCCESS_WEBHOOK
    CreateOrderRequest:
      title: CreateOrderRequest
      description: Request body to create an order at cashfree
      type: object
      properties:
        order_id:
          type: string
          description: >-
            Order identifier present in your system. Alphanumeric, '_' and '-'
            only
          minLength: 3
          maxLength: 45
          nullable: true
          example: your-order-id
        order_amount:
          type: number
          description: >-
            Bill amount for the order. Provide upto two decimals. 10.15 means Rs
            10 and 15 paisa
          format: double
          example: 10.15
          minimum: 1
        order_currency:
          type: string
          description: >-
            Currency for the order. INR if left empty. Fill out the [Support
            Form](https://merchant.cashfree.com/merchants/landing?env=prod&raise_issue=1)
            to enable new currencies.
          example: INR
        customer_details:
          allOf:
            - $ref: '#/components/schemas/CustomerDetails'
          example:
            customer_id: 7112AAA812234
            customer_email: john@cashfree.com
            customer_phone: '9908734801'
        terminal:
          allOf:
            - $ref: '#/components/schemas/TerminalDetails'
          nullable: true
          example:
            terminal_phone_no: '6309291183'
            terminal_id: terminal-1212
            terminal_type: SPOS
        order_meta:
          allOf:
            - $ref: '#/components/schemas/OrderMeta'
          example:
            return_url: https://example.com?order_id={order_id}
            notify_url: https://example.com/webhook.php
            payment_methods: cc,dc
          nullable: true
        order_expiry_time:
          type: string
          format: ISO8601
          description: >-
            Time after which the order expires. Customers will not be able to
            make the payment beyond the time specified here. We store timestamps
            in IST, but you can provide them in a valid ISO 8601 time format.
            Example 2021-07-02T10:20:12+05:30 for IST, 2021-07-02T10:20:12Z for
            UTC
          example: '2021-07-02T10:20:12+05:30'
        order_note:
          type: string
          description: Order note for reference.
          example: Test order
          minLength: 3
          maxLength: 200
          nullable: true
        order_tags:
          allOf:
            - $ref: '#/components/schemas/OrderTags'
          example:
            name: John Doe
            city: Bangalore
          nullable: true
        order_splits:
          type: array
          description: >-
            If you have Easy split enabled in your Cashfree account then you can
            use this option to split the order amount.
          items:
            $ref: '#/components/schemas/VendorSplit'
          nullable: true
          example:
            - amount: 10
              vendor: john
      required:
        - order_amount
        - order_currency
        - customer_details
    VendorSplit:
      title: VendorSplit
      description: >-
        Use to split order when cashfree's Easy Split is enabled for your
        account.
      type: object
      example:
        vendor_id: Vendor01
        amount: 100.12
        description: order amount should be more than equal to 100.12
      properties:
        vendor_id:
          type: string
          description: Vendor id created in Cashfree system
        amount:
          type: number
          description: Amount which will be associated with this vendor
        percentage:
          type: number
          description: Percentage of order amount which shall get added to vendor account
    CustomerDetails:
      title: CustomerDetails
      description: >-
        The customer details that are necessary. Note that you can pass dummy
        details if your use case does not require the customer details.
      example:
        customer_id: 7112AAA812234
        customer_email: john@cashfree.com
        customer_phone: '9908734801'
        customer_name: John Doe
        customer_bank_account_number: '1518121112'
        customer_bank_ifsc: XITI0000001
        customer_bank_code: 3333
      type: object
      properties:
        customer_id:
          type: string
          description: A unique identifier for the customer. Use alphanumeric values only.
          minLength: 3
          maxLength: 50
        customer_email:
          type: string
          description: Customer email address.
          minLength: 3
          maxLength: 100
          nullable: true
        customer_phone:
          type: string
          description: Customer phone number.
          minLength: 10
          maxLength: 10
        customer_name:
          type: string
          description: Name of the customer.
          minLength: 3
          maxLength: 100
          nullable: true
        customer_bank_account_number:
          type: string
          description: >-
            Customer bank account. Required if you want to do a bank account
            check (TPV)
          minLength: 3
          maxLength: 20
          nullable: true
        customer_bank_ifsc:
          type: string
          description: >-
            Customer bank IFSC. Required if you want to do a bank account check
            (TPV)
          nullable: true
        customer_bank_code:
          type: number
          nullable: true
          description: >-
            Customer bank code. Required for net banking payments, if you want
            to do a bank account check (TPV)
      required:
        - customer_id
        - customer_phone
    OrderMeta:
      title: OrderMeta
      description: >-
        Optional meta details to control how the customer pays and how payment
        journey completes
      type: object
      properties:
        return_url:
          type: string
          nullable: true
          example: https://example.com/return?order_id={order_id}
          description: >-
            The URL to which user will be redirected to after the payment on
            bank OTP page. Maximum length: 250. The return_url must contain
            placeholder {order_id}. When redirecting the customer back to the
            return url from the bank’s OTP page, Cashfree will replace this
            placeholder with the actual value for that order.
        notify_url:
          type: string
          nullable: true
          example: https://example.com/cf_notify
          description: >-
            Notification URL for server-server communication. Useful when user's
            connection drops while re-directing. NotifyUrl should be an https
            URL. Maximum length: 250.
        payment_methods:
          nullable: true
          example: cc,dc,upi
          description: >-
            Allowed payment modes for this order. Pass comma-separated values
            among following options - "cc", "dc", "ccc",
            "ppc","nb","upi","paypal","app","paylater","cardlessemi","dcemi","ccemi","banktransfer".
            Leave it blank to show all available payment methods
    PaymentURLObject:
      title: PaymentURLObject
      description: URL for payment retrieval for an order
      type: object
      properties:
        url:
          type: string
          example: >-
            https://sandbox.cashfree.com/pg/orders/order_271vovQ3PTZAx3fDI0xtZbC4jkPET/payments
    SettlementURLObject:
      title: SettlementURLObject
      description: Settlement URL object
      type: object
      properties:
        url:
          type: string
          example: >-
            https://sandbox.cashfree.com/pg/orders/order_271vovQ3PTZAx3fDI0xtZbC4jkPET/settlements
    RefundURLObject:
      title: RefundURLObject
      description: URL to get refunds for order
      type: object
      properties:
        url:
          type: string
          example: >-
            https://sandbox.cashfree.com/pg/orders/order_271vovQ3PTZAx3fDI0xtZbC4jkPET/refunds
    OrderTags:
      type: object
      nullable: true
      maxProperties: 15
      description: >-
        Custom Tags in thr form of {"key":"value"} which can be passed for an
        order. A maximum of 10 tags can be added
      additionalProperties:
        type: string
        minLength: 1
        maxLength: 255
      example:
        product: Laptop
        shipping_address: 123 Main St
    BadRequestError:
      title: BadRequestError
      description: Invalid request received from client
      example:
        message: bad URL, please check API documentation
        code: request_failed
        type: invalid_request_error
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        type:
          type: string
          enum:
            - invalid_request_error
    AuthenticationError:
      title: AuthenticationError
      description: Error if api keys are wrong
      example:
        message: authentication Failed
        code: request_failed
        type: authentication_error
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        type:
          type: string
          description: authentication_error
    ApiError404:
      title: ApiError404
      description: Error when resource requested is not found
      example:
        message: something is not found
        code: somethind_not_found
        type: invalid_request_error
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        type:
          type: string
          enum:
            - invalid_request_error
          description: invalid_request_error
    ApiError409:
      title: ApiError409
      description: duplicate request
      example:
        message: order with same id is already present
        code: order_already_exists
        type: invalid_request_error
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        type:
          type: string
          enum:
            - invalid_request_error
          description: invalid_request_error
    IdempotencyError:
      title: IdempotencyError
      description: >-
        Error when idempotency fails. Different request body with the same
        idempotent key
      example:
        message: something is not found
        code: request_invalid
        type: idempotency_error
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        type:
          type: string
          enum:
            - idempotency_error
          description: idempotency_error
    RateLimitError:
      title: RateLimitError
      description: Error when rate limit is breached for your api
      example:
        message: Too many requests from IP. Check headers
        code: request_failed
        type: rate_limit_error
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        type:
          type: string
          enum:
            - rate_limit_error
          description: rate_limit_error
    ApiError:
      title: ApiError
      description: Error at cashfree's server
      example:
        message: internal Server Error
        code: internal_error
        type: api_error
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        type:
          type: string
          enum:
            - api_error
          description: api_error
    WHdata:
      type: object
      description: webhook object
      properties:
        order:
          example:
            $ref: '#/components/schemas/WHorder/example'
          allOf:
            - $ref: '#/components/schemas/WHorder'
        payment:
          allOf:
            - $ref: '#/components/schemas/PaymentEntity'
          example:
            $ref: '#/components/examples/payments_entity_list_example/value/0'
        customer_details:
          allOf:
            - $ref: '#/components/schemas/WHcustomer_details'
          example:
            $ref: '#/components/schemas/WHcustomer_details/example'
      example:
        order:
          $ref: '#/components/schemas/WHorder/example'
        payment:
          $ref: '#/components/examples/payments_entity_list_example/value/0'
        customer_details:
          $ref: '#/components/schemas/WHcustomer_details/example'
    TerminalDetails:
      description: Use this if you are creating an order for cashfree's softPOS
      example:
        added_on: '2023-08-04T13:12:58+05:30'
        cf_terminal_id: 1051123
        last_updated_on: '2023-09-06T14:07:00+05:30'
        terminal_address: Banglore
        terminal_id: terminal-123
        terminal_name: test
        terminal_note: POS vertical
        terminal_phone_no: '6309291183'
        terminal_status: ACTIVE
        terminal_type: SPOS
      properties:
        added_on:
          description: date time at which terminal is added
          type: string
        cf_terminal_id:
          description: cashfree terminal id
          type: integer
        last_updated_on:
          description: last instant when this terminal was updated
          type: string
        terminal_address:
          description: location of terminal
          type: string
        terminal_id:
          description: terminal id for merchant reference
          maxLength: 100
          minLength: 3
          type: string
        terminal_name:
          description: name of terminal/agent/storefront
          type: string
        terminal_note:
          description: note given by merchant while creating the terminal
          type: string
        terminal_phone_no:
          description: mobile num of the terminal/agent/storefront
          type: string
        terminal_status:
          description: status of terminal active/inactive
          type: string
        terminal_type:
          description: >-
            To identify the type of terminal product in use, in this case it is
            SPOS.
          maxLength: 10
          minLength: 4
          type: string
      required:
        - terminal_phone_no
        - terminal_type
      title: Terminal
      type: object
    WHorder:
      type: object
      description: order entity in webhook
      properties:
        order_id:
          type: string
        order_amount:
          type: number
          format: double
        order_currency:
          type: string
        order_tags:
          allOf:
            - $ref: '#/components/schemas/OrderTags'
          nullable: true
      example:
        order_id: '1633615918'
        order_amount: 1
        order_currency: INR
        order_tags:
          name: john
    PaymentEntity:
      title: PaymentEntity
      type: object
      description: payment entity full object
      example:
        $ref: '#/components/examples/payments_entity_list_example/value/0'
      properties:
        cf_payment_id:
          type: integer
          format: int64
        order_id:
          type: string
        entity:
          type: string
        error_details:
          $ref: '#/components/schemas/ErrorDetailsInPaymentsEntity'
        is_captured:
          type: boolean
        order_amount:
          type: number
          description: >-
            Order amount can be different from payment amount if you collect
            service fee from the customer
        payment_group:
          type: string
          description: >-
            Type of payment group. One of ['upi', 'card', 'app', 'netbanking',
            'paylater', 'cardless_emi']
        payment_currency:
          type: string
        payment_amount:
          type: number
        payment_time:
          type: string
          description: This is the time when the payment was initiated
        payment_completion_time:
          type: string
          description: This is the time when the payment reaches its terminal state
        payment_status:
          type: string
          enum:
            - SUCCESS
            - NOT_ATTEMPTED
            - FAILED
            - USER_DROPPED
            - VOID
            - CANCELLED
            - PENDING
          description: >-
            The transaction status can be one of  ["SUCCESS", "NOT_ATTEMPTED",
            "FAILED", "USER_DROPPED", "VOID", "CANCELLED", "PENDING"]
        payment_message:
          type: string
        bank_reference:
          type: string
        auth_id:
          type: string
        authorization:
          $ref: '#/components/schemas/AuthorizationInPaymentsEntity'
        payment_method:
          $ref: '#/components/schemas/PaymentMethodInPaymentsEntity'
    WHcustomer_details:
      type: object
      description: customer details object in webhook
      properties:
        customer_name:
          type: string
          example: Yogesh
        customer_id:
          type: string
          example: '12121212'
        customer_email:
          type: string
          example: yogesh.miglani@gmail.com
        customer_phone:
          type: string
          example: '9666699999'
      example:
        $ref: '#/components/schemas/CustomerDetails/example'
    ErrorDetailsInPaymentsEntity:
      title: ErrorDetailsInPayments
      description: The error details are present only for failed payments
      example:
        error_code: TRANSACTION_DECLINED
        error_description: issuer bank or payment service provider declined the transaction
        error_reason: auth_declined
        error_source: customer
        error_code_raw: ZM
        error_description_raw: INVALID / INCORRECT MPIN
        error_subcode_raw: ''
      type: object
      properties:
        error_code:
          type: string
        error_description:
          type: string
        error_reason:
          type: string
        error_source:
          type: string
        error_code_raw:
          type: string
        error_description_raw:
          type: string
        error_subcode_raw:
          type: string
    AuthorizationInPaymentsEntity:
      title: AuthorizationInPayments
      description: If preauth enabled for account you will get this body
      nullable: true
      example:
        action: CAPTURE
        status: PENDING
        captured_amount: 100
        start_time: '2022-02-09T18:04:34+05:30'
        end_time: '2022-02-19T18:04:34+05:30'
        approve_by: '2022-02-09T18:04:34+05:30'
        action_reference: '6595231908096894505959'
        action_time: '2022-08-03T16:09:51'
      type: object
      properties:
        action:
          type: string
          enum:
            - CAPTURE
            - VOID
          description: One of CAPTURE or VOID
        status:
          type: string
          enum:
            - SUCCESS
            - PENDING
          description: One of SUCCESS or PENDING
        captured_amount:
          type: number
          description: The captured amount for this authorization request
        start_time:
          type: string
          description: Start time of this authorization hold (only for UPI)
        end_time:
          type: string
          description: End time of this authorization hold (only for UPI)
        approve_by:
          type: string
          description: >-
            Approve by time as passed in the authorization request (only for
            UPI)
        action_reference:
          type: string
          description: 'CAPTURE or VOID reference number based on action '
        action_time:
          type: string
          description: Time of action (CAPTURE or VOID)
    PaymentMethodInPaymentsEntity:
      title: PaymentMethodInPaymentsEntity
      description: payment methods all
      properties:
        payment_method:
          oneOf:
            - $ref: '#/components/schemas/PaymentMethodCardInPaymentsEntity'
            - $ref: '#/components/schemas/PaymentMethodNetBankingInPaymentsEntity'
            - $ref: '#/components/schemas/PaymentMethodUPIInPaymentsEntity'
            - $ref: '#/components/schemas/PaymentMethodAppInPaymentsEntity'
            - $ref: '#/components/schemas/PaymentMethodCardlessEMIInPaymentsEntity'
            - $ref: '#/components/schemas/PaymentMethodPaylaterInPaymentsEntity'
      example:
        $ref: '#/components/schemas/PaymentMethodCardInPaymentsEntity/example'
    PaymentMethodCardInPaymentsEntity:
      title: PaymentMethodCardInPaymentsEntity
      description: payment method card object in payment entity
      example:
        channel: link
        card_number: 41111xxxxxx111
        card_network: visa
        card_type: credit_card
        card_country: IN
        card_bank_name: HDFC Bank
        card_network_reference_id: '100212023061229'
      type: object
      properties:
        channel:
          type: string
        card_number:
          type: string
        card_network:
          type: string
        card_type:
          type: string
        card_country:
          type: string
        card_bank_name:
          type: string
        card_network_reference_id:
          type: string
    PaymentMethodNetBankingInPaymentsEntity:
      title: PaymentMethodNetBankingInPaymentsEntity
      description: netbanking payment method object for pay
      example:
        channel: link
        netbanking_bank_code: 3044
        netbanking_bank_name: State Bank of India
      type: object
      properties:
        channel:
          type: string
        netbanking_bank_code:
          type: integer
        netbanking_bank_name:
          type: string
      required:
        - channel
        - netbanking_bank_name
        - netbanking_bank_code
    PaymentMethodUPIInPaymentsEntity:
      title: PaymentMethodUPIInPaymentsEntity
      description: UPI payment method for pay api
      example:
        channel: collect
        upi_id: 980123781@upi
      type: object
      properties:
        channel:
          type: string
        upi_id:
          type: string
      required:
        - channel
    PaymentMethodAppInPaymentsEntity:
      title: PaymentMethodAppInPaymentsEntity
      description: payment method app object in payment entity
      example:
        channel: link
        provider: paytm
        phone: '1234512345'
      type: object
      properties:
        channel:
          type: string
        provider:
          type: string
        phone:
          type: string
    PaymentMethodCardlessEMIInPaymentsEntity:
      title: PaymentMethodCardlessEMIInPaymentsEntity
      description: payment method carless object in payment entity
      example:
        channel: link
        provider: flexmoney
        phone: '9908761211'
      type: object
      properties:
        channel:
          type: string
        provider:
          type: string
        phone:
          type: string
    PaymentMethodPaylaterInPaymentsEntity:
      title: PaymentMethodPaylaterInPaymentsEntity
      description: paylater payment method object for pay api
      example:
        channel: link
        provider: lazypay
        phone: '9908761211'
      type: object
      properties:
        channel:
          type: string
        provider:
          type: string
        phone:
          type: string
  headers:
    x-api-version:
      schema:
        type: string
        format: YYYY-MM-DD
        enum:
          - '2022-09-01'
      description: >-
        This header has the version of the API. The current version is
        `2022-09-01`.
    x-ratelimit-limit:
      schema:
        type: integer
      example: 200
      description: Ratelimit set for your account for this API per minute
    x-ratelimit-remaining:
      schema:
        type: integer
      example: 2
      description: >-
        Rate limit remaning for your account for this API in the next minute.
        Uses sliding window
    x-ratelimit-retry:
      schema:
        type: integer
      example: 4
      description: |
        Contains number of seconds to wait if rate limit is breached
        - Is 0 if withing the limit
        - Is between 1 and 59 if breached
    x-ratelimit-type:
      schema:
        type: string
        enum:
          - app_id
          - ip
      example: ip
      description: >
        either ip or app_id

        - `ip` if making a call from the browser. True for api where you don't
        need `x-client-id` and `x-client-secret`

        - `app_id` for authenticated api calls i.e using `x-client-id` and
        `x-client-secret`
    x-request-id:
      schema:
        type: string
      example: some-req-id
      description: >-
        Request id for your api call. Is blank or null if no `x-request-id` is
        sent during the request
    x-idempotency-key:
      schema:
        type: string
      example: some-idem-id
      description: Idempotency key used during the request. Applicable for POST only
    x-idempotency-replayed:
      schema:
        type: string
        format: boolean
      example: 'true'
      description: |-
        In conjunction with `x-idempotency-key` this means
        - `true` if the response was replayed
        - `false` if the response has not been replayed
  responses:
    Response400:
      description: Bad request error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequestError'
      headers:
        x-api-version:
          $ref: '#/components/headers/x-api-version'
        x-ratelimit-limit:
          $ref: '#/components/headers/x-ratelimit-limit'
        x-ratelimit-remaining:
          $ref: '#/components/headers/x-ratelimit-remaining'
        x-ratelimit-retry:
          $ref: '#/components/headers/x-ratelimit-retry'
        x-ratelimit-type:
          $ref: '#/components/headers/x-ratelimit-type'
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-idempotency-key:
          $ref: '#/components/headers/x-idempotency-key'
        x-idempotency-replayed:
          $ref: '#/components/headers/x-idempotency-replayed'
    Response401:
      description: Authentication Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthenticationError'
      headers:
        x-api-version:
          $ref: '#/components/headers/x-api-version'
        x-ratelimit-limit:
          $ref: '#/components/headers/x-ratelimit-limit'
        x-ratelimit-remaining:
          $ref: '#/components/headers/x-ratelimit-remaining'
        x-ratelimit-retry:
          $ref: '#/components/headers/x-ratelimit-retry'
        x-ratelimit-type:
          $ref: '#/components/headers/x-ratelimit-type'
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-idempotency-key:
          $ref: '#/components/headers/x-idempotency-key'
        x-idempotency-replayed:
          $ref: '#/components/headers/x-idempotency-replayed'
    Response404:
      description: Resource Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError404'
      headers:
        x-api-version:
          $ref: '#/components/headers/x-api-version'
        x-ratelimit-limit:
          $ref: '#/components/headers/x-ratelimit-limit'
        x-ratelimit-remaining:
          $ref: '#/components/headers/x-ratelimit-remaining'
        x-ratelimit-retry:
          $ref: '#/components/headers/x-ratelimit-retry'
        x-ratelimit-type:
          $ref: '#/components/headers/x-ratelimit-type'
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-idempotency-key:
          $ref: '#/components/headers/x-idempotency-key'
        x-idempotency-replayed:
          $ref: '#/components/headers/x-idempotency-replayed'
    Response409:
      description: Resource already present
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError409'
      headers:
        x-api-version:
          $ref: '#/components/headers/x-api-version'
        x-ratelimit-limit:
          $ref: '#/components/headers/x-ratelimit-limit'
        x-ratelimit-remaining:
          $ref: '#/components/headers/x-ratelimit-remaining'
        x-ratelimit-retry:
          $ref: '#/components/headers/x-ratelimit-retry'
        x-ratelimit-type:
          $ref: '#/components/headers/x-ratelimit-type'
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-idempotency-key:
          $ref: '#/components/headers/x-idempotency-key'
        x-idempotency-replayed:
          $ref: '#/components/headers/x-idempotency-replayed'
    Response422:
      description: Idempotency error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IdempotencyError'
      headers:
        x-api-version:
          $ref: '#/components/headers/x-api-version'
        x-ratelimit-limit:
          $ref: '#/components/headers/x-ratelimit-limit'
        x-ratelimit-remaining:
          $ref: '#/components/headers/x-ratelimit-remaining'
        x-ratelimit-retry:
          $ref: '#/components/headers/x-ratelimit-retry'
        x-ratelimit-type:
          $ref: '#/components/headers/x-ratelimit-type'
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-idempotency-key:
          $ref: '#/components/headers/x-idempotency-key'
        x-idempotency-replayed:
          $ref: '#/components/headers/x-idempotency-replayed'
    Response429:
      description: Rate Limit Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
      headers:
        x-api-version:
          $ref: '#/components/headers/x-api-version'
        x-ratelimit-limit:
          $ref: '#/components/headers/x-ratelimit-limit'
        x-ratelimit-remaining:
          $ref: '#/components/headers/x-ratelimit-remaining'
        x-ratelimit-retry:
          $ref: '#/components/headers/x-ratelimit-retry'
        x-ratelimit-type:
          $ref: '#/components/headers/x-ratelimit-type'
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-idempotency-key:
          $ref: '#/components/headers/x-idempotency-key'
        x-idempotency-replayed:
          $ref: '#/components/headers/x-idempotency-replayed'
    Response500:
      description: API related Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
      headers:
        x-api-version:
          $ref: '#/components/headers/x-api-version'
        x-ratelimit-limit:
          $ref: '#/components/headers/x-ratelimit-limit'
        x-ratelimit-remaining:
          $ref: '#/components/headers/x-ratelimit-remaining'
        x-ratelimit-retry:
          $ref: '#/components/headers/x-ratelimit-retry'
        x-ratelimit-type:
          $ref: '#/components/headers/x-ratelimit-type'
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-idempotency-key:
          $ref: '#/components/headers/x-idempotency-key'
        x-idempotency-replayed:
          $ref: '#/components/headers/x-idempotency-replayed'
  examples:
    order_minimum:
      summary: Minimun required details
      description: Minimum set of parameters needed to create an order at cashfree
      value:
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9898989898'
    order_orderid:
      summary: Specify your order_id
      description: >-
        You should always send `order_id`. If not sent Cashfree will generate
        one for you. This is useful during other api calls
      value:
        order_id: playstation_purchase_1
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9908734801'
    order_customer:
      summary: Customer Details
      description: Complete customer details
      value:
        order_id: playstation_purchase_1
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9908734801'
          customer_email: john@example.com
          customer_name: John Doe
    order_with_return_url:
      summary: With return/callback URL
      description: add a return url to your order
      value:
        order_id: playstation_purchase_2
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9898989898'
        order_meta:
          return_url: https://example.com?order_id={order_id}
    order_with_webhook_url:
      summary: With webhook/notify URL
      description: >-
        Cashfree will send webhook here if specified. Read more
        [here](https://docs.cashfree.com/docs/pg-webhooks)
      value:
        order_id: playstation_purchase_3
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9898989898'
        order_meta:
          return_url: https://example.com?order_id={order_id}
          notify_url: https://example.com?cf-callback
    order_with_payment_methods:
      summary: With Payment Methods URL
      description: >-
        add payment methods, customer can pnly pay using these payment methods
        only
      value:
        order_id: playstation_purchase_4
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9898989898'
        order_meta:
          return_url: https://example.com?order_id={order_id}
          notify_url: https://example.com?cf-callback
          payment_methods: cc,dc,upi
    order_expiry:
      summary: With future expiry time for order
      description: >-
        Add an exipry time for your order. No transactions would be accepted
        after the order has expired
      value:
        order_id: playstation_purchase_5
        order_currency: INR
        order_amount: 10.34
        order_expiry_time: '2021-07-29T00:00:00.000Z'
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9898989898'
    order_note:
      summary: With additonal note
      description: >-
        Add an additional note for your order which you can later use. It has to
        be string. For more detailed data use `order_tags`
      value:
        order_id: playstation_purchase_6
        order_currency: INR
        order_amount: 10.34
        order_note: John buying playstation
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9898989898'
    order_tags:
      summary: With order tags
      description: Add key value pairs to your order. Can be used later in your workflow
      value:
        order_id: playstation_purchase_6
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9898989898'
        order_tags:
          address: Bengaluru, India
          pincode: '560034'
    order_splits_amount:
      summary: With order split Amount
      description: >-
        Create an order where the amount received will be split between vendor
        and merchant based on absolute amount.
      value:
        order_id: playstation_purchase_8
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9898989898'
        order_splits:
          - vendor_id: Jane
            amount: 1.45
          - vendor_id: Barbie
            amount: 3.45
    order_splits_cent:
      summary: With order split Percentage
      description: >
        Create an order where the amount received will be split between vendors
        and merchant based on percentage.

        In the below example order amount, let us say INR 200 will be divided
        like this

        - 33% to merchant becomes INR 66 

        - 20% to Jane becomes INR 40

        - 47% to Barbie becomes INR 94
      value:
        order_id: playstation_purchase_8
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9898989898'
        order_splits:
          - vendor_id: Jane
            percentage: 20
          - vendor_id: Barbie
            percentage: 47
    order_invoice:
      summary: With order invoice
      description: Add invoice details for your order
      value:
        order_id: playstation_purchase_6
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_phone: '9898989898'
        order_tags:
          gst: '1'
          gstin: 27AAFCN5072P1ZV
          invoice_date: '2023-06-20T04:35:16.748Z'
          invoice_number: inv1687149916474
          invoice_link: https://example.com/cf/nextgen.php#section-2
          invoice_name: Walters Invoice
          cgst: '1'
          sgst: '1'
          igst: '1'
          cess: '1'
          gst_incentive: '1'
          gst_percentage: '1'
          pincode: '560034'
          city_tier: TIER1
    order_customer_tpv:
      summary: Customer TPV
      description: >-
        Customer with bank details if provided he or she can pay by only that
        bank account
      value:
        order_id: playstation_purchase_1
        order_currency: INR
        order_amount: 10.34
        customer_details:
          customer_id: 7112AAA812234
          customer_name: John Doe
          customer_phone: '9908734801'
          customer_email: john@example.com
          customer_bank_ifsc: XDFC0000045
          customer_bank_account_number: '123124123123123'
          customer_bank_code: 3021
  securitySchemes:
    XClientID:
      type: apiKey
      in: header
      name: x-client-id
      description: >-
        Client app ID. You can find your app id in the [Merchant
        Dashboard](https://merchant.cashfree.com/auth/login/pg/developers/api-keys?env=prod).
    XClientSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        Client secret key. You can find your secret in the [Merchant
        Dashboard](https://merchant.cashfree.com/auth/login/pg/developers/api-keys?env=prod).
    XPartnerAPIKey:
      type: apiKey
      in: header
      name: x-partner-apikey
      description: >-
        If you are partner and you are making an api call on behalf of a
        merchant
    XClientSignatureHeader:
      type: apiKey
      in: header
      name: x-client-signature
      description: >-
        Use this if you do not want to pass the secret key and instead want to
        use signature
    XPartnerMerchantID:
      type: apiKey
      in: header
      name: x-partner-merchantid
      description: >-
        If you are partner use this to specify the merchant id if you don't have
        the merchant client app id

````