WebSocket Stream/openSession
Open a Session
Stream transaction lifecycle events in real time.
WS
/v1/sessionOpen a WebSocket to drive transactions and stream their lifecycle in real time. Send JSON action messages — sale, pre_auth, card_read, complete, display, input, abort — and receive a sequence of typed events as the transaction progresses. Events are a discriminated union on the event field, so a single switch statement is enough to drive your POS UI from waiting_for_card all the way through to result. The session is designed to survive flaky networks: the terminal keeps running its transaction even if the POS disconnects, and a resume token lets the POS reconnect and pick up the event stream exactly where it left off.
Sale lifecycle
~5–15 seconds
What happens after a single POST /v1/transaction/sale. Each step is also emitted as a WebSocket event if you connect a session in parallel.
Request body
application/json
actionenumrequiredThe action to initiate.
salepre_authcard_readcompletedisplayinputabortamountintegerRequired for sale/pre_auth.
currencystringRequired for sale/pre_auth.
entryModeenumOptional card entry mode.
CONTACTLESSCONTACTAUTOreferenceIdstringPOS-assigned reference identifier.
granularbooleanSet true to run in granular mode and receive online_authorization events.
transactionIdstringRequired for complete and abort.
responseCodestringISO 8583 response code (complete action).
authorizationCodestringIssuer auth code (complete action).
commerce-api/openapi.yaml · openSession