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

# Create an FX quote

> Locks an exchange rate for a payment to a destination in a currency the source account doesn't hold.

Fix exactly one side:

- `amountToMinorUnits`: "the recipient gets exactly this". This is what most payment flows want.
- `amountFromMinorUnits`: "spend exactly this".

Then send the payment with `fxQuoteId` and `minorUnits` equal to the quote's `amountFromMinorUnits`.

**The two amounts are the agreement.** `rateMicro` (the rate × 1,000,000) is for display. Don't multiply an amount by it to get the other side; the result can differ from the quoted amount.

Quotes are single-use and expire. Read `validForSeconds` rather than assuming a lifetime.

Requires the `payments:write` scope.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/fx-quotes
openapi: 3.1.0
info:
  title: Talescria API
  version: 1.0.0
  description: >-
    Accounts, recipients, payments, transfers between your accounts, payment
    links, customers and invoices. Authenticate with an access token from your
    OAuth client.
servers:
  - url: https://api.talescria.com
    description: Production (test and live keys)
security:
  - bearerAuth: []
tags:
  - name: Accounts
    description: Your accounts and their balances.
  - name: Recipients
    description: People and businesses you pay, and where to pay them.
  - name: Payments
    description: Paying recipients, including across currencies.
  - name: Transfers
    description: Moving money between your own accounts.
  - name: Payment links
    description: Links anyone can open to pay you by card.
  - name: Customers
    description: People and businesses who pay you.
  - name: Invoices
    description: One-off invoices and recurring series.
paths:
  /v1/fx-quotes:
    post:
      tags:
        - Payments
      summary: Create an FX quote
      description: >-
        Locks an exchange rate for a payment to a destination in a currency the
        source account doesn't hold.


        Fix exactly one side:


        - `amountToMinorUnits`: "the recipient gets exactly this". This is what
        most payment flows want.

        - `amountFromMinorUnits`: "spend exactly this".


        Then send the payment with `fxQuoteId` and `minorUnits` equal to the
        quote's `amountFromMinorUnits`.


        **The two amounts are the agreement.** `rateMicro` (the rate ×
        1,000,000) is for display. Don't multiply an amount by it to get the
        other side; the result can differ from the quoted amount.


        Quotes are single-use and expire. Read `validForSeconds` rather than
        assuming a lifetime.


        Requires the `payments:write` scope.
      operationId: createFxQuote
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFxQuote'
            examples:
              deliverExactly:
                summary: Deliver exactly ₦50,000.00, the sender covers the cost
                value:
                  fromAccountId: acct_01M2P8GP7RSDXN81CXRFM2HFV7
                  toCurrency: NGN
                  amountToMinorUnits: '5000000'
      responses:
        '201':
          description: A locked rate.
          content:
            application/json:
              schema:
                type: object
                properties:
                  quote:
                    $ref: '#/components/schemas/FxQuote'
        '400':
          description: '`VALIDATION`: A field is missing or malformed. `message` says which.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            `UNAUTHENTICATED`: The access token is missing, expired or revoked.
            Get a new token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            `INSUFFICIENT_SCOPE`: Your API key lacks the scope this operation
            needs. The scope is named in `message` and the `WWW-Authenticate`
            header.


            `ENVIRONMENT_MISMATCH`: The request named a different environment
            from the key's.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            `NOT_FOUND`: It doesn't exist, or isn't yours. The answer is the
            same for both.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            `NOT_VERIFIED`: Your account hasn't finished verification. Finish
            onboarding, then retry.


            `IDEMPOTENCY_IN_PROGRESS`: A request with this `Idempotency-Key` is
            still running. Retry shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            `UNSUPPORTED`: This can't work as asked, for example an unsupported
            currency, corridor or account. `message` says why.


            `IDEMPOTENCY_KEY_REUSED`: This `Idempotency-Key` was used for a
            different request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '`RATE_LIMITED`: Too many requests. Wait for `Retry-After` seconds.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '`UPSTREAM_UNAVAILABLE`: Temporarily unavailable. Retry with backoff.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: Optional. A unique key for this operation, so a retry is applied once.
      schema:
        type: string
        minLength: 8
        maxLength: 255
        pattern: ^[A-Za-z0-9_\-:.]+$
  schemas:
    CreateFxQuote:
      type: object
      required:
        - fromAccountId
        - toCurrency
      properties:
        fromAccountId:
          type: string
          description: >-
            The account to pay from. Its currency is the quote's source
            currency.
        toCurrency:
          type: string
          description: What the recipient receives. Upper-cased for you.
        amountFromMinorUnits:
          type: string
          pattern: ^\d+$
          description: >-
            "Spend exactly this." Fix this **or** `amountToMinorUnits`, never
            both.
        amountToMinorUnits:
          type: string
          pattern: ^\d+$
          description: '"Deliver exactly this." The side a send flow usually fixes.'
          example: '5000000'
    FxQuote:
      type: object
      required:
        - quoteId
        - from
        - to
        - amountFromMinorUnits
        - amountToMinorUnits
        - rateMicro
        - status
        - expiresAt
        - validForSeconds
      properties:
        quoteId:
          type: string
        from:
          type: string
          example: GBP
        to:
          type: string
          example: NGN
        amountFromMinorUnits:
          type: string
          description: What leaves the account. Send this as the transfer's `minorUnits`.
          example: '2882'
        amountToMinorUnits:
          type: string
          description: What the recipient receives.
          example: '5000000'
        rateMicro:
          type: integer
          format: int64
          description: >-
            The rate × 1,000,000, for display only. Don't compute amounts from
            it; `amountFromMinorUnits` and `amountToMinorUnits` are the
            agreement.
          example: 1735328951
        status:
          type: string
          enum:
            - active
            - used
            - expired
          description: Single-use. Once a transfer applies it, a new quote is needed.
        expiresAt:
          type: integer
          format: int64
          description: Epoch milliseconds.
        validForSeconds:
          type: integer
          description: >-
            Varies per quote and per currency pair, read it rather than assuming
            a TTL.
          example: 179
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Branch on this, not on `message`. See Errors.
            message:
              type: string
              description: For people. Wording can change.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An access token (`at_test_…` or `at_live_…`) from `POST
        https://idp.talescria.com/oauth/token`.

````

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