AlmondTill/G3N API

doomFxRate

mutation · in the family FX rate

What it does

Permanently retire a foreign-exchange rate your tills use for foreign cash.

Cancel a scheduled FxRate window: allowed only while the record is not yet effective (now < startAt). An effective or lapsed window is immutable rate history — CONFLICT/IMMUTABLE naming startAt vs now; supersede it with a new window instead. Requires the current revision + the unrestricted capability; the record is kept, excluded from resolution.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Pricing — Prices, price schedules, promotions, coupons and the money rules of selling.

Roles that may call it:

Careful

Doom is forever — a doomed record never comes back into use (its history remains readable). Anything still referencing it live will block the doom.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.
revisionID ID!yesThe revision id you read on the record; the change is refused if an edit landed in the meantime.
reasonStringno

Concurrency

Send the record’s current revision from your last read as revision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.

Returns

FxRate FxRate! — An FX rate window: ONE effective-dated conversion rate record in the tenant schedule, resolved group (default) → org → LF most-specific-wins at every conversion event. Modes: absolute (explicit buy/sell integer-micro rates — the only group-level mode) · adjust (± ppm over the next-less-specific effective rate, both directions, optional fee) · par (1:1). Doom cancels a not-yet-effective future record only (CONFLICT/IMMUTABLE otherwise — supersede instead). The window/pair/mode/rate fields are wire-IMMUTABLE (the edit surface is caption only). Consumed by the foreign_cash tender lane at the BUY side.

Example request

graphql
mutation ExampleDoomFxRate($id: ID!, $revision: ID!, $reason: String) {
  doomFxRate(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    level
    fromCurrency
    toCurrency
    mode
    buyRateMicro
    sellRateMicro
    adjustPpm
    feeMinor
    startAt
    endAt
  }
}

Variables:

json
{
  "id": "01900000-0000-7000-8000-33d8e2f90000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "doomFxRate": {
      "id": "01900000-0000-7000-8000-33d8e2f90000",
      "sysId": "FX-EXMP-0000-000F",
      "type": "FxRate",
      "caption": "Blue jeans",
      "status": "doomed",
      "parentId": "01900000-0000-7000-8000-1971e30a0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "level": "<level>",
      "fromCurrency": "<from currency>",
      "toCurrency": "<to currency>",
      "mode": "<mode>",
      "buyRateMicro": 1,
      "sellRateMicro": 1,
      "adjustPpm": 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": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer