3. NotAllowed and LoggedOut errors

Symptom

Requests fail with ErrorCondition: NotAllowed or ErrorCondition: LoggedOut, often after working previously.

LoggedOut — the session is gone

The terminal no longer has your session: it restarted, updated, or the session expired. Recovery is mechanical:

  1. Re-send Login.
  2. Verify POISerialNumber against your stored value (see hardware swap troubleshooting if it changed).
  3. Retry the failed request with a new ServiceID.

Build this as an automatic path — LoggedOut is normal life, not an incident.

NotAllowed — allowed for whom?

NotAllowed means the operation cannot run in the current state. Three distinct causes, in order of likelihood:

  1. No session open — you never logged in on this connection, or you assumed a session survived a POS restart. Fix: Login first, always, on startup.
  2. Service not configured — the operation (pre-auth, gift card, reconciliation type…) is not enabled for this merchant/terminal. Fix: confirm scope with Market Pay; this is configuration, not code.
  3. Wrong reference — reversals and status queries return NotAllowed with an explanatory AdditionalResponse (e.g. "Transaction not found in database") when the referenced transaction does not exist. Fix: you referenced a SaleTransactionID or a stale ID — use the stored POITransactionID / original ServiceID.

Reading the response

Always log AdditionalResponse alongside ErrorCondition — it usually states the specific cause and turns a mystery into a one-line fix.