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

# Obtener tasa de conversión

> Obtiene la tasa de conversión de divisas de una transacción determinada mediante un proveedor externo

Esta página te ayudará a comenzar con las conversiones de divisas.

Para obtener más información sobre cómo usar el servicio de conversión de divisas, consulta la [página de conversión de divisas](https://docs.y.uno/es/reference/conversion-rate/currency-conversion.md) en la sección de guías.

El valor `provider_data.id` debe ser un proveedor conectado a la cuenta y presente en el enrutamiento de PAYMENT de la cuenta. Si no lo es, la solicitud falla con `PROVIDER_NOT_CONFIG`.


## OpenAPI

````yaml openapi/es/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: Get Conversion Rate
      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: >-
                    El identificador único de la cuenta. Encuentras esta
                    información en el [Dashboard de
                    Yuno](https://dashboard.y.uno) (UUID; 36 caracteres).
                amount:
                  type: object
                  description: Monto que se convertirá
                  required:
                    - value
                    - currency
                  properties:
                    value:
                      type: number
                      description: Monto que se convertirá (debe ser mayor o igual a 0).
                    currency:
                      type: string
                      description: >-
                        La moneda utilizada para realizar el pago ([ISO
                        4217](https://en.wikipedia.org/wiki/ISO_4217); 3
                        caracteres).
                    currency_conversion:
                      type: object
                      description: Información para realizar la conversión
                      required:
                        - cardholder_currency
                      properties:
                        cardholder_currency:
                          type: string
                          description: >-
                            La moneda a la que se hará la conversión ([ISO
                            4217](https://en.wikipedia.org/wiki/ISO_4217); 3
                            caracteres).
                provider_data:
                  type: object
                  description: Información del proveedor
                  required:
                    - id
                  properties:
                    id:
                      type: string
                      description: >-
                        Identificación del proveedor. El proveedor debe estar
                        conectado a la cuenta y aparecer en el enrutamiento
                        PAYMENT de la cuenta. De lo contrario, la API devuelve
                        `PROVIDER_NOT_CONFIG`.
                      enum:
                        - CIBC
                        - MERCADO_PAGO
                payment_method:
                  type: object
                  description: >-
                    Información del método de pago. Obligatoria. Proporciona uno
                    de `card`, `token` o `vaulted_token`.
                  properties:
                    token:
                      type: string
                      description: Token del método de pago (UUID; 36 caracteres).
                    vaulted_token:
                      type: string
                      description: >-
                        Token del método de pago guardado en el vault (UUID; 36
                        caracteres).
                    card:
                      type: object
                      description: >-
                        Información de la tarjeta necesaria para la conversión
                        de moneda. Solo para comercios que cumplen con PCI.
                      properties:
                        card_data:
                          type: object
                          description: Información de los datos de la tarjeta
                          required:
                            - number
                            - holder_name
                            - expiration_month
                            - expiration_year
                          properties:
                            number:
                              type: string
                              description: >-
                                Número de tarjeta sin separadores. Disponible
                                para comercios con certificación PCI (MIN 8).
                            expiration_month:
                              type: integer
                              description: >-
                                Mes de vencimiento de la tarjeta (01-12).
                                Disponible para comercios con certificación PCI
                                (2 caracteres).
                              format: int32
                            expiration_year:
                              type: integer
                              description: >-
                                Año de vencimiento de la tarjeta con 4 dígitos,
                                por ejemplo `2030`. El año no puede estar en el
                                pasado. Disponible para comercios con
                                certificación PCI (4 caracteres).
                              format: int32
                            holder_name:
                              type: string
                              description: >-
                                Nombre completo del titular de la tarjeta.
                                Disponible para comercios con certificación 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.