Skip to content
Docs
Reference

BackstageClient.cashSessions

BackstageClient.cashSessions in @ticketlayer/backstage.

@ticketlayer/backstage


@ticketlayer/backstage / BackstageClient / cashSessions

cashSessions: {
  approve: (sessionId: string, request: {
     note: string;
   }, requestOptions?: RequestOptions) => Promise<{
     accountId: string;
     book: "live" | "test";
     cardMachineBatchTotal: number | null;
     cardMachineRecordedTotal: number | null;
     channelId: string | null;
     closedAt: string | null;
     closedBy: string | null;
     countedAmount: number | null;
     currency: string;
     expectedAmount: number | null;
     floatAmount: number;
     id: string;
     locationId: string | null;
     openedAt: string;
     openedBy: string;
     operatorId: string;
     reviewedAt: string | null;
     reviewedBy: string | null;
     reviewNote: string | null;
     status: "open" | "closed" | "closed_pending_review" | "reviewed";
     variance: number | null;
     varianceReason: string | null;
     varianceThreshold: number;
  }>;
  close: (sessionId: string, request: {
     cardMachineBatchTotal?: number;
     counted: number;
     varianceReason?: string;
   }, requestOptions?: RequestOptions) => Promise<{
     accountId: string;
     book: "live" | "test";
     cardMachineBatchTotal: number | null;
     cardMachineRecordedTotal: number | null;
     channelId: string | null;
     closedAt: string | null;
     closedBy: string | null;
     countedAmount: number | null;
     currency: string;
     expectedAmount: number | null;
     floatAmount: number;
     id: string;
     locationId: string | null;
     openedAt: string;
     openedBy: string;
     operatorId: string;
     reviewedAt: string | null;
     reviewedBy: string | null;
     reviewNote: string | null;
     status: "open" | "closed" | "closed_pending_review" | "reviewed";
     variance: number | null;
     varianceReason: string | null;
     varianceThreshold: number;
  }>;
  get: (sessionId: string, requestOptions?: RequestOptions) => Promise<{
     accountId: string;
     book: "live" | "test";
     cardMachineBatchTotal: number | null;
     cardMachineRecordedTotal: number | null;
     channelId: string | null;
     closedAt: string | null;
     closedBy: string | null;
     countedAmount: number | null;
     currency: string;
     expectedAmount: number | null;
     floatAmount: number;
     id: string;
     locationId: string | null;
     openedAt: string;
     openedBy: string;
     operatorId: string;
     reviewedAt: string | null;
     reviewedBy: string | null;
     reviewNote: string | null;
     status: "open" | "closed" | "closed_pending_review" | "reviewed";
     variance: number | null;
     varianceReason: string | null;
     varianceThreshold: number;
  }>;
  getSettings: (requestOptions?: RequestOptions) => Promise<{
     updatedAt: string | null;
     updatedBy: string | null;
     varianceThreshold: number;
  }>;
  handover: (sessionId: string, request: {
     counted: number;
     reason?: string;
     toOperatorId: string;
   }, requestOptions?: RequestOptions) => Promise<{
     movement: {
        actorId: string;
        amount: number;
        createdAt: string;
        expectedAmount: number | null;
        id: string;
        journalId: string | null;
        kind: "float" | "paid_in" | "paid_out" | "safe_drop" | "handover" | "close";
        overThreshold: boolean;
        reason: string | null;
        toOperatorId: string | null;
        variance: number | null;
        varianceJournalId: string | null;
     };
     session: {
        accountId: string;
        book: "live" | "test";
        cardMachineBatchTotal: number | null;
        cardMachineRecordedTotal: number | null;
        channelId: string | null;
        closedAt: string | null;
        closedBy: string | null;
        countedAmount: number | null;
        currency: string;
        expectedAmount: number | null;
        floatAmount: number;
        id: string;
        locationId: string | null;
        openedAt: string;
        openedBy: string;
        operatorId: string;
        reviewedAt: string | null;
        reviewedBy: string | null;
        reviewNote: string | null;
        status: "open" | "closed" | "closed_pending_review" | "reviewed";
        variance: number | null;
        varianceReason: string | null;
        varianceThreshold: number;
     };
  }>;
  list: (options?: {
     accountId?: string;
     limit?: number;
     locationId?: string;
     status?: "open" | "closed" | "closed_pending_review" | "reviewed";
   }, requestOptions?: RequestOptions) => Promise<{
     accountId: string;
     book: "live" | "test";
     cardMachineBatchTotal: number | null;
     cardMachineRecordedTotal: number | null;
     channelId: string | null;
     closedAt: string | null;
     closedBy: string | null;
     countedAmount: number | null;
     currency: string;
     expectedAmount: number | null;
     floatAmount: number;
     id: string;
     locationId: string | null;
     openedAt: string;
     openedBy: string;
     operatorId: string;
     reviewedAt: string | null;
     reviewedBy: string | null;
     reviewNote: string | null;
     status: "open" | "closed" | "closed_pending_review" | "reviewed";
     variance: number | null;
     varianceReason: string | null;
     varianceThreshold: number;
  }[]>;
  open: (request: {
     accountId: string;
     channelId?: string;
     currency?: string;
     floatAmount: number;
     locationId?: string;
   }, requestOptions?: RequestOptions) => Promise<{
     accountId: string;
     book: "live" | "test";
     cardMachineBatchTotal: number | null;
     cardMachineRecordedTotal: number | null;
     channelId: string | null;
     closedAt: string | null;
     closedBy: string | null;
     countedAmount: number | null;
     currency: string;
     expectedAmount: number | null;
     floatAmount: number;
     id: string;
     locationId: string | null;
     openedAt: string;
     openedBy: string;
     operatorId: string;
     reviewedAt: string | null;
     reviewedBy: string | null;
     reviewNote: string | null;
     status: "open" | "closed" | "closed_pending_review" | "reviewed";
     variance: number | null;
     varianceReason: string | null;
     varianceThreshold: number;
  }>;
  recordMovement: (sessionId: string, request: {
     amount: number;
     kind: "paid_in" | "paid_out" | "safe_drop";
     reason: string;
   }, requestOptions?: RequestOptions) => Promise<{
     actorId: string;
     amount: number;
     createdAt: string;
     expectedAmount: number | null;
     id: string;
     journalId: string | null;
     kind: "float" | "paid_in" | "paid_out" | "safe_drop" | "handover" | "close";
     overThreshold: boolean;
     reason: string | null;
     toOperatorId: string | null;
     variance: number | null;
     varianceJournalId: string | null;
  }>;
  report: (sessionId: string, requestOptions?: RequestOptions) => Promise<{
     cardMachine: {
        batchTotal: number | null;
        difference: number | null;
        recorded: number;
     };
     cashRefunds: {
        amount: number;
        count: number;
     };
     cashSales: {
        amount: number;
        count: number;
     };
     counted: number | null;
     expected: number;
     floatAmount: number;
     handoverVariance: number;
     kind: "X" | "Z";
     movements: {
        actorId: string;
        amount: number;
        createdAt: string;
        expectedAmount: number | null;
        id: string;
        journalId: string | null;
        kind: "float" | "paid_in" | "paid_out" | "safe_drop" | "handover" | "close";
        overThreshold: boolean;
        reason: string | null;
        toOperatorId: string | null;
        variance: number | null;
        varianceJournalId: string | null;
     }[];
     paidIn: number;
     paidOut: number;
     safeDrops: number;
     session: {
        accountId: string;
        book: "live" | "test";
        cardMachineBatchTotal: number | null;
        cardMachineRecordedTotal: number | null;
        channelId: string | null;
        closedAt: string | null;
        closedBy: string | null;
        countedAmount: number | null;
        currency: string;
        expectedAmount: number | null;
        floatAmount: number;
        id: string;
        locationId: string | null;
        openedAt: string;
        openedBy: string;
        operatorId: string;
        reviewedAt: string | null;
        reviewedBy: string | null;
        reviewNote: string | null;
        status: "open" | "closed" | "closed_pending_review" | "reviewed";
        variance: number | null;
        varianceReason: string | null;
        varianceThreshold: number;
     };
     variance: number | null;
  }>;
  setSettings: (request: {
     varianceThreshold: number;
   }, requestOptions?: RequestOptions) => Promise<{
     updatedAt: string | null;
     updatedBy: string | null;
     varianceThreshold: number;
  }>;
};

Defined in: client.ts:6481

Cash sessions methods

approve()#

approve: (sessionId: string, request: {
  note: string;
}, requestOptions?: RequestOptions) => Promise<{
  accountId: string;
  book: "live" | "test";
  cardMachineBatchTotal: number | null;
  cardMachineRecordedTotal: number | null;
  channelId: string | null;
  closedAt: string | null;
  closedBy: string | null;
  countedAmount: number | null;
  currency: string;
  expectedAmount: number | null;
  floatAmount: number;
  id: string;
  locationId: string | null;
  openedAt: string;
  openedBy: string;
  operatorId: string;
  reviewedAt: string | null;
  reviewedBy: string | null;
  reviewNote: string | null;
  status: "open" | "closed" | "closed_pending_review" | "reviewed";
  variance: number | null;
  varianceReason: string | null;
  varianceThreshold: number;
}>;

Approve a cash session's variance Signs off a session closed with a variance over its threshold, with a note. The person who closed it cannot (CASH_SESSION_SELF_APPROVAL). The variance was posted at close; this is the review on record. Needs cashsessions.approve, which only the owner roles hold.

Parameters#

ParameterTypeDescription
sessionIdstring-
request{ note: string; }-
request.notestringExample Recounted with Sam; a 10.00 note was in the card tray.
requestOptions?RequestOptions-

Returns#

Promise<{ accountId: string; book: "live" | "test"; cardMachineBatchTotal: number | null; cardMachineRecordedTotal: number | null; channelId: string | null; closedAt: string | null; closedBy: string | null; countedAmount: number | null; currency: string; expectedAmount: number | null; floatAmount: number; id: string; locationId: string | null; openedAt: string; openedBy: string; operatorId: string; reviewedAt: string | null; reviewedBy: string | null; reviewNote: string | null; status: "open" | "closed" | "closed_pending_review" | "reviewed"; variance: number | null; varianceReason: string | null; varianceThreshold: number; }>

Operation Id#

approveCashSession

close()#

close: (sessionId: string, request: {
  cardMachineBatchTotal?: number;
  counted: number;
  varianceReason?: string;
}, requestOptions?: RequestOptions) => Promise<{
  accountId: string;
  book: "live" | "test";
  cardMachineBatchTotal: number | null;
  cardMachineRecordedTotal: number | null;
  channelId: string | null;
  closedAt: string | null;
  closedBy: string | null;
  countedAmount: number | null;
  currency: string;
  expectedAmount: number | null;
  floatAmount: number;
  id: string;
  locationId: string | null;
  openedAt: string;
  openedBy: string;
  operatorId: string;
  reviewedAt: string | null;
  reviewedBy: string | null;
  reviewNote: string | null;
  status: "open" | "closed" | "closed_pending_review" | "reviewed";
  variance: number | null;
  varianceReason: string | null;
  varianceThreshold: number;
}>;

Close a cash session with a blind count Closes the session with what was counted: the variance (counted less expected) posts to CashOverShort and the counted cash leaves the drawer for the account's own Cash, so the drawer is empty in the ledger. A variance over the session's threshold needs a varianceReason (CASH_VARIANCE_REASON_REQUIRED) and closes the session pending review. The card machine's batch total is kept against the card machine payments recorded in the session. Needs cashsessions.operate.

Parameters#

ParameterTypeDescription
sessionIdstring-
request{ cardMachineBatchTotal?: number; counted: number; varianceReason?: string; }-
request.cardMachineBatchTotal?numberDescription The card machine's end-of-day batch total, checked against the card machine payments recorded in the session Example 8400
request.counted?numberDescription The blind count: what is in the drawer, counted without seeing what should be Example 40210
request.varianceReason?stringDescription Why the count is out. Required when it is out by more than the threshold; the session then closes pending review.
requestOptions?RequestOptions-

Returns#

Promise<{ accountId: string; book: "live" | "test"; cardMachineBatchTotal: number | null; cardMachineRecordedTotal: number | null; channelId: string | null; closedAt: string | null; closedBy: string | null; countedAmount: number | null; currency: string; expectedAmount: number | null; floatAmount: number; id: string; locationId: string | null; openedAt: string; openedBy: string; operatorId: string; reviewedAt: string | null; reviewedBy: string | null; reviewNote: string | null; status: "open" | "closed" | "closed_pending_review" | "reviewed"; variance: number | null; varianceReason: string | null; varianceThreshold: number; }>

Operation Id#

closeCashSession

get()#

get: (sessionId: string, requestOptions?: RequestOptions) => Promise<{
  accountId: string;
  book: "live" | "test";
  cardMachineBatchTotal: number | null;
  cardMachineRecordedTotal: number | null;
  channelId: string | null;
  closedAt: string | null;
  closedBy: string | null;
  countedAmount: number | null;
  currency: string;
  expectedAmount: number | null;
  floatAmount: number;
  id: string;
  locationId: string | null;
  openedAt: string;
  openedBy: string;
  operatorId: string;
  reviewedAt: string | null;
  reviewedBy: string | null;
  reviewNote: string | null;
  status: "open" | "closed" | "closed_pending_review" | "reviewed";
  variance: number | null;
  varianceReason: string | null;
  varianceThreshold: number;
}>;

Get a cash session One cash session. Needs cashsessions.read on its account.

Parameters#

ParameterType
sessionIdstring
requestOptions?RequestOptions

Returns#

Promise<{ accountId: string; book: "live" | "test"; cardMachineBatchTotal: number | null; cardMachineRecordedTotal: number | null; channelId: string | null; closedAt: string | null; closedBy: string | null; countedAmount: number | null; currency: string; expectedAmount: number | null; floatAmount: number; id: string; locationId: string | null; openedAt: string; openedBy: string; operatorId: string; reviewedAt: string | null; reviewedBy: string | null; reviewNote: string | null; status: "open" | "closed" | "closed_pending_review" | "reviewed"; variance: number | null; varianceReason: string | null; varianceThreshold: number; }>

Operation Id#

getCashSession

getSettings()#

getSettings: (requestOptions?: RequestOptions) => Promise<{
  updatedAt: string | null;
  updatedBy: string | null;
  varianceThreshold: number;
}>;

Get the organisation's cash session settings The variance threshold: how far a handover or closing count may be out without being flagged, in minor units. 500 (5.00) unless the organisation sets another. Each session takes it when it opens. Needs cashsessions.read on some account.

Parameters#

ParameterType
requestOptions?RequestOptions

Returns#

Promise<{ updatedAt: string | null; updatedBy: string | null; varianceThreshold: number; }>

Operation Id#

getCashSessionSettings

handover()#

handover: (sessionId: string, request: {
  counted: number;
  reason?: string;
  toOperatorId: string;
}, requestOptions?: RequestOptions) => Promise<{
  movement: {
     actorId: string;
     amount: number;
     createdAt: string;
     expectedAmount: number | null;
     id: string;
     journalId: string | null;
     kind: "float" | "paid_in" | "paid_out" | "safe_drop" | "handover" | "close";
     overThreshold: boolean;
     reason: string | null;
     toOperatorId: string | null;
     variance: number | null;
     varianceJournalId: string | null;
  };
  session: {
     accountId: string;
     book: "live" | "test";
     cardMachineBatchTotal: number | null;
     cardMachineRecordedTotal: number | null;
     channelId: string | null;
     closedAt: string | null;
     closedBy: string | null;
     countedAmount: number | null;
     currency: string;
     expectedAmount: number | null;
     floatAmount: number;
     id: string;
     locationId: string | null;
     openedAt: string;
     openedBy: string;
     operatorId: string;
     reviewedAt: string | null;
     reviewedBy: string | null;
     reviewNote: string | null;
     status: "open" | "closed" | "closed_pending_review" | "reviewed";
     variance: number | null;
     varianceReason: string | null;
     varianceThreshold: number;
  };
}>;

Hand the drawer to the next person The outgoing person counts the drawer; the difference from what should be there posts to their account's CashOverShort as theirs, and the session carries on with the next person. A count out by more than the threshold (the organisation's, 5.00 unless set) still carries on, and the movement is flagged overThreshold. Needs cashsessions.operate.

Parameters#

ParameterTypeDescription
sessionIdstring-
request{ counted: number; reason?: string; toOperatorId: string; }-
request.countednumberDescription What the outgoing person counted in the drawer Example 41230
request.reason?stringDescription Why the count is out, if it is
request.toOperatorId?stringDescription Who takes the drawer over: their user id Example usr_priya
requestOptions?RequestOptions-

Returns#

Promise<{ movement: { actorId: string; amount: number; createdAt: string; expectedAmount: number | null; id: string; journalId: string | null; kind: "float" | "paid_in" | "paid_out" | "safe_drop" | "handover" | "close"; overThreshold: boolean; reason: string | null; toOperatorId: string | null; variance: number | null; varianceJournalId: string | null; }; session: { accountId: string; book: "live" | "test"; cardMachineBatchTotal: number | null; cardMachineRecordedTotal: number | null; channelId: string | null; closedAt: string | null; closedBy: string | null; countedAmount: number | null; currency: string; expectedAmount: number | null; floatAmount: number; id: string; locationId: string | null; openedAt: string; openedBy: string; operatorId: string; reviewedAt: string | null; reviewedBy: string | null; reviewNote: string | null; status: "open" | "closed" | "closed_pending_review" | "reviewed"; variance: number | null; varianceReason: string | null; varianceThreshold: number; }; }>

Operation Id#

handOverCashSession

list()#

list: (options?: {
  accountId?: string;
  limit?: number;
  locationId?: string;
  status?: "open" | "closed" | "closed_pending_review" | "reviewed";
}, requestOptions?: RequestOptions) => Promise<{
  accountId: string;
  book: "live" | "test";
  cardMachineBatchTotal: number | null;
  cardMachineRecordedTotal: number | null;
  channelId: string | null;
  closedAt: string | null;
  closedBy: string | null;
  countedAmount: number | null;
  currency: string;
  expectedAmount: number | null;
  floatAmount: number;
  id: string;
  locationId: string | null;
  openedAt: string;
  openedBy: string;
  operatorId: string;
  reviewedAt: string | null;
  reviewedBy: string | null;
  reviewNote: string | null;
  status: "open" | "closed" | "closed_pending_review" | "reviewed";
  variance: number | null;
  varianceReason: string | null;
  varianceThreshold: number;
}[]>;

List cash sessions The cash sessions on the accounts the caller holds cashsessions.list for, newest first, filtered by account, location and status. closed_pending_review lists the variances waiting for someone to approve them.

Parameters#

ParameterType
options?{ accountId?: string; limit?: number; locationId?: string; status?: "open" | "closed" | "closed_pending_review" | "reviewed"; }
options.accountId?string
options.limit?number
options.locationId?string
options.status?"open" | "closed" | "closed_pending_review" | "reviewed"
requestOptions?RequestOptions

Returns#

Promise<{ accountId: string; book: "live" | "test"; cardMachineBatchTotal: number | null; cardMachineRecordedTotal: number | null; channelId: string | null; closedAt: string | null; closedBy: string | null; countedAmount: number | null; currency: string; expectedAmount: number | null; floatAmount: number; id: string; locationId: string | null; openedAt: string; openedBy: string; operatorId: string; reviewedAt: string | null; reviewedBy: string | null; reviewNote: string | null; status: "open" | "closed" | "closed_pending_review" | "reviewed"; variance: number | null; varianceReason: string | null; varianceThreshold: number; }[]>

Operation Id#

listCashSessions

open()#

open: (request: {
  accountId: string;
  channelId?: string;
  currency?: string;
  floatAmount: number;
  locationId?: string;
}, requestOptions?: RequestOptions) => Promise<{
  accountId: string;
  book: "live" | "test";
  cardMachineBatchTotal: number | null;
  cardMachineRecordedTotal: number | null;
  channelId: string | null;
  closedAt: string | null;
  closedBy: string | null;
  countedAmount: number | null;
  currency: string;
  expectedAmount: number | null;
  floatAmount: number;
  id: string;
  locationId: string | null;
  openedAt: string;
  openedBy: string;
  operatorId: string;
  reviewedAt: string | null;
  reviewedBy: string | null;
  reviewNote: string | null;
  status: "open" | "closed" | "closed_pending_review" | "reviewed";
  variance: number | null;
  varianceReason: string | null;
  varianceThreshold: number;
}>;

Open a cash session Opens a drawer with a counted float: an account's drawer at a box office location, or its own. One session is open per drawer at a time (CASH_SESSION_ALREADY_OPEN). The float posts to the ledger, moving cash from the account's own Cash into Party:{account}:Drawer:{sessionId}; while the session is open every cash payment taken into the drawer is the session's. Once a drawer has run a session, cash taken into it with none open is refused (CASH_SESSION_REQUIRED). Needs cashsessions.operate on the account.

Parameters#

ParameterTypeDescription
request{ accountId: string; channelId?: string; currency?: string; floatAmount: number; locationId?: string; }-
request.accountIdstringDescription The account whose drawer it is: the box office's account Example acc_boxoffice
request.channelId?stringDescription The channel the till sells on, for the report.
request.currency?stringDescription ISO 4217; GBP when left out Example GBP
request.floatAmount?numberDescription The float, counted into the drawer at the start Example 15000
request.locationId?stringDescription The box office location the drawer is at. Left out, the account's own drawer. Example loc_7Kq2mZ9x
requestOptions?RequestOptions-

Returns#

Promise<{ accountId: string; book: "live" | "test"; cardMachineBatchTotal: number | null; cardMachineRecordedTotal: number | null; channelId: string | null; closedAt: string | null; closedBy: string | null; countedAmount: number | null; currency: string; expectedAmount: number | null; floatAmount: number; id: string; locationId: string | null; openedAt: string; openedBy: string; operatorId: string; reviewedAt: string | null; reviewedBy: string | null; reviewNote: string | null; status: "open" | "closed" | "closed_pending_review" | "reviewed"; variance: number | null; varianceReason: string | null; varianceThreshold: number; }>

Operation Id#

openCashSession

recordMovement()#

recordMovement: (sessionId: string, request: {
  amount: number;
  kind: "paid_in" | "paid_out" | "safe_drop";
  reason: string;
}, requestOptions?: RequestOptions) => Promise<{
  actorId: string;
  amount: number;
  createdAt: string;
  expectedAmount: number | null;
  id: string;
  journalId: string | null;
  kind: "float" | "paid_in" | "paid_out" | "safe_drop" | "handover" | "close";
  overThreshold: boolean;
  reason: string | null;
  toOperatorId: string | null;
  variance: number | null;
  varianceJournalId: string | null;
}>;

Pay in, pay out or drop to the safe Records money into the drawer (paid_in, a change top-up) or out of it (paid_out for something, safe_drop to the safe), with a reason, and posts it: cash between the drawer and the account's own Cash. More out than the drawer holds is refused (CASH_SESSION_INSUFFICIENT). Needs cashsessions.operate.

Parameters#

ParameterTypeDescription
sessionIdstring-
request{ amount: number; kind: "paid_in" | "paid_out" | "safe_drop"; reason: string; }-
request.amountnumberExample 2000
request.kind?"paid_in" | "paid_out" | "safe_drop"Description paid_in: money into the drawer (a change top-up). paid_out: money out for something (petty cash). safe_drop: notes out to the safe.
request.reason?stringDescription Why, or the safe bag number Example Change top-up
requestOptions?RequestOptions-

Returns#

Promise<{ actorId: string; amount: number; createdAt: string; expectedAmount: number | null; id: string; journalId: string | null; kind: "float" | "paid_in" | "paid_out" | "safe_drop" | "handover" | "close"; overThreshold: boolean; reason: string | null; toOperatorId: string | null; variance: number | null; varianceJournalId: string | null; }>

Operation Id#

recordCashMovement

report()#

report: (sessionId: string, requestOptions?: RequestOptions) => Promise<{
  cardMachine: {
     batchTotal: number | null;
     difference: number | null;
     recorded: number;
  };
  cashRefunds: {
     amount: number;
     count: number;
  };
  cashSales: {
     amount: number;
     count: number;
  };
  counted: number | null;
  expected: number;
  floatAmount: number;
  handoverVariance: number;
  kind: "X" | "Z";
  movements: {
     actorId: string;
     amount: number;
     createdAt: string;
     expectedAmount: number | null;
     id: string;
     journalId: string | null;
     kind: "float" | "paid_in" | "paid_out" | "safe_drop" | "handover" | "close";
     overThreshold: boolean;
     reason: string | null;
     toOperatorId: string | null;
     variance: number | null;
     varianceJournalId: string | null;
  }[];
  paidIn: number;
  paidOut: number;
  safeDrops: number;
  session: {
     accountId: string;
     book: "live" | "test";
     cardMachineBatchTotal: number | null;
     cardMachineRecordedTotal: number | null;
     channelId: string | null;
     closedAt: string | null;
     closedBy: string | null;
     countedAmount: number | null;
     currency: string;
     expectedAmount: number | null;
     floatAmount: number;
     id: string;
     locationId: string | null;
     openedAt: string;
     openedBy: string;
     operatorId: string;
     reviewedAt: string | null;
     reviewedBy: string | null;
     reviewNote: string | null;
     status: "open" | "closed" | "closed_pending_review" | "reviewed";
     variance: number | null;
     varianceReason: string | null;
     varianceThreshold: number;
  };
  variance: number | null;
}>;

Get a cash session's X or Z report The X report while the session is open, the Z report once closed: the float, cash sales and refunds, money paid in and out, safe drops, handover variances, what should be in the drawer (from the ledger, never summed here), the count and variance at close, and the card machine's batch total against the card machine payments recorded in the session. For a blind count, count before reading this. Needs cashsessions.read on its account.

Parameters#

ParameterType
sessionIdstring
requestOptions?RequestOptions

Returns#

Promise<{ cardMachine: { batchTotal: number | null; difference: number | null; recorded: number; }; cashRefunds: { amount: number; count: number; }; cashSales: { amount: number; count: number; }; counted: number | null; expected: number; floatAmount: number; handoverVariance: number; kind: "X" | "Z"; movements: { actorId: string; amount: number; createdAt: string; expectedAmount: number | null; id: string; journalId: string | null; kind: "float" | "paid_in" | "paid_out" | "safe_drop" | "handover" | "close"; overThreshold: boolean; reason: string | null; toOperatorId: string | null; variance: number | null; varianceJournalId: string | null; }[]; paidIn: number; paidOut: number; safeDrops: number; session: { accountId: string; book: "live" | "test"; cardMachineBatchTotal: number | null; cardMachineRecordedTotal: number | null; channelId: string | null; closedAt: string | null; closedBy: string | null; countedAmount: number | null; currency: string; expectedAmount: number | null; floatAmount: number; id: string; locationId: string | null; openedAt: string; openedBy: string; operatorId: string; reviewedAt: string | null; reviewedBy: string | null; reviewNote: string | null; status: "open" | "closed" | "closed_pending_review" | "reviewed"; variance: number | null; varianceReason: string | null; varianceThreshold: number; }; variance: number | null; }>

Operation Id#

getCashSessionReport

setSettings()#

setSettings: (request: {
  varianceThreshold: number;
}, requestOptions?: RequestOptions) => Promise<{
  updatedAt: string | null;
  updatedBy: string | null;
  varianceThreshold: number;
}>;

Set the organisation's cash session settings Sets the variance threshold for the organisation. Sessions already open keep the threshold they opened with. Needs cashsessions.approve on every account, held by owners and platform admins unless granted to a role of the organisation's.

Parameters#

ParameterTypeDescription
request{ varianceThreshold: number; }-
request.varianceThresholdnumberDescription How far a count may be out without a reason and a review, in minor units Example 500
requestOptions?RequestOptions-

Returns#

Promise<{ updatedAt: string | null; updatedBy: string | null; varianceThreshold: number; }>

Operation Id#

putCashSessionSettings