AlmondTill/G3N API

On this page

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. '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.

Arguments

NameTypeRequiredNotes
fromCurrencyString String!yesNo further notes.
organizationIdID ID!yesNo further notes.
logicalFacilityIdIDnoNo further notes.
atStringnoNo further notes.

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-44b781470000",
  "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000"
}

Example response

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

Used in