m2pfintech
API LibraryCustomer

Process Account Action State Transition (Checker)

Approves or rejects a pending account action request as the checker step of the maker-checker workflow. The checker must be a different user than the one who created the original request (maker).

State Machine

PENDING  ──(APPROVED)──▶  APPROVED
PENDING  ──(REJECTED)──▶  REJECTED

Any other transition (e.g. trying to approve an already-approved request) returns a 409 invalidStateTransitionError.

Notes

  • id is the unique maker-checker record ID returned in the result.id field of the /v1/accounts/update response.
  • userId must be the checker's user ID and cannot match the maker's sourceUser.
  • reason is an optional free-text array explaining the checker's decision.
POST
/v1/accounts/state-transition

Authorization

bearerAuth tenantId
AuthorizationBearer <token>

JWT Bearer token from the Authentication API

In: header

X-TENANT-ID<token>

Your unique tenant identifier assigned during onboarding

In: header

Header Parameters

X-TENANT-ID*string

Your unique tenant identifier

Request Body

application/json

id*string

Unique identifier of the maker-checker record to transition. Returned as result.id in the /v1/accounts/update response.

toStatus*string

Target status. Must be APPROVED or REJECTED.

Value in"APPROVED" | "REJECTED"
userId*string

User ID of the checker. Cannot be the same as the maker's sourceUser.

stateCode?string

Optional state code for the transition.

stateDescription?string

Optional description of the state transition decision.

reason?array<string>

Optional list of reasons for the approval or rejection.

Response Body

application/json

application/json

application/json

curl -X POST "https://sandbox-api.m2pprepaid.com/prepaid/customer/v1/accounts/state-transition" \  -H "X-TENANT-ID: ACME_CORP" \  -H "Content-Type: application/json" \  -d '{    "id": "6612f0a1b2c3d4e5f6a7b8c9",    "toStatus": "APPROVED",    "userId": "CHECKER001",    "stateCode": "ST001",    "stateDescription": "Verified all documents",    "reason": [      "Customer documents verified",      "Complies with closure policy"    ]  }'
{
  "result": {
    "id": "6612f0a1b2c3d4e5f6a7b8c9",
    "customerEntityId": "750244137320000234050825",
    "accountEntityId": "750244137320000234050825-ACC01",
    "actionType": "CLOSURE",
    "status": "APPROVED",
    "message": "Account action request approved successfully"
  },
  "pagination": null
}
{
  "type": "https://www.m2pfintech.com/problem/problem-with-message",
  "title": "Bad Request",
  "status": 400,
  "detail": "Unable to convert http message",
  "message": "error.http.400"
}

{
  "type": "https://www.m2pfintech.com/problem/problem-with-message",
  "title": "Record not found",
  "status": 409,
  "detail": "No account action record found for id: 6612f0a1b2c3d4e5f6a7b8c9",
  "message": "error.business",
  "businessCode": "PPCUST_010"
}