resolveFxRate
query · in the family 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. fromCurrency is a platform-registry code inside the organization's allowed set. '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).
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Reading your records — Looking up and listing the records of your organization.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- Cashier
- An API key whose scope allows
api:resolveFxRate
What happens
Reads only — exactly the rate a foreign-cash payment would use this moment.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
fromCurrency | String String! | yes | |
organizationId | ID ID! | yes | |
logicalFacilityId | ID | no | |
at | String | no |
Returns
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
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:
{
"fromCurrency": "<from currency>",
"organizationId": "01900000-0000-7000-8000-1971e30a0000",
"logicalFacilityId": "01900000-0000-7000-8000-10c08c590000"
}Example response
{
"data": {
"resolveFxRate": {
"rateId": "01900000-0000-7000-8000-2eafe8870000",
"level": "<level>",
"fromCurrency": "<from currency>",
"toCurrency": "<to currency>",
"buyRateMicro": 1,
"sellRateMicro": 1,
"feeMinor": 0,
"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. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)