m2pfintech
API Guide

Response Format

Standard response envelope, error format, pagination, and HTTP status codes for all DCMS APIs.

All DCMS APIs return a consistent response envelope.


Success Response

Success Response
{
  "result": {
    // Response data specific to the API
  },
  "exception": null,
  "pagination": {
    "pageNo": 1,
    "pageSize": 20,
    "totalRecords": 150,
    "totalPages": 8
  }
}

Error Response

Error Response
{
  "result": null,
  "exception": {
    "errorCode": "card.blocked",
    "errorMessage": "Card is blocked and cannot perform this operation",
    "httpStatus": "400 BAD_REQUEST"
  },
  "pagination": null
}

Response Fields

FieldTypeDescription
resultObject | nullResponse data on success; null on error
exceptionObject | nullError details on failure; null on success
exception.errorCodeStringMachine-readable error code
exception.errorMessageStringHuman-readable description
exception.httpStatusStringHTTP status code and reason
paginationObject | nullPresent for paginated list APIs
pagination.pageNoNumberCurrent page number
pagination.pageSizeNumberResults per page
pagination.totalRecordsNumberTotal matching records
pagination.totalPagesNumberTotal pages available

Always Check the Exception Field

Even on HTTP 200, validate that exception is null. Some business errors may return 200 with an error payload.


HTTP Status Codes

CodeMeaningAction
200SuccessProcess the result field
400Bad RequestValidation failure or business rule violation — do not retry
401UnauthorizedMissing or invalid JWT token — re-authenticate
403ForbiddenInsufficient permissions — check RBAC role
404Not FoundResource does not exist
429Too Many RequestsRate limit exceeded — back off and retry
500Internal Server ErrorUnexpected failure — retry with exponential backoff

On this page