Skip to content

Error Codes

Complete reference of error codes returned by EasySlip API.

API v2 Error Codes

Authentication Errors (401)

CodeMessageCauseSolution
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)

CodeMessageCauseSolution
BRANCH_INACTIVEThis API branch has been deactivatedBranch was deactivatedReactivate in developer portal
SERVICE_BANNEDService has been bannedViolation of termsContact support
SERVICE_DELETEDService has been deletedService was deletedCreate new application
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

Validation Errors (400)

CodeMessageCauseSolution
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_TYPEURL is not a valid imageWrong content typeUse valid image URL
INVALID_IMAGE_FORMATFile is not a valid imageCorrupt or wrong formatUse JPEG, PNG, GIF, WebP

Not Found Errors (404)

CodeMessageCauseSolution
SLIP_NOT_FOUNDSlip not found or invalidInvalid slip or no QRCheck slip validity
NOT_FOUNDResource not foundWrong endpointCheck endpoint URL

Server Errors (500)

CodeMessageCauseSolution
API_SERVER_ERRORExternal API errorBackend service issueRetry later
INTERNAL_SERVER_ERRORInternal server errorUnexpected errorContact support

API v1 Error Codes

Authentication Errors (401)

CodeMessageCauseSolution
unauthorizedUnauthorizedInvalid or missing API keyCheck Authorization header

Authorization Errors (403)

CodeMessageCauseSolution
access_deniedAccess deniedIP not whitelistedAdd IP to whitelist
account_not_verifiedAccount not verifiedKYC not completedComplete KYC verification
application_expiredApplication expiredSubscription expiredRenew subscription
application_deactivatedApplication deactivatedApp was deactivatedReactivate in portal
quota_exceededQuota exceededMonthly quota reachedUpgrade plan

Validation Errors (400)

CodeMessageCauseSolution
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)

CodeMessageCauseSolution
slip_not_foundSlip not foundInvalid or fake slipVerify slip authenticity
qrcode_not_foundQR code not foundNo QR in imageUse clearer image
not_foundNot foundWrong endpointCheck URL

Server Errors (500)

CodeMessageCauseSolution
server_errorServer errorInternal errorRetry later
api_server_errorAPI server errorBackend 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"
  }
}

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