@jaakaru/softpos_api v0.1.48
Table of Contents
jsonApi
JSON API methods to control the SoftPoS CashRegister, see also https://github.com/Soft-Contact/resto/issues/2#placeorder
placeOrder
Place order
Parameters
orderas a JSON objectsuccessCallbackas a function for successful callbackfailureCallbackas a function for failure callback
addToOpenTable
addToOpenTable
Parameters
openTableas a JSON object from https://github.com/Soft-Contact/resto/issues/2#addtoopentablesuccessCallbackas a function for successful callbackfailureCallbackas a function for failure callback
removeFromOpenTable
removeFromOpenTable
Parameters
removeReqas a JSON object with parameters "tableCode", "clerkCode": "rowID"successCallbackas a function for successful callbackfailureCallbackas a function for failure callback
getActiveTransaction
get currently on cashregister screen active transaction
Parameters
successCallbackfailureCallback
executeLisp
Execute lisp macro on cashregister side
Parameters
cmdlisp macro to executesuccessCallbackfailureCallback
Meta
- deprecated: use evalLisp instead, kept some time for backwards compatibility
evalLisp
Evaluate lisp macro on cashregister side
Parameters
cmdlisp macro to evaluatesuccessCallbackfailureCallback
printer
JSON API methods to control the SoftPoS CashRegister printing
Experimental: Print data to the printer
Parameters
printDatasuccessCallback
Examples
let printData =
{
lines: [
{ type: "TEXT", contents: "test string"},
{ type: "TEXT", contents: "text\non\nmultiple\nlines"},
{ type: "QR_CODE", contents: "sample code", alignment: "RIGHT"},
{ type: "BAR_CODE", contents: "1234567890123"},
{ type: "QR_CODE", contents: "another code"},
]
}payments
JSON API methods to control the SoftPoS CashRegister payment terminal
authorizePayment
Experimental: Authorize payment on SoftPoS side using SoftPos configured payment device
Parameters
paymentsuccessCallbackfailureCallbackstatusCallback
abortAuthorization
Experimental: Abort currently active payment
Parameters
successCallback
articles
JSON API methods to get article and article group data
listAll
Get all articles from SoftPos
Parameters
successCallbackerrorCallback
displays
API methods needed by various separate displays (KitchenDisplay, OrderDisplay).
listAllKitchenSystemTransactions
Experimental: List all transactions based on jobOrderSystemId
Parameters
jobOrderSystemIdJob order system id from which to list transactionssuccessCallbackerrorCallback
removeTransactionFromKitchenSystem
Experimental: Remove transactions based on jobOrderSystemId and transactionUuid
Parameters
jobOrderSystemIdJob order system id from which to remove transactiontransactionUuidtranscation to removesuccessCallbackerrorCallback
setLineStateInKitchenSystem
Experimental: Change transactionsline state
Parameters
jobOrderSystemIdJob order system id from which to remove transactiontransactionUuidtranscation to modifylineStateNameOrdered, Ready, Prepared, Served, Deleted, OthersuccessCallbackerrorCallback
getConfiguration
Experimental: Get map of configuration parameters, including custom configuration
Parameters
successCallbackerrorCallback
saveCustomConfiguration
Experimental: Save custom configuration
Parameters
confcustom configurationsuccessCallbackerrorCallback
saveWaitingTime
Save kitchen system waiting time in minutes
Parameters
jobOrderSystemIdwaitingTimesuccessCallbackerrorCallback
getWaitingTime
Get kitchen system waiting time in minutes
Parameters
jobOrderSystemIdsuccessCallbackerrorCallback
messages
Methods related to messages from SoftPos
listenAll
Experimental: Listen for all messages
Parameters
listenCallbackFncallback fn where all SoftPoS side asynchronous messages are passed
Examples
{ type: "COMMAND", data: "REFRESH_KITCHEN_DISPLAY"}utils
Utility methods
getApiType
Gets the SoftPoS API type depending on which environment is used to run it
Returns string one of NONE/HTMLVIEW_LEGACY/HTMLVIEW_JCEF
getSoftPosVersion
Gets the SoftPoS version
Returns string SoftPoS version
getSoftPosInfo
Get the SoftPos info JSON
Parameters
successCallbackfailureCallback
Returns json with fields "success" and "response", where response contains the SoftPosInfo object
log
Utility methods for logging
log
Parameters
logRecord
Examples
window.softPos.log({level: 'INFO', msg:'Info message'});trace
Log TRACE message
Parameters
msgobj
debug
Log DEBUG message
Parameters
msgobj
info
Log INFO message
Parameters
msgobj
warn
Log WARN message
Parameters
msgobj
error
Log ERROR message
Parameters
msgobj
fatal
Log FATAL message
Parameters
msgobj
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago