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

# Create Quote

### Requirements to consume the endpoint.

<CardGroup cols={2}>
  <Card title="Create and modify role" icon="user-lock">
    The user must have the role to create and modify.
  </Card>

  <Card title="User approved" icon="check">
    The user must be approved in at least one country.
  </Card>
</CardGroup>


## OpenAPI

````yaml post /api/quotes
openapi: 3.0.0
info:
  version: v1.0.0
  title: Quotes API
  description: API for managing quotes in the Rio platform
servers:
  - url: https://app.sandbox.rio.trade
security:
  - apiKeyAuth: []
paths:
  /api/quotes:
    post:
      summary: Create Quote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createQuoteSchema'
            examples:
              createQuoteExample:
                $ref: '#/components/examples/createQuoteExample'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseCreatedQuoteSchema'
          description: Created
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorizedSchema'
          description: Unauthorized
components:
  schemas:
    createQuoteSchema:
      type: object
      properties:
        crypto:
          description: Crypto currency.
          type: string
          enum:
            - USDC
            - USDC_POLYGON_NXTB
            - SOL_USDC_PTHX
            - XLM_USDC_5F3T
            - USDT_POLYGON
            - USDT_ERC20
            - TRX_USDT_S2UZ
            - USDT_BSC
        fiat:
          description: Fiat currency.
          type: string
          enum:
            - USD
            - MXN
            - PEN
            - COP
        side:
          description: Side of the quote.
          type: string
          enum:
            - buy
            - sell
        country:
          description: Country where you want to make the quotation.
          type: string
          enum:
            - MX
            - PE
            - CO
            - US
        userId:
          type: string
          description: Id of the user to which this quote will be associated.
          example: 66290ac8bd3903485989f82e
        amountFiat:
          type: number
          description: >-
            This attribute is used to specify the amount of fiat currency you
            want to convert to cryptocurrency. You should provide it when you
            know the exact amount of fiat currency you want to spend.
          example: 1000
        orderId:
          type: string
          description: This attribute is used to relate the quote to an existing order.
          example: 63290ac8bd3903485989062f
        amountCrypto:
          type: number
          description: >-
            This attribute is used to specify the amount of cryptocurrency you
            want to buy. You should provide it when you know the exact amount of
            cryptocurrency you want to buy.
          example: 1000
        USBankTransferMethod:
          description: >-
            Required for orders in the US. For a buy order, this specifies the
            transfer method used to pay for the order. For a sell order, this
            specifies the transfer method used to receive the payment.
          enum:
            - ach_push
            - wire
        twoWaySettlementType:
          type: string
          description: >-
            The type of settlement for the order. `default` means that the order
            is settles regularly (usually this means upon receipt of the
            payment), while `TPlusOffset` means that the order is settled after
            a certain number of business days.
          enum:
            - default
            - TPlusOffset
        twoWaySettlementDateOffset:
          type: number
          description: >-
            The number of business days until the order is settled. This is only
            applicable for if the `twoWaySettlementType` is `TPlusOffset`.
          example: 1
        orderType:
          type: string
          description: >-
            The type of order. `market` means that the order is executed at the
            current market price, while `limit` means that the order is executed
            at a specified limit net price.
          enum:
            - market
            - limit
        limitNetPrice:
          type: number
          description: >-
            The net price of the order. This is only applicable for if the
            `orderType` is `limit`.
          example: 18.75
        timeInForceStartsAt:
          type: string
          description: >-
            The date and time from which the order is scheduled to be executed
            (optional).
          example: '2024-06-04T15:02:13.097Z'
        timeInForceEndsAt:
          type: string
          description: >-
            The date and time until which the order is scheduled to be executed
            (optional).
          example: '2024-06-04T15:02:13.097Z'
      required:
        - crypto
        - fiat
        - side
        - country
    responseCreatedQuoteSchema:
      type: object
      properties:
        userId:
          type: string
          description: Id of the user who created the quote.
          example: 66290ac8bd3903485989f82e
        crypto:
          description: Crypto currency.
          type: string
          enum:
            - USDC
            - USDC_POLYGON_NXTB
            - SOL_USDC_PTHX
            - XLM_USDC_5F3T
            - USDT_POLYGON
            - USDT_ERC20
            - TRX_USDT_S2UZ
            - USDT_BSC
        side:
          description: Side of the quote.
          type: string
          enum:
            - buy
            - sell
        fiat:
          description: Fiat currency.
          type: string
          enum:
            - USD
            - MXN
            - PEN
            - COP
        paymentMethod:
          description: Payment method.
          type: string
          enum:
            - bankTransfer
        expiresAt:
          type: string
          description: Expiration date and time of the quote.
          example: '2024-06-04T14:59:17.286Z'
        country:
          description: Country of the quote.
          type: string
          enum:
            - MX
            - PE
            - CO
            - US
        amountFiat:
          type: number
          description: Amount in fiat currency.
          example: 1000
        amountCrypto:
          type: number
          description: Amount in crypto currency.
          example: 54.76
        fees:
          type: object
          properties:
            processingFeeFiat:
              type: number
              description: Processing fee in fiat currency.
              example: 0
            transferFeeFiat:
              type: number
              description: Transfer fee in fiat currency.
              example: 0.17836118224825653
            platformFeeFiat:
              type: number
              description: Platform fee in fiat currency.
              example: 20
        marketPrice:
          type: number
          description: Price of the cryptocurrency in fiat currency.
          example: 0.0560660109669
        createdAt:
          type: string
          description: Creation date and time of the quote.
          example: '2024-06-04T14:54:17.286Z'
        quoteInCrypto:
          type: boolean
          description: Whether the quote is in crypto currency.
          example: false
        reissueAfterExpiration:
          type: boolean
          description: Whether to reissue the quote after expiration.
          example: true
        netPrice:
          type: number
          description: The final price of the order, including taxes and fees
          example: 0.97671
        id:
          type: string
          description: Id of the quote.
          example: 665f2a99d6c964829d639812
        twoWaySettlementType:
          type: string
          description: >-
            The type of settlement for the order. `default` means that the order
            is settles regularly (usually this means upon receipt of the
            payment), while `TPlusOffset` means that the order is settled after
            a certain number of business days.
          enum:
            - default
            - TPlusOffset
        twoWaySettlementDateOffset:
          type: number
          description: >-
            The number of business days until the order is settled. This is only
            applicable for if the `twoWaySettlementType` is `TPlusOffset`.
          example: 1
        twoWaySettlementDate:
          type: string
          description: The date on which the order is settled.
          example: '2024-06-04T15:02:13.097Z'
        effectiveTwoWaySettlementDateOffset:
          type: number
          description: >-
            The number of billable days until the order is settled. This is only
            applicable for if the `twoWaySettlementType` is `TPlusOffset`.
          example: 1
        paymentDueDate:
          type: string
          description: The date on which the payment is due.
          example: '2024-06-04T15:02:13.097Z'
        orderType:
          type: string
          description: >-
            The type of order. `market` means that the order is executed at the
            current market price, while `limit` means that the order is executed
            at a specified limit net price.
          enum:
            - market
            - limit
        limitNetPrice:
          type: number
          description: >-
            The net price of the order. This is only applicable for if the
            `orderType` is `limit`.
          example: 18.75
        timeInForceStartsAt:
          type: string
          description: >-
            The date and time from which the order is scheduled to be executed
            (optional).
          example: '2024-06-04T15:02:13.097Z'
        timeInForceEndsAt:
          type: string
          description: >-
            The date and time until which the order is scheduled to be executed
            (optional).
          example: '2024-06-04T15:02:13.097Z'
    unauthorizedSchema:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: number
                example: 19
              message:
                type: string
                example: Not authorized
  examples:
    createQuoteExample:
      value:
        userId: 66290ac8bd3903485989f82e
        crypto: TRX_USDT_S2UZ
        fiat: MXN
        side: buy
        amountFiat: 1000
        country: MX
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````