AlmondTill/G3N API

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:

What happens

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

Arguments

NameTypeRequiredNotes
fromCurrencyString String!yes
organizationIdID ID!yes
logicalFacilityIdIDno
atStringno

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

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-1971e30a0000",
  "logicalFacilityId": "01900000-0000-7000-8000-10c08c590000"
}

Example response

json
{
  "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

Used in