Skip to main content

Error Handling

Transact surfaces errors at several layers β€” from client-side field validation through to API response codes and PSP transaction outcomes. This page describes each category and how errors are communicated to agents, integrators and end-customers.


API Error Response Structure​

All Transact API errors return a consistent ApiErrorResponse body:

{
"errorId": "a-3f2a1b4c-5d6e-7f8a-9b0c-1d2e3f4a5b6c",
"httpStatus": 400,
"statusMessage": "Session not found",
"errorType": 0,
"timestamp": "2026-03-20T14:30:00Z",
"path": "/api/cardcapture/session/cc-abc123"
}
FieldTypeDescription
errorIdstringUnique identifier for the error instance. Include this when raising support tickets.
httpStatusintegerThe HTTP status code for the response.
statusMessagestringHuman-readable description of the error.
errorTypeintegerError classification β€” 0 (Validation), 1 (Authentication), 2 (Authorisation), 3 (System).
timestampdate-timeUTC timestamp of when the error occurred.
pathstringThe API endpoint where the error was raised.

Client-Side Validation Errors​

Before any API call is made, the Transact UI validates captured card data on the agent or customer form:

ValidationApplies ToDescription
Luhn checkPANThe card number is validated against the Luhn algorithm. Controlled by ValidateLuhn in the configuration.
Card schemePANPAN length and prefix are checked against allowed card schemes. If allowedCardTypes is provided, only those schemes are accepted.
Expiry date formatExpiryMust be a valid future date in the expected format.
CSC lengthCSCMust match the expected length for the detected card scheme (3 or 4 digits).
Mandatory fieldsAll capture fieldsFields configured as required must be completed before the Submit button becomes active.

Validation errors are shown as visual prompts inline on the capture form. The agent cannot submit the form until all validations pass.


Authentication & Authorisation Errors​

These errors occur during login, token management and role-based access control.

Authentication (401)​

EndpointDescription
LoginCredentials are invalid, account is locked out, or password has expired.
Passwordless LoginCredentials are invalid or the account is locked out.
Service TokenThe service token is missing, invalid, or inactive.
Refresh TokenThe token is missing, expired, or invalid.
All other endpointsThe bearer token is missing, expired, or invalid.

Common causes: Expired JWT, missing Authorization header, revoked refresh token, locked user account.

Authorisation (403)​

EndpointDescription
Login / Passwordless LoginCaller does not have the required role.
Refresh TokenThe refresh token has been revoked.
Reset PasswordThe password reset token has expired.
Card Data RetrievalCaller does not have the cardDataRetrieval role.
All other endpointsCaller does not have the required role for the operation.

User Not Found (404)​

EndpointDescription
Login / Passwordless LoginThe specified user was not found.
App Token from Service TokenThe account or service token was not found.
Reset PasswordThe user was not found or is inactive.

Correlation Errors​

Call correlation links the agent's web session with the customer's phone call. Errors here prevent the capture phase from starting.

CodeEndpointDescription
400Associate AccountRequired fields are missing from the request body.
400Find Call / Search CallsaccountShortGuid not present in the bearer token.
400Manual CorrelationRequired claims or fields are missing.
404Associate AccountThe call was not found in the active call pool.
404Find CallNo call matching the specified criteria was found.
404Search CallsNo calls matching the specified criteria were found.
404Manual CorrelationThe manual correlation session was not found.

Common causes: Call has ended before correlation completed, incorrect dialogId or sipCallId, caller number mismatch, account parameter incorrect.


Card Capture Errors​

Errors during the card capture session lifecycle β€” creating, capturing, retrieving or deleting card data.

Session Management​

CodeEndpointDescription
400Create SessionFailed to create the session.
400Delete SessionFailed to delete the session.
404Create SessionNo matching call found for the provided DialogId or SipCallId.
404Get / Delete SessionNo session exists for the given key.

Capture Initiation​

CodeEndpointDescription
400Initiate PAN CaptureInvalid request β€” bad method, duplicate keys, or invalid DTMF control values.
400Initiate CSC CaptureInvalid request β€” bad method, duplicate keys, or invalid DTMF control values.
400Initiate Expiry Date CaptureInvalid request β€” bad method, duplicate keys, or invalid DTMF control values.
404All initiate endpointsSession not found for the given key.

Data Operations​

CodeEndpointDescription
400Set PAN / CSC / Expiry ValueFailed to set the value.
400Update PAN / CSC / Expiry StatusInvalid capture status value.
400Delete PAN / CSC / ExpiryFailed to delete the data.
400Get Card DataInvalid request or error retrieving card data.
403Get Card DataCaller does not have the cardDataRetrieval role.
404All data endpointsSession or data not found for the given key.

PSP & Transaction Completion Errors​

After card data is captured and submitted, the outcome depends on the PSP response and the configured completion method.

Completion Methods​

Transact supports three completion actions, configured per journey. Multiple can be active simultaneously:

MethodDescription
Completion FormDisplays a result screen to the agent with configurable success, error and cancel views. Each view shows fields (key/value pairs populated from session data) and text (title, message, note).
RedirectNavigates the browser to a configured URL. Separate URLs can be configured for each outcome: redirectOnSuccessUrl, redirectOnCancelUrl, redirectOnErrorUrl. Supports GET or POST verb.
DatapostSends transaction data via HTTP to a configured endpoint. Separate URLs for each outcome: datapostOnSuccessUrl, datapostOnCancelUrl, datapostOnErrorUrl. Supports browser-origin (fromBrowser) or server-origin (fromServer) with form-urlencoded or json content types.

Client-Initiated PSP Transactions​

When the calling application initiates the PSP transaction (using captured card data retrieved via the API):

  • Validation errors β€” Agents see visual prompts for data or formatting errors inline on the capture form.
  • Service errors β€” Subphonic service errors appear via in-app notifications.
  • PSP errors β€” Are proxied back to the calling service in the API response. The calling application is responsible for handling and displaying the PSP outcome.

Subphonic-Initiated PSP Transactions​

When Transact itself initiates the PSP transaction on form submission:

  • Validation errors β€” Same inline visual prompts as above.
  • Service errors β€” Subphonic service errors appear via in-app notifications.
  • PSP errors β€” The PSP response is routed through the configured completion method(s):
    • Completion form β€” The error view is shown with the PSP response mapped into the configured fields.
    • Redirect β€” The browser navigates to redirectOnErrorUrl with the configured error fields.
    • Datapost β€” Transaction data including the error is posted to datapostOnErrorUrl.

PSP Outcome Routing​

PSP OutcomeCompletion Form ViewRedirect URL ParameterDatapost URL Parameter
SuccesscompletionForm.successredirectOnSuccessUrldatapostOnSuccessUrl
ErrorcompletionForm.errorredirectOnErrorUrldatapostOnErrorUrl
CancelcompletionForm.cancelredirectOnCancelUrldatapostOnCancelUrl

If outcome-specific URLs are not configured, Transact falls back to the generic redirectUrl or datapostUrl parameter.


Server Errors (500)​

All API endpoints may return a 500 Internal Server Error when an unexpected server error occurs. The response body follows the standard ApiErrorResponse structure.

When receiving a 500 error:

  1. Note the errorId from the response.
  2. Retry the operation after a brief pause β€” transient errors may resolve.
  3. If the error persists, contact Subphonic Support with the errorId and timestamp.

HTTP Status Code Summary​

CodeMeaningTypical Cause
200SuccessRequest completed successfully.
201CreatedResource created (password reset accepted/completed).
400Bad RequestMissing required fields, invalid values, or failed validation.
401UnauthorisedToken missing, expired, or invalid.
403ForbiddenInsufficient role or revoked token.
404Not FoundResource does not exist β€” user, session, call, or card data.
500Internal Server ErrorUnexpected server-side failure.

Docs AssistantAsk anything about our products