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

# Create a currency quote

> 
 Creates a quote for a given currency pair.

 You can create a quote for either an internal currency exchange or an outbound payment.
 To create a quote for an internal currency exchange, set ```type.to``` to ```balance```.
 For an outbound payment, use any of ```payment```, ```multiple```, or ```forward```.

 Once you've created a quote, you can [create an order](https://docs.equalsmoney.com/openapi/em-budgets/operation/tradeOrders).

 All quotes expire after 12 seconds.
    



## OpenAPI

````yaml /autogenerated/openapi/budgets.openapi.json post /orders/quote
openapi: 3.1.0
info:
  title: Budgets API
  version: 2.0.0
  description: Version 2
  license:
    name: UNLICENSED
    url: https://docs.equalsmoney.com
servers:
  - url: https://api.equalsmoney.com/v2
    description: Production
  - url: https://api-sandbox.equalsmoney.com/v2
    description: Sandbox
security: []
paths:
  /orders/quote:
    post:
      tags:
        - Payments
      summary: Create a currency quote
      description: |2-

         Creates a quote for a given currency pair.

         You can create a quote for either an internal currency exchange or an outbound payment.
         To create a quote for an internal currency exchange, set ```type.to``` to ```balance```.
         For an outbound payment, use any of ```payment```, ```multiple```, or ```forward```.

         Once you've created a quote, you can [create an order](https://docs.equalsmoney.com/openapi/em-budgets/operation/tradeOrders).

         All quotes expire after 12 seconds.
            
      operationId: quoteOrders
      parameters:
        - name: accountId
          in: query
          schema:
            description: The ID of the account to work with.
            type:
              - string
            example: F50091
          required: true
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type:
                - object
              properties:
                sourceCurrency:
                  type:
                    - object
                  properties:
                    amount:
                      type:
                        - number
                      description: >-
                        This is required if ```targetCurrency.amount``` is not
                        provided.
                    currency:
                      type:
                        - object
                      properties:
                        budgetId:
                          type:
                            - string
                          format: uuid
                          maxLength: 36
                          description: The ID of the budget to work with.
                          example: 775596ae-2624-40af-a9dc-9756110a4a03
                        currencyCode:
                          description: The currency code, in ISO-4217 format.
                          type:
                            - string
                          pattern: ^[A-Z]{3}$
                          example: USD
                      required:
                        - budgetId
                        - currencyCode
                      description: Details about the currency.
                  required:
                    - currency
                  description: Details about the source currency.
                targetCurrency:
                  type:
                    - object
                  properties:
                    amount:
                      type:
                        - number
                      description: >-
                        This is required if ```sourceCurrency.amount``` is not
                        provided.
                    currency:
                      type:
                        - object
                      properties:
                        budgetId:
                          type:
                            - string
                          format: uuid
                          maxLength: 36
                          description: The ID of the budget to work with.
                          example: 775596ae-2624-40af-a9dc-9756110a4a03
                        currencyCode:
                          description: The currency code, in ISO-4217 format.
                          type:
                            - string
                          pattern: ^[A-Z]{3}$
                          example: USD
                      required:
                        - budgetId
                        - currencyCode
                      description: Details about the currency.
                  required:
                    - currency
                  description: Details about the target currency.
                settlementDate:
                  type:
                    - string
                  pattern: ^20[0-9]{2}[0-2][0-9][0-3][0-9]$
                  description: ' The settlement date.'
                  example: '20221027'
                type:
                  type:
                    - object
                  properties:
                    from:
                      type:
                        - string
                      enum:
                        - bank
                        - balance
                    to:
                      type:
                        - string
                      enum:
                        - payment
                        - balance
                        - multiple
                        - unknown
                        - forward
                    recipientId:
                      type:
                        - string
                      description: >-
                        The ID of the recipient. Including recipientId will
                        generate an accurate fee on the quote. This is only
                        necessary when the type.to is 'payment'.
                      example: 8lciyups6
                  required:
                    - from
                    - to
                  description: Details about the type of quote that you're creating.
                marginCurrency:
                  type:
                    - string
                  pattern: ^[A-Z]{3}$
                  description: >-
                    The ISO-4217 currency in which margin (collateral) is held
                    for the contract. Required when creating a forward contract.
                  example: USD
              required:
                - sourceCurrency
                - targetCurrency
                - settlementDate
                - type
              example:
                sourceCurrency:
                  amount: 0
                  currency:
                    budgetId: 775596ae-2624-40af-a9dc-9756110a4a03
                    currencyCode: USD
                targetCurrency:
                  amount: 0
                  currency:
                    budgetId: 775596ae-2624-40af-a9dc-9756110a4a03
                    currencyCode: USD
                settlementDate: '20221027'
                type:
                  from: bank
                  to: payment
                  recipientId: 8lciyups6
                marginCurrency: USD
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  orderId:
                    type:
                      - string
                    description: ' The ID of the order.'
                    example: EABCDE6FGHI0
                  quoteRequestId:
                    type:
                      - string
                    description: ' The ID of the quote request.'
                    example: USD-USD-5-5
                  settlement:
                    type:
                      - object
                    properties:
                      date:
                        type:
                          - string
                        pattern: ^20[0-9]{2}[0-2][0-9][0-3][0-9]$
                        description: ' The settlement date.'
                        example: '20221027'
                      price:
                        type:
                          - object
                        properties:
                          amount:
                            type:
                              - number
                            example: 5
                          currency:
                            type:
                              - string
                            example: USD
                        description: Details about the price.
                      charges:
                        type:
                          - object
                        properties:
                          fee:
                            type:
                              - number
                            description: The fee.
                            example: 0
                          margin:
                            type:
                              - number
                            description: The margin.
                            example: 0
                          other:
                            type:
                              - number
                            description: The additional charges.
                            example: 0
                        description: Details about the charges.
                    description: Details about the settlement.
                  quote:
                    type:
                      - object
                    properties:
                      rate:
                        type:
                          - number
                        description: The rate.
                        example: 1
                      inverseRate:
                        type:
                          - number
                        description: The inverse rate.
                        example: 1
                      fromGbpAmount:
                        type:
                          - number
                        description: The amount in ```GBP```.
                        example: 3
                      from:
                        type:
                          - object
                        properties:
                          amount:
                            type:
                              - number
                            example: 5
                          currency:
                            description: The currency code, in ISO-4217 format.
                            type:
                              - string
                            pattern: ^[A-Z]{3}$
                            example: USD
                        description: Details about the source currency.
                      to:
                        type:
                          - object
                        properties:
                          amount:
                            type:
                              - number
                            example: 5
                          currency:
                            description: The currency code, in ISO-4217 format.
                            type:
                              - string
                            pattern: ^[A-Z]{3}$
                            example: USD
                        description: Details about the target currency.
                      direction:
                        type:
                          - string
                        description: The direction.
                        example: 1
                    description: Details about the quote.
                example:
                  orderId: EABCDE6FGHI0
                  quoteRequestId: USD-USD-5-5
                  settlement:
                    date: '20221027'
                    price:
                      amount: 5
                      currency: USD
                    charges:
                      fee: 0
                      margin: 0
                      other: 0
                  quote:
                    rate: 1
                    inverseRate: 1
                    fromGbpAmount: 3
                    from:
                      amount: 5
                      currency: USD
                    to:
                      amount: 5
                      currency: USD
                    direction: 1
      security:
        - CommonAuth:
            - orders:create:any
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl --request POST \
              --url 'https://api.equalsmoney.com/v2/orders/quote?accountId={{accountId}}' \
              --header 'Authorization: <api-key>' \
              --header 'Content-Type: application/json' \
              --data '
            {
              "sourceCurrency": {
                "amount": 0,
                "currency": {
                  "budgetId": "775596ae-2624-40af-a9dc-9756110a4a03",
                  "currencyCode": "USD"
                }
              },
              "targetCurrency": {
                "amount": 0,
                "currency": {
                  "budgetId": "775596ae-2624-40af-a9dc-9756110a4a03",
                  "currencyCode": "USD"
                }
              },
              "settlementDate": "20221027",
              "type": {
                "from": "bank",
                "to": "payment",
                "recipientId": "8lciyups6"
              },
              "marginCurrency": "USD"
            }
            '
components:
  securitySchemes:
    CommonAuth:
      type: apiKey
      in: header
      name: Authorization

````