> ## 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

> Use this API to create a new order in the Flowwise system. An order represents a transaction request with a specified amount and customer details. Once created, the order returns a checkout URL and order hash that can be used to initiate payments.




## OpenAPI

````yaml /openapi/payments/flowwise.yaml post /orders
openapi: 3.0.3
info:
  title: Flowwise Native API
  version: 1.0.0
  description: >
    Manage orders, payments, refunds, and customers using the Flowwise Native
    API.

    [Source](https://cashfree.atlassian.net/wiki/spaces/ORC/pages/1084032020/API+Documentation)
servers:
  - url: https://sandbox.flowwise.com/router
    description: Sandbox
  - url: https://app.flowwise.com/router
    description: Production
security:
  - ApiKeyAuth: []
    ApiSecret: []
paths:
  /orders:
    post:
      summary: Create Order
      description: >
        Use this API to create a new order in the Flowwise system. An order
        represents a transaction request with a specified amount and customer
        details. Once created, the order returns a checkout URL and order hash
        that can be used to initiate payments.
      requestBody:
        required: true
        description: Request parameters to create a new order.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderRequest'
            example:
              order_id: order_summer_fashion_001
              order_amount: 2299.5
              order_currency: INR
              customer_details:
                customer_email: priya.sharma@example.com
                customer_phone: '+919876543210'
                customer_address: 123 Connaught Place, New Delhi, Delhi 110001, India
                customer_id: cust_priya_sharma_2024
              payment_methods: cc,dc,upi,nb,wallet
              expiry_time_in_minutes: 120
              order_note: Summer collection dress - Medium size, Blue color
              order_tags:
                source: mobile_app
                campaign: summer_sale_2024
                customer_segment: premium
              return_base_url: https://mystore.com/payment-success
      responses:
        '200':
          description: Success response for order creation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderResponse'
              example:
                order_id: order_summer_fashion_001
                project_id: proj_fashion_store_2024
                customer_email: priya.sharma@example.com
                customer_id: cust_priya_sharma_2024
                order_status: ACTIVE
                order_currency: INR
                payment_methods: cc,dc,upi,nb,wallet
                order_note: Summer collection dress - Medium size, Blue color
                checkout_url: >-
                  https://payments.flowwise.com/checkout/order_summer_fashion_001
                order_hash: a7f8e3d2c1b9f4e6d8a2c5b7f9e3d1a8
                order_expiry_time: '2024-12-03T16:30:00Z'
                added_on: '2024-12-03T14:30:00Z'
        '400':
          description: Bad Request - Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Invalid order amount. Amount must be greater than 0
                code: invalid_amount
                type: validation_error
        '401':
          description: Unauthorized - Invalid or missing authentication credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Invalid API credentials provided
                code: unauthorized
                type: authentication_error
        '500':
          description: Internal Server Error - Something went wrong on the server
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Internal server error occurred while creating order
                code: internal_error
                type: server_error
      security:
        - ApiKeyAuth: []
          ApiSecret: []
components:
  schemas:
    CreateOrderRequest:
      type: object
      required:
        - order_id
        - order_amount
        - order_currency
        - customer_details
      properties:
        order_id:
          type: string
          description: Unique identifier for the order.
          example: order_summer_fashion_001
        order_amount:
          type: number
          format: float
          description: Total amount for the order.
          example: 2299.5
        order_currency:
          type: string
          description: Currency code for the order amount.
          example: INR
        customer_details:
          $ref: '#/components/schemas/CustomerDetails'
        payment_methods:
          type: string
          description: Allowed payment methods for the order.
          example: cc,dc,upi,nb,wallet
        expiry_time_in_minutes:
          type: integer
          description: Time in minutes after which the order expires.
          example: 120
        order_note:
          type: string
          description: Additional notes or description for the order.
          example: Summer collection dress - Medium size, Blue color
        order_tags:
          $ref: '#/components/schemas/OrderTags'
        return_base_url:
          type: string
          format: uri
          description: >-
            Base URL where the customer will be redirected after payment
            completion.
          example: https://mystore.com/payment-success
    CreateOrderResponse:
      type: object
      properties:
        order_id:
          type: string
          description: Unique identifier for the order.
          example: order_summer_fashion_001
        project_id:
          type: string
          description: Identifier for the project associated with the order.
          example: proj_fashion_store_2024
        customer_email:
          type: string
          description: Email address of the customer.
          example: priya.sharma@example.com
        customer_id:
          type: string
          description: Unique identifier for the customer.
          example: cust_priya_sharma_2024
        order_status:
          type: string
          description: Current status of the order.
          example: ACTIVE
        order_currency:
          type: string
          description: Currency code for the order amount.
          example: INR
        payment_methods:
          type: string
          description: Available payment methods for the order.
          example: cc,dc,upi,nb,wallet
        order_note:
          type: string
          description: Additional notes or description for the order.
          example: Summer collection dress - Medium size, Blue color
        checkout_url:
          type: string
          format: uri
          description: URL for the customer to complete the payment.
          example: https://payments.flowwise.com/checkout/order_summer_fashion_001
        order_hash:
          type: string
          description: Hash value for the order used for payment processing.
          example: a7f8e3d2c1b9f4e6d8a2c5b7f9e3d1a8
        order_expiry_time:
          type: string
          format: date-time
          description: Date and time when the order expires.
          example: '2024-12-03T16:30:00Z'
        added_on:
          type: string
          format: date-time
          description: Date and time when the order was created.
          example: '2024-12-03T14:30:00Z'
    ErrorResponse:
      type: object
      description: Error response structure returned when an API request fails.
      properties:
        message:
          type: string
          description: Human-readable error message describing what went wrong.
        code:
          type: string
          description: Machine-readable error code for programmatic handling.
        type:
          type: string
          description: Category or type of error that occurred.
      required:
        - message
        - code
        - type
    CustomerDetails:
      type: object
      description: Customer information for the order.
      properties:
        customer_email:
          type: string
          format: email
          description: Email address of the customer.
          example: priya.sharma@example.com
        customer_phone:
          type: string
          description: Phone number of the customer.
          example: '+919876543210'
        customer_address:
          type: string
          description: Address of the customer.
          example: 123 Connaught Place, New Delhi, Delhi 110001, India
        customer_id:
          type: string
          description: Unique identifier for the customer.
          example: cust_priya_sharma_2024
    OrderTags:
      type: object
      description: Additional metadata tags for the order.
      additionalProperties:
        type: string
      example:
        source: mobile_app
        campaign: summer_sale_2024
        customer_segment: premium
  securitySchemes:
    ApiKeyAuth:
      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).
    ApiSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        Client secret key. You can find your secret key in the [Merchant
        Dashboard](https://merchant.cashfree.com/auth/login/pg/developers/api-keys?env=prod).

````