# resolveFxRate

query · in the family [Reading your records](/reference/reading-your-records/)

## What it does

What exchange rate applies right now for a foreign currency at your organization.

Resolve the EFFECTIVE FX rate for (fromCurrency → the org's default currency) at an instant. 'at' ABSENT = the server's now (past instants are legal — historical reconstruction is a READ). What this quotes is EXACTLY what a foreign_cash tender applies. No covering record / a dangling adjustment chain refuses CONFLICT/NO_EFFECTIVE_RATE (retryable — create the rate, then retry). Requires authentication; the org + LF are tenant-scoped server-side.

## What happens

Reads only — exactly the rate a foreign-cash payment would use this moment.

## Who may call it

Capability area: **Reading your records** — Looking up and listing the records of your organization.

- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- Cashier
- An API key whose scope allows `api:resolveFxRate`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `fromCurrency` | [String](/types/#scalars) `String!` | yes | No further notes. |
| `organizationId` | [ID](/types/#scalars) `ID!` | yes | No further notes. |
| `logicalFacilityId` | [ID](/types/#scalars) | no | No further notes. |
| `at` | [String](/types/#scalars) | no | No further notes. |

## Returns

[FxResolution](/types/FxResolution/) `FxResolution!` — The EFFECTIVE resolved rate for one (fromCurrency → org default) pair at one instant: the WINNING most-specific record's identity + window, with the COMPOSED figures (adjustment chains folded in, fees accumulated).

## Example request

```graphql
query ExampleResolveFxRate($fromCurrency: String!, $organizationId: ID!, $logicalFacilityId: ID) {
  resolveFxRate(fromCurrency: $fromCurrency, organizationId: $organizationId, logicalFacilityId: $logicalFacilityId) {
    rateId
    level
    fromCurrency
    toCurrency
    buyRateMicro
    sellRateMicro
    feeMinor
    startAt
    endAt
  }
}
```

Variables:

```json
{
  "fromCurrency": "<from currency>",
  "organizationId": "01900000-0000-7000-8000-44b781470000",
  "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000"
}
```

## Example response

```json
{
  "data": {
    "resolveFxRate": {
      "rateId": "01900000-0000-7000-8000-fcc46a0a0000",
      "level": "<level>",
      "fromCurrency": "<from currency>",
      "toCurrency": "<to currency>",
      "buyRateMicro": 1,
      "sellRateMicro": 1,
      "feeMinor": 1,
      "startAt": "2027-01-31T00:00:00.000Z",
      "endAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/NOT_FOUND/))

## Used in

- [Take foreign cash at the till](/use-cases/take-foreign-cash/)
