Skip to content

Errors

Peer REST returns a consistent JSON error object. Clients should branch on HTTP status and error.code.

Error envelope

{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Invalid request body",
    "details": []
  }
}
  • code — stable machine-readable string
  • message — human-readable summary (safe to log; may omit sensitive payload)
  • details — optional validation issues (e.g. Zod field errors)

Status meanings

StatusMeaning
400Request body or query failed validation
401Missing API key when required
403Invalid API key
404Resource not found
503Dependency or admin auth unavailable
5xxPeer / ledger failure — retry with backoff

Common codes

CodeTypical use
UNAUTHORIZEDMissing X-Api-Key
FORBIDDENWrong X-Api-Key
INVALID_REQUESTSchema / query validation failure
UNKNOWN_CHAINCODEPeer configured for an unrecognized chaincode mapping
ISSUE_FAILED / TRANSFER_FAILED / REDEEM_FAILEDToken submit failures
QUOTE_FAILED / BALANCE_FAILED / HISTORY_FAILED / STATS_FAILEDToken evaluate failures
ADMIN_AUTH_UNAVAILABLEAdmin route without configured admin key

Was this page clear?