Skip to content

Error Codes

Complete reference of error codes returned by EasySlip API.

Match on error.code, not the message

For v2, error.code (e.g. SLIP_NOT_FOUND) is the stable contract — match your logic on it. The error.message is a human-readable string that may change without notice. The Description column below explains each code; it is not the literal error.message the API returns. (For v1, the message field carries the code string itself.)

API v2 Error Codes

Authentication Errors (401)

CodeDescriptionCauseSolution
MISSING_API_KEYAuthorization header is requiredNo Authorization headerAdd Authorization: Bearer YOUR_API_KEY header
INVALID_API_KEYThe provided API key is invalidAPI key doesn't exist or is malformedCheck API key is correct

Authorization Errors (403)

CodeDescriptionCauseSolution
BRANCH_INACTIVEThis API branch has been deactivatedBranch was deactivatedReactivate in developer portal
SERVICE_BANNEDService has been bannedViolation of termsContact support
SERVICE_EXPIREDService has expiredSubscription/plan expiredRenew your plan
IP_NOT_ALLOWEDYour IP address is not in the allowed listIP whitelist restrictionAdd IP to whitelist
QUOTA_EXCEEDEDYour API quota has been exceededMonthly quota reachedUpgrade plan or wait for reset
USER_BANNEDUser has been bannedUser account violation of termsContact support

Validation Errors (400)

CodeDescriptionCauseSolution
VALIDATION_ERRORValidation failedInvalid request bodyCheck request format
URL_PROTOCOL_NOT_ALLOWEDOnly HTTP/HTTPS allowedNon-HTTP URLUse HTTP or HTTPS URL
URL_INVALID_IP_RANGEURL points to restricted IPPrivate/internal IPUse public URL
IMAGE_URL_UNREACHABLEUnable to access URLURL not accessibleCheck URL is public
IMAGE_SIZE_TOO_LARGEImage exceeds 4MB limitFile too largeCompress image
INVALID_IMAGE_FORMATFile is not a valid imageCorrupt or wrong formatUse JPEG, PNG, GIF, WebP
INVALID_BANK_CODEThe provided bankCode is not supportedbankCode not in bank listUse a code from GET /banks
INVALID_EXTRA_VERIFYextraVerify is not valid for this bankValue supplied is not in the bank's option listUse one of the bank's extraVerify values from GET /banks
INVALID_EXTRA_VERIFYextraVerify is required for this bankBank requires an option but none was supplied (e.g. on a bankCode change)Supply a valid extraVerify value from GET /banks

Not Found Errors (404)

CodeDescriptionCauseSolution
SLIP_NOT_FOUNDSlip not found or invalidInvalid slip or no QRCheck slip validity
SLIP_PENDINGBangkok Bank slip is pendingSlip transferred within 5 minutesWait a few minutes and retry
BANK_ACCOUNT_NOT_FOUNDBank account not foundAccount doesn't exist or isn't linked to your branchCheck the account id and branch link
NOT_FOUNDResource not foundWrong endpointCheck endpoint URL

Conflict Errors (409)

CodeDescriptionCauseSolution
BANK_ACCOUNT_DUPLICATEAn active account with the same bank code and number already existsDuplicate bankCode + bankNumber in your serviceReuse the existing account or use different details

Rate Limit Errors (429)

CodeDescriptionCauseSolution
RATE_LIMIT_EXCEEDEDToo many requestsVerify request rate exceededWait for the Retry-After seconds, then retry — see Rate Limits

Server Errors (500)

CodeDescriptionCauseSolution
API_SERVER_ERRORService temporarily unavailableTemporary processing errorRetry later
INTERNAL_SERVER_ERRORInternal server errorUnexpected errorContact support

API v1 Error Codes

Authentication Errors (401)

CodeDescriptionCauseSolution
unauthorizedUnauthorizedInvalid or missing API keyCheck Authorization header

Authorization Errors (403)

CodeDescriptionCauseSolution
access_deniedAccess deniedIP not whitelistedAdd IP to whitelist
application_expiredApplication expiredSubscription expiredRenew subscription
application_deactivatedApplication deactivatedApp was deactivatedReactivate in portal
quota_exceededQuota exceededMonthly quota reachedUpgrade plan

Validation Errors (400)

CodeDescriptionCauseSolution
invalid_payloadInvalid payloadMalformed QR payloadCheck payload format
invalid_check_duplicateInvalid checkDuplicateWrong boolean formatUse true or false
invalid_urlInvalid URLMalformed or unsafe URLCheck URL format
invalid_imageInvalid imageNot a valid imageUse supported format
image_size_too_largeImage too largeExceeds 4MBCompress image
invalid_requestInvalid requestSchema validation failedCheck request body
duplicate_slipDuplicate slipAlready verifiedCheck data for details

Not Found Errors (404)

CodeDescriptionCauseSolution
slip_not_foundSlip not foundInvalid or fake slipVerify slip authenticity
slip_pendingBangkok Bank slip is pendingSlip transferred within 5 minutesWait a few minutes and retry
qrcode_not_foundQR code not foundNo QR in imageUse clearer image
not_foundNot foundWrong endpointCheck URL

Rate Limit Errors (429)

CodeDescriptionCauseSolution
rate_limit_exceededToo many requestsVerify request rate exceededWait for the Retry-After seconds, then retry — see Rate Limits

Server Errors (500)

CodeDescriptionCauseSolution
server_errorServer errorInternal errorRetry later
api_server_errorService temporarily unavailableTemporary processing errorRetry later

Error Response Format

API v2

json
{
  "success": false,
  "error": {
    "code": "SLIP_NOT_FOUND",
    "message": "The slip could not be found or is invalid"
  }
}

VALIDATION_ERROR messages

For VALIDATION_ERROR, the message names which field failed and why, e.g. "bankNumber: Too small: expected string to have >=1 characters". When more than one field fails, the failures are joined into one message with ; . The code is always VALIDATION_ERROR (there is no separate details field — match on code, show message to the user).

API v1

json
{
  "status": 404,
  "message": "slip_not_found"
}

Duplicate Slip (v1)

Returns slip data along with error:

json
{
  "status": 400,
  "message": "duplicate_slip",
  "data": {
    "payload": "...",
    "transRef": "...",
    "amount": { ... }
  }
}

Error Handling Best Practices

1. Check Success/Status First

javascript
// v2
if (!result.success) {
  console.error(`Error [${result.error.code}]: ${result.error.message}`);
}

// v1
if (result.status !== 200) {
  console.error(`Error: ${result.message}`);
}

2. Handle Specific Errors

javascript
switch (result.error.code) {
  case 'QUOTA_EXCEEDED':
    // Alert user or pause operations
    break;
  case 'SLIP_NOT_FOUND':
    // Ask user to try again
    break;
  case 'API_SERVER_ERROR':
    // Retry with exponential backoff
    break;
}

3. Implement Retry Logic

javascript
async function verifyWithRetry(payload, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    const result = await verify(payload);

    if (result.success) return result;

    if (result.error.code === 'API_SERVER_ERROR') {
      await sleep(1000 * (i + 1)); // Exponential backoff
      continue;
    }

    throw new Error(result.error.message);
  }
}

4. Log Errors for Debugging

javascript
if (!result.success) {
  console.error({
    timestamp: new Date().toISOString(),
    errorCode: result.error.code,
    errorMessage: result.error.message,
    payload: payload.substring(0, 20) + '...'
  });
}

Bank Slip Verification API for Thai Banking