# Calculate FX Rate

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/receive/price:
    post:
      summary: Calculate FX Rate
      deprecated: false
      description: >-
        Calculate the amount required to deposit and the conversion rate in
        order to receive the payout amount.
      tags:
        - API Documentation/Transactions/Collections (Fiat-to-Fiat)
      parameters:
        - name: x-api-key
          in: header
          description: ''
          required: true
          example: CEDAR_DEV_api_key_b0ab5b29-caa7-4fa6-9f94-51dbc145e9ed
          schema:
            type: string
        - name: x-api-secret
          in: header
          description: ''
          required: true
          example: >-
            CEDAR_DEV_api_secret_YtGc1iMIdVaSlE3yeBxS3Y6RY3j933s3YdTloLZjY9ar7T5vuVTGPovoRplo7PSZbYg2RLV9yJ3ZT7BctcxxPSR5pQpEMndj3EJB
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fromCurrencySymbol:
                  type: string
                  x-apidog-mock: NGN
                  description: Currency symbol the client deposits
                toCurrencySymbol:
                  type: string
                  x-apidog-mock: USD
                  description: Currency symbol for payout
                toAmount:
                  type: string
                  x-apidog-mock: '100000.0'
                  description: The payout amount
              x-apidog-orders:
                - fromCurrencySymbol
                - toCurrencySymbol
                - toAmount
              required:
                - fromCurrencySymbol
                - toCurrencySymbol
                - toAmount
              x-apidog-ignore-properties: []
            example:
              fromCurrencySymbol: NGN
              toCurrencySymbol: USD
              toAmount: '100000.0'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  fromCurrencySymbol:
                    type: string
                    description: Currency symbol the client deposits
                  toCurrencySymbol:
                    type: string
                    description: Currency symbol for payout
                  rate:
                    type: number
                    description: >-
                      The service rate between the from/to amounts including
                      Cedar fees
                  amount:
                    type: string
                    description: >-
                      The amount required to deposit for payout of the "To
                      Amount" including Cedar fees (From Amount)
                required:
                  - fromCurrencySymbol
                  - toCurrencySymbol
                  - rate
                  - amount
                x-apidog-orders:
                  - fromCurrencySymbol
                  - toCurrencySymbol
                  - rate
                  - amount
                x-apidog-ignore-properties: []
              example:
                fromCurrencySymbol: NGN
                toCurrencySymbol: USD
                rate: 1603.1479
                amount: '160314798.7'
          headers: {}
          x-apidog-name: OK
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API%20Error'
              examples:
                '2':
                  summary: IP Not Whitelisted
                  value:
                    exception:
                      errorCode: API_IP_NOT_WHITELISTED
                      message: Access Denied - IP not whitelisted
                '3':
                  summary: Resource Not Found
                  value:
                    exception:
                      errorCode: RESOURCE_NOT_FOUND
                      message: Business with id [1] not found
          headers: {}
          x-apidog-name: Error
      security: []
      x-apidog-folder: API Documentation/Transactions/Collections (Fiat-to-Fiat)
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/669455/apis/api-14995529-run
components:
  schemas:
    API Error:
      type: object
      properties:
        exception:
          type: object
          properties:
            errorCode:
              type: string
              enum:
                - INTERNAL_SERVER_ERROR
                - RATE_LIMIT_EXCEEDED
                - URL_INVALID
                - MOCK
                - API_KEY_MISSING
                - API_KEY_INVALID
                - API_KEY_NO_ACCESS
                - API_SECRET_MISSING
                - API_SECRET_INVALID
                - API_IP_NOT_WHITELISTED
                - RESOURCE_NOT_FOUND
                - REQUIRED_FIELD_MISSING
                - BAD_REQUEST
                - BUSINESS_KYC_NOT_VALID
                - BUSINESS_NOT_ACTIVE
                - BUSINESS_CANNOT_UPDATE_VALID
                - BUSINESS_REQUEST_CANCEL_FAILED
                - BUSINESS_REQUEST_ACTION_UNAVAILABLE
                - BUSINESS_REQUEST_ACTION_FAILED
                - BUSINESS_REQUEST_INVALID_TO_AMOUNT
                - CREDENTIALS_NOT_FOUND
                - CURRENCY_NOT_FOUND
                - INVALID_CURRENCY
                - BUSINESS_EXTERNAL_ACCOUNT_CANNOT_UPDATE_NON_PENDING_ACCOUNT
                - BUSINESS_INVOICE_FAILED_TO_DOWNLOAD_INVOICE
              x-apidog-enum:
                - value: INTERNAL_SERVER_ERROR
                  name: Internal Server Error
                  description: 'Internal server error  '
                - value: RATE_LIMIT_EXCEEDED
                  name: Rate Limit Exceeded
                  description: 'Rate limit exceeded  '
                - value: URL_INVALID
                  name: URL Invalid
                  description: 'Invalid URL  '
                - value: MOCK
                  name: Sandbox Error
                  description: 'Error in sandbox service  '
                - value: API_KEY_MISSING
                  name: API Key Missing
                  description: 'API key missing  '
                - value: API_KEY_INVALID
                  name: API Key Invalid
                  description: 'API key invalid  '
                - value: API_KEY_NO_ACCESS
                  name: API Key No Access
                  description: 'Access Denied  '
                - value: API_SECRET_MISSING
                  name: API Secret Missing
                  description: 'API secret missing  '
                - value: API_SECRET_INVALID
                  name: API Secret Invalid
                  description: 'API secret invalid  '
                - value: API_IP_NOT_WHITELISTED
                  name: API IP Not Whitelisted
                  description: 'Access Denied - IP not whitelisted  '
                - value: RESOURCE_NOT_FOUND
                  name: Resource Not Found
                  description: 'Resource not found  '
                - value: REQUIRED_FIELD_MISSING
                  name: Required Field Missing
                  description: 'Required field missing  '
                - value: BAD_REQUEST
                  name: Bad Request
                  description: 'Request body is invalid  '
                - value: BUSINESS_KYC_NOT_VALID
                  name: Merchant KYC Not Valid
                  description: 'Merchant KYC not valid  '
                - value: BUSINESS_NOT_ACTIVE
                  name: Merchant Not Active
                  description: 'Merchant not active  '
                - value: BUSINESS_CANNOT_UPDATE_VALID
                  name: Merchant Cannot Update Valid
                  description: 'Cannot update merchant after KYC status is valid  '
                - value: BUSINESS_REQUEST_CANCEL_FAILED
                  name: Transaction Cancel Failed
                  description: 'Failed to cancel request  '
                - value: BUSINESS_REQUEST_ACTION_UNAVAILABLE
                  name: Transaction Action Unavailable
                  description: 'Action unavailable  '
                - value: BUSINESS_REQUEST_ACTION_FAILED
                  name: Transaction Action Failed
                  description: 'Failed to perform action  '
                - value: BUSINESS_REQUEST_INVALID_TO_AMOUNT
                  name: Transaction Invalid To Amount
                  description: 'Invalid to amount  '
                - value: CREDENTIALS_NOT_FOUND
                  name: Credentials Not Found
                  description: 'Failed to find credentials  '
                - value: CURRENCY_NOT_FOUND
                  name: Currency Not Found
                  description: 'Currency not found  '
                - value: INVALID_CURRENCY
                  name: Invalid Currency
                  description: 'Invalid currency  '
                - value: BUSINESS_EXTERNAL_ACCOUNT_CANNOT_UPDATE_NON_PENDING_ACCOUNT
                  name: Receiver Account Cannot Update Non Pending Account
                  description: 'Cannot update non-pending account  '
                - value: BUSINESS_INVOICE_FAILED_TO_DOWNLOAD_INVOICE
                  name: Invoice Failed To Download Invoice
                  description: 'Failed to download invoice from URL  '
              description: The API error code
            message:
              type: string
              description: Exception message with additional details
          required:
            - errorCode
            - message
          x-apidog-orders:
            - errorCode
            - message
          description: Exception details
          x-apidog-ignore-properties: []
      required:
        - exception
      x-apidog-orders:
        - exception
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://partners-api.service.cedar.money/mock/bpapi
    description: Sandbox Partners API
  - url: https://partners-api.service.cedar.money/bpapi
    description: Live Partners API
security: []

```
