AlmondTill/G3N API

On this page

recordCashEntry

mutation · in the family Till and cash management

What it does

Record cash moving in or out of the drawer outside a sale — paid-ins, paid-outs, drops to the safe, pickups.

RECORD one MANUAL drawer entry against an OPEN till session: the entry + the drawerTotals cache stamp land in ONE transaction under the session's OCC (concurrent records serialize CONFLICT/REVISION_STALE, retryable); an entry driving its currency's total negative stamps overdrawn + is evented. Requires the unrestricted capability.

What happens

Posts one signed drawer entry with a required reason; the drawer’s expected totals update immediately.

Careful

An entry that would drive the drawer negative is flagged and evented — the drawer story is always auditable.

Who may call it

Capability area: Till and cash management — Manual drawer entries and force-closing a till.

Arguments

NameTypeRequiredNotes
inputRecordCashEntryInput RecordCashEntryInput!yesNo further notes.

Returns

CashEntry CashEntry! — ONE posted cash-drawer ledger fact: the SIGN is the direction (positive = cash INTO the drawer). sysId-LESS (the class); IMMUTABLE — NO update or doom op exists (corrections are NEW compensating entries); posted ONLY by openTillSession (float_in), recordCashEntry (the manual subset), closeTillSession (count_adjust), and the tender writers (cash_sale/cash_refund/change_given) — each in ONE transaction with the drawerTotals cache stamp.

Example request

mutation ExampleRecordCashEntry($input: RecordCashEntryInput!) {
  recordCashEntry(input: $input) {
    id
    type
    caption
    status
    parentId
    rootId
    entryType
    currency
    amountMinor
    reason
    glCategory
    refs
    overdrawn
    createdAt
    updatedAt
    revision
    revisionNum
  }
}

Variables:

{
  "input": {
    "tillSessionId": "01900000-0000-7000-8000-83d61fef0000",
    "entryType": "paid_in",
    "currency": "USD",
    "amountMinor": 1,
    "reason": "Correcting a miscount.",
    "glCategory": "<gl category>"
  }
}

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

Example response

{
  "data": {
    "recordCashEntry": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "type": "<type>",
      "caption": "Blue jeans",
      "status": "<status>",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "entryType": "float_in",
      "currency": "USD",
      "amountMinor": 1,
      "reason": "Correcting a miscount.",
      "glCategory": "<gl category>",
      "refs": [
        "<refs>"
      ],
      "overdrawn": true,
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "revisionNum": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in