AlmondTill/G3N API

Take foreign cash at the till

Set the exchange rates your tills convert foreign cash at, and see exactly which rate a payment would use right now.

Pricing & money · a play in 2 steps.

In the office

Set the exchange rate your tills convert foreign cash at — a dated window between two currencies — and check the rate a foreign-cash payment would use at this moment. A cashier takes the second currency at the rate on this page; only you change it.

Where it starts: the office’s FX rates page.

FX rates — /fx-rates
FX rates — /fx-rates

Step 1. Set the rate for the foreign currency your tills accept.

Step 2. Check the rate a foreign-cash payment would use this moment.

What you see

The example shop takes CAD and USD; the rate a payment converts at is the one on this page at that moment.

Try it

Walked with screenshots in the manager’s manual: chapter 7 — Set the rates your tills take foreign cash at

For developers — the calls

The steps

  1. Set the rate for the foreign currency your tills accept. — createFxRate
  2. Check the rate a foreign-cash payment would use this moment. — resolveFxRate

The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

createFxRate

createFxRate — mutation · Create a new foreign-exchange rate your tills use for foreign cash at your organization.

Example request

graphql
mutation ExampleCreateFxRate($input: NewFxRateInput!) {
  createFxRate(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    level
    fromCurrency
    toCurrency
    mode
    buyRateMicro
    sellRateMicro
    adjustPpm
    feeMinor
    startAt
    endAt
  }
}

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "fromCurrency": "<from currency>",
    "toCurrency": "<to currency>",
    "mode": "<mode>",
    "endAt": "2027-01-31T00:00:00.000Z"
  }
}

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

Example response

json
{
  "data": {
    "createFxRate": {
      "id": "01900000-0000-7000-8000-33d8e2f90000",
      "sysId": "FX-EXMP-0000-000F",
      "type": "FxRate",
      "caption": "Blue jeans",
      "status": "active",
      "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": 0,
      "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
        }
      }
    }
  }
}

resolveFxRate

resolveFxRate — query · What exchange rate applies right now for a foreign currency at your organization.

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
        }
      }
    }
  }
}