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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Consultar taxa de conversão

> Obtém a taxa de conversão de moeda de uma transação usando um provedor externo

Esta página ajuda você a começar a usar as conversões de moeda.

Para mais informações sobre como usar o serviço de conversão de moeda, consulte a [página de Conversão de moeda](https://docs.y.uno/pt-br/reference/conversion-rate/currency-conversion.md)  na seção de guias.

O valor de `provider_data.id` deve ser um provedor conectado à conta e presente no roteamento de PAYMENT da conta. Caso contrário, a requisição falha com `PROVIDER_NOT_CONFIG`.


## OpenAPI

````yaml openapi/pt-br/conversion-rate/get-conversion-rate.json POST /currency-conversion
openapi: 3.1.0
info:
  title: currency-conversions
  version: 1.0.2
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /currency-conversion:
    post:
      summary: Consultar taxa de conversão
      operationId: get-conversion-rate
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - account_id
                - amount
                - provider_data
                - payment_method
              properties:
                account_id:
                  type: string
                  description: >-
                    O identificador único da conta. Você encontra essa
                    informação no [Dashboard da Yuno](https://dashboard.y.uno)
                    (UUID; 36 caracteres).
                amount:
                  type: object
                  description: Valor a ser convertido
                  required:
                    - value
                    - currency
                  properties:
                    value:
                      type: number
                      description: Valor a converter (deve ser igual ou maior que 0).
                    currency:
                      type: string
                      description: >-
                        A moeda usada para fazer o pagamento ([ISO
                        4217](https://en.wikipedia.org/wiki/ISO_4217); 3
                        caracteres).
                    currency_conversion:
                      type: object
                      description: Informações para fazer a conversão
                      required:
                        - cardholder_currency
                      properties:
                        cardholder_currency:
                          type: string
                          description: >-
                            A moeda para a qual fazer a conversão ([ISO
                            4217](https://en.wikipedia.org/wiki/ISO_4217); 3
                            caracteres).
                provider_data:
                  type: object
                  description: Informações do provedor
                  required:
                    - id
                  properties:
                    id:
                      type: string
                      description: >-
                        Identificação do provedor. O provedor deve estar
                        conectado à conta e aparecer no roteamento de PAYMENT da
                        conta. Caso contrário, a API retorna
                        `PROVIDER_NOT_CONFIG`.
                      enum:
                        - CIBC
                        - MERCADO_PAGO
                payment_method:
                  type: object
                  description: >-
                    Informações do meio de pagamento. Obrigatório. Informe um
                    entre `card`, `token` ou `vaulted_token`.
                  properties:
                    token:
                      type: string
                      description: Token do meio de pagamento (UUID; 36 caracteres).
                    vaulted_token:
                      type: string
                      description: >-
                        Token do meio de pagamento armazenado no vault (UUID; 36
                        caracteres).
                    card:
                      type: object
                      description: >-
                        Informações do cartão necessárias para a conversão de
                        moeda. Somente para lojistas em conformidade com PCI.
                      properties:
                        card_data:
                          type: object
                          description: Informações dos dados do cartão
                          required:
                            - number
                            - holder_name
                            - expiration_month
                            - expiration_year
                          properties:
                            number:
                              type: string
                              description: >-
                                Número do cartão sem separadores. Disponível
                                para lojistas com certificação PCI (MIN 8).
                            expiration_month:
                              type: integer
                              description: >-
                                Mês de vencimento do cartão (01-12). Disponível
                                para lojistas com certificação PCI (2
                                caracteres).
                              format: int32
                            expiration_year:
                              type: integer
                              description: >-
                                Ano de vencimento do cartão com 4 dígitos, por
                                exemplo `2030`. O ano não pode estar no passado.
                                Disponível para lojistas com certificação PCI (4
                                caracteres).
                              format: int32
                            holder_name:
                              type: string
                              description: >-
                                Nome completo do titular do cartão. Disponível
                                para lojistas com certificação PCI (MIN 3; MAX
                                255).
            examples:
              Example:
                value:
                  account_id: fe14c7c6-c75e-43b7-bdbe-4c87ad52c482
                  amount:
                    value: 10000
                    currency: COP
                    currency_conversion:
                      cardholder_currency: USD
                  provider_data:
                    id: CIBC
                  payment_method:
                    card:
                      card_data:
                        number: '4111111111111111'
                        holder_name: JOHN DOE
                        expiration_month: 12
                        expiration_year: 2030
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    id: 599cc714-9bb6-4a3c-8465-c360cd47e04e
                    amount:
                      value: 10000
                      currency: COP
                      currency_conversion:
                        cardholder_currency: USD
                        cardholder_amount: 2.58
                        rate: 3879.812207
                        provider_data:
                          id: CIBC
                          transaction_id: >-
                            274c4fc9a1e3c27625fc4d925e0331783c3c5c94358280158d3980e97ac66795a80970d48c176078f394106345c05215431bbc6260a6980db3a2e0b753db1a3f32d0c8adfc02c18794dc07ac1c13a14e581a3d78ba4b9c5afdae537f38cc495628239b7470a997cc8d5b51ae787603b64de3b19cea09f825f6fd13896656b75092bd7fe19a0560df29b94
                          response_code: '2000'
                          response_message: Successful
                          raw_response:
                            fxRateInquiryResponse:
                              localDate: 210
                              localTime: 180927
                              merchantID: '18695684'
                              rateEndTime: 1739212767659
                              ratePreferenceCode: R1
                              rateStartTime: 1739210967659
                              rateValidityPeriod: 30
                              rates:
                                - cardholderAmount: 2.58
                                  cardholderCurrency: '840'
                                  merchantAmount: 10000
                                  merchantCurrency: '170'
                                  rate: 3879.812207
                                  rateInquiryRef: >-
                                    274c4fc9a1e3c27625fc4d925e0331783c3c5c94358280158d3980e97ac66795a80970d48c176078f394106345c05215431bbc6260a6980db3a2e0b753db1a3f32d0c8adfc02c18794dc07ac1c13a14e581a3d78ba4b9c5afdae537f38cc495628239b7470a997cc8d5b51ae787603b64de3b19cea09f825f6fd13896656b75092bd7fe19a0560df29b94
                              responseCode: '2000'
                              responseMessage: Successful
                              sessionId: 2a587fa2-e7da-11ef-8b88-7e36493c761f
                              terminalID: CT000001
                              traceNumber: 3594
                    expired_at: '2025-02-10T18:39:27Z'
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: 599cc714-9bb6-4a3c-8465-c360cd47e04e
                  amount:
                    type: object
                    properties:
                      value:
                        type: integer
                        example: 10000
                        default: 0
                      currency:
                        type: string
                        example: COP
                      currency_conversion:
                        type: object
                        properties:
                          cardholder_currency:
                            type: string
                            example: USD
                          cardholder_amount:
                            type: number
                            example: 2.58
                            default: 0
                          rate:
                            type: number
                            example: 3879.812207
                            default: 0
                          provider_data:
                            type: object
                            properties:
                              id:
                                type: string
                                example: CIBC
                              transaction_id:
                                type: string
                                example: >-
                                  274c4fc9a1e3c27625fc4d925e0331783c3c5c94358280158d3980e97ac66795a80970d48c176078f394106345c05215431bbc6260a6980db3a2e0b753db1a3f32d0c8adfc02c18794dc07ac1c13a14e581a3d78ba4b9c5afdae537f38cc495628239b7470a997cc8d5b51ae787603b64de3b19cea09f825f6fd13896656b75092bd7fe19a0560df29b94
                              response_code:
                                type: string
                                example: '2000'
                              response_message:
                                type: string
                                example: Successful
                              raw_response:
                                type: object
                                properties:
                                  fxRateInquiryResponse:
                                    type: object
                                    properties:
                                      localDate:
                                        type: integer
                                        example: 210
                                        default: 0
                                      localTime:
                                        type: integer
                                        example: 180927
                                        default: 0
                                      merchantID:
                                        type: string
                                        example: '18695684'
                                      rateEndTime:
                                        type: integer
                                        example: 1739212767659
                                        default: 0
                                      ratePreferenceCode:
                                        type: string
                                        example: R1
                                      rateStartTime:
                                        type: integer
                                        example: 1739210967659
                                        default: 0
                                      rateValidityPeriod:
                                        type: integer
                                        example: 30
                                        default: 0
                                      rates:
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            cardholderAmount:
                                              type: number
                                              example: 2.58
                                              default: 0
                                            cardholderCurrency:
                                              type: string
                                              example: '840'
                                            merchantAmount:
                                              type: integer
                                              example: 10000
                                              default: 0
                                            merchantCurrency:
                                              type: string
                                              example: '170'
                                            rate:
                                              type: number
                                              example: 3879.812207
                                              default: 0
                                            rateInquiryRef:
                                              type: string
                                              example: >-
                                                274c4fc9a1e3c27625fc4d925e0331783c3c5c94358280158d3980e97ac66795a80970d48c176078f394106345c05215431bbc6260a6980db3a2e0b753db1a3f32d0c8adfc02c18794dc07ac1c13a14e581a3d78ba4b9c5afdae537f38cc495628239b7470a997cc8d5b51ae787603b64de3b19cea09f825f6fd13896656b75092bd7fe19a0560df29b94
                                      responseCode:
                                        type: string
                                        example: '2000'
                                      responseMessage:
                                        type: string
                                        example: Successful
                                      sessionId:
                                        type: string
                                        example: 2a587fa2-e7da-11ef-8b88-7e36493c761f
                                      terminalID:
                                        type: string
                                        example: CT000001
                                      traceNumber:
                                        type: integer
                                        example: 3594
                                        default: 0
                  expired_at:
                    type: string
                    example: '2025-02-10T18:39:27Z'
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: X-Public-Api-Key
      x-default: <Your public-api-key>
    sec1:
      type: apiKey
      in: header
      name: X-Private-Secret-Key
      x-default: <Your private-secret-key>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.