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

# Calculate Exchange Rates

> Calculate exchange rates and applicable fees for a transaction.

Pass either `source_amount` or `destination_amount`. Use `beneficiary_id` instead of
`destination_currency` to get developer-fee-aware calculations.


## OpenAPI

````yaml POST /v1/fee-calculation
openapi: 3.1.0
info:
  title: Fin.com API
  version: 1.0.0
  description: A simple API specification
servers:
  - url: https://sandbox.api.fin.com
    description: Sandbox server
  - url: https://api.fin.com
    description: Production server
security: []
tags:
  - name: Authentication
    description: A modified OAuth 2.0 Client Credential Flow
  - name: Customers
    description: Customer management and document upload operations
  - name: Balances
    description: Retrieve wallet balance information
  - name: Catalogue
    description: |
      A set of endpoints to retrieve contextual data to assemble requests
      to fin.com's API
  - name: Beneficiaries
    description: Manage beneficiary accounts for payments and transfers
  - name: Transactions
    description: Transaction history and management for beneficiaries
  - name: Virtual Accounts
    description: Create and manage virtual accounts for USD to USDC conversions
  - name: Fees & FX Rates
    description: Retrieve fees and foreign exchange rates
paths:
  /v1/fee-calculation:
    post:
      tags:
        - Fees & FX Rates
      summary: Calculate Exchange Rates
      description: Calculate exchange rates and applicable fees for a transaction.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                source_currency:
                  type: string
                  pattern: ^[A-Z]{3}$
                  example: USD
                source_amount:
                  type: number
                  example: 3508679
                destination_amount:
                  type: number
                  example: 59456
                destination_currency:
                  type: string
                  pattern: ^[A-Z]{3}$
                  example: CAD
                beneficiary_id:
                  type: string
                  format: uuid
                  example: ceb7e6c9-ef2a-41c2-8459-38d67ec3c655
            examples:
              With source amount:
                value:
                  source_currency: USD
                  source_amount: 3508679
                  destination_currency: CAD
                  beneficiary_id: ceb7e6c9-ef2a-41c2-8459-38d67ec3c655
              With destination amount:
                value:
                  source_currency: USD
                  destination_amount: 59456
                  destination_currency: CAD
                  beneficiary_id: ceb7e6c9-ef2a-41c2-8459-38d67ec3c655
      responses:
        '200':
          description: Fee calculation completed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      source_currency:
                        type: string
                        example: USD
                      destination_currency:
                        type: string
                        example: CAD
                      source_amount:
                        type: number
                        example: 3508679
                      exchange_rate:
                        type: number
                        format: float
                        example: 1.45
                      destination_amount:
                        type: number
                        example: 508679
                      valid_till:
                        type: string
                        format: date-time
                        example: '2026-01-19T09:59:29Z'
                      fee:
                        type: object
                        properties:
                          fixed:
                            type: number
                            example: 25
                          percentage:
                            type: number
                            example: 4
                          total:
                            type: number
                            example: 29
                          is_fee_applied:
                            type: boolean
                            example: true
        '401':
          $ref: '#/components/responses/AuthenticationError'
      security:
        - bearerAuth: []
components:
  responses:
    AuthenticationError:
      description: Authentication failed due to invalid credentials
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Authentication failed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token authentication. Obtain token from [Issue a
        Token](https://developer.fin.com/api-reference/authentication/issue-a-token)
        endpoint

````