Error Handling

Every TAPP Cash error response uses a consistent envelope. Parse the errors array to get actionable details.


Error Response Format

{
  "errors": [
    {
      "code": "ERROR_CODE",
      "title": "Human-readable summary",
      "details": "Additional context",
      "target": "field | common",
      "source": "fieldName"
    }
  ]
}
FieldDescription
codeMachine-readable error code — use this for programmatic handling
titleShort human-readable summary
detailsAdditional context about the failure
target"field" for field-level errors, "common" for general errors
sourceThe field name that caused the error (when target is "field")

HTTP Status Codes

CodeMeaningWhat to do
400Bad request — validation or business rule failureCheck the errors array for field-level details and fix the request
401Unauthorized — missing or expired tokenRefresh with POST /auth/refresh; re-login if refresh token is also expired
403Forbidden — valid token but wrong role or endpointVerify you are using the correct token type for the endpoint
404Resource not foundCheck the ID or path in your request
409Conflict — resource state prevents the operatione.g., pending transactions block account closure
422Unprocessable — business logic rejectionInspect the code field for the specific reason
429Too many requests — rate limit exceededBack off and retry with exponential backoff
500Internal server errorRetry with exponential backoff; contact support if it persists

Common Errors

401 Unauthorized

{ "errors": [{ "code": "UNAUTHORIZED", "title": "Token expired or missing" }] }

Cause: Access token expired (30-minute lifetime) or not included in the request.
Fix: Call POST /users/public/v1/auth/refresh with your refreshToken to get a new accessToken.


403 Forbidden

{ "errors": [{ "code": "FORBIDDEN", "title": "Insufficient permissions" }] }

Cause: Using an individual token on an advisor endpoint, or a temporary token on a full-access endpoint.
Fix: Check the token type. Account manager endpoints require an advisor token; individual endpoints require an individual token.


409 Conflict — Pending Transactions Block Closure

{ "errors": [{ "code": "PENDING_TRANSACTIONS", "title": "Cannot close account with pending transactions" }] }

Fix: Wait for all transactions to complete before retrying account closure.


422 Unprocessable

{ "errors": [{ "code": "INVITE_TOKEN_EXPIRED", "title": "Invitation token has expired" }] }

Fix: The account manager must send a new invitation. The original invite link is no longer valid.


Retry Strategy

For 500 and 429 errors use exponential backoff:

AttemptWait before retry
1st retry1 second
2nd retry2 seconds
3rd retry4 seconds
4th retry8 seconds

Do not retry 400, 401, 403, 404, or 422 — these require a code or request fix, not a retry.