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

# Create Order

> Create a new order for crypto to fiat exchange.  
  
When creating the order, you can specify either the exact origin Asset / originAmount, or the exact destinationAsset / destinationAmount but not both.

Once an order is created, you then confirm you accept the order quote by calling the prepare order funding endpoint with that orderId.



## OpenAPI

````yaml POST /v1/orders
openapi: 3.0.3
info:
  title: Chessa Accounts API
  description: API collection for Chessa Accounts services
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.chessa.ai
security: []
tags:
  - name: User Endpoints
    description: Endpoints related to user management
  - name: Configuration Endpoints
    description: Endpoints for fetching application configurations
  - name: Recipient Endpoints
    description: Endpoints for managing recipients
  - name: Order Endpoints
    description: Endpoints for managing orders
  - name: Rate Endpoints
    description: Endpoints for exchange rates and fees
  - name: Referral Endpoints
    description: Endpoints for managing referrals
paths:
  /v1/orders:
    post:
      tags:
        - Order Endpoints
      summary: Create Order
      description: >-
        Create a new order for crypto to fiat exchange.  
          
        When creating the order, you can specify either the exact origin Asset /
        originAmount, or the exact destinationAsset / destinationAmount but not
        both.


        Once an order is created, you then confirm you accept the order quote by
        calling the prepare order funding endpoint with that orderId.
      operationId: createOrder
      parameters:
        - name: x-client-id
          in: header
          schema:
            type: string
            example: ''
        - name: x-client-secret
          in: header
          schema:
            type: string
            example: ''
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                chain:
                  type: string
                  example: Solana
                destinationAsset:
                  type: string
                  example: NGN
                originAmount:
                  type: number
                  example: 10
                originAsset:
                  type: string
                  example: USDC
                recipientId:
                  type: string
                  example: cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3
            example:
              chain: Solana
              destinationAsset: NGN
              originAmount: 10
              originAsset: USDC
              recipientId: cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3
      responses:
        '201':
          description: Success Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  order:
                    type: object
                    properties:
                      createdAt:
                        type: string
                        example: '2025-03-18T06:05:27.754Z'
                      cryptoAddress:
                        nullable: true
                        example: null
                      cryptoAddressChain:
                        type: string
                        example: Solana
                      cryptoAddressId:
                        nullable: true
                        example: null
                      cryptoAddressTag:
                        nullable: true
                        example: null
                      cryptoDepositId:
                        nullable: true
                        example: null
                      destinationAmount:
                        type: string
                        example: '1500'
                      destinationAsset:
                        type: string
                        example: NGN
                      destinationCountry:
                        type: string
                        example: NG
                      expiresAt:
                        type: string
                        example: '2025-03-18T08:05:27.751Z'
                      feeAmount:
                        type: string
                        example: '0.00000000'
                      feeCurrency:
                        type: string
                        example: USDC
                      feeUsd:
                        type: string
                        example: '0.00000000'
                      id:
                        type: string
                        example: b647214f-3c33-4027-986b-3a46f041e800
                      note:
                        nullable: true
                        example: null
                      originAmount:
                        type: string
                        example: '0.95'
                      originAsset:
                        type: string
                        example: USDC
                      partnerId:
                        type: string
                        example: 4646e61e-33cf-452b-8bba-c138b78a57f0
                      recipientId:
                        type: string
                        example: f12b990c-d4dc-4dc7-8b42-cbaa90308820
                      refundAddress:
                        nullable: true
                        example: null
                      senderConfirmedAt:
                        nullable: true
                        example: null
                      shortId:
                        type: string
                        example: N3LBXEUI
                      status:
                        type: string
                        example: created
                      updatedAt:
                        type: string
                        example: '2025-03-18T06:05:27.754Z'
                      userId:
                        type: string
                        example: 02e31a45-9474-4858-a833-06e89e494003
              examples:
                Success Response:
                  value:
                    order:
                      createdAt: '2025-03-18T06:05:27.754Z'
                      cryptoAddress: null
                      cryptoAddressChain: Solana
                      cryptoAddressId: null
                      cryptoAddressTag: null
                      cryptoDepositId: null
                      destinationAmount: '1500'
                      destinationAsset: NGN
                      destinationCountry: NG
                      expiresAt: '2025-03-18T08:05:27.751Z'
                      feeAmount: '0.00000000'
                      feeCurrency: USDC
                      feeUsd: '0.00000000'
                      id: b647214f-3c33-4027-986b-3a46f041e800
                      note: null
                      originAmount: '0.95'
                      originAsset: USDC
                      partnerId: 4646e61e-33cf-452b-8bba-c138b78a57f0
                      recipientId: f12b990c-d4dc-4dc7-8b42-cbaa90308820
                      refundAddress: null
                      senderConfirmedAt: null
                      shortId: N3LBXEUI
                      status: created
                      updatedAt: '2025-03-18T06:05:27.754Z'
                      userId: 02e31a45-9474-4858-a833-06e89e494003
        '400':
          description: Error Response - Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: validation_error
                  message:
                    type: string
                    example: Invalid crypto asset
                  statusCode:
                    type: number
                    example: 400
              examples:
                Error Response - Validation Error:
                  value:
                    error: validation_error
                    message: Invalid crypto asset
                    statusCode: 400
        '404':
          description: Error Response - Recipient Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: not_found
                  message:
                    type: string
                    example: Recipient not found
                  statusCode:
                    type: number
                    example: 404
              examples:
                Error Response - Recipient Not Found:
                  value:
                    error: not_found
                    message: Recipient not found
                    statusCode: 404

````