m2pfintech
API Guide

Authentication & Authorization

Tenant headers, JWT-based authentication, request encryption, and role-based access control (RBAC) for DCMS APIs.

Tenant Header

Every API request must include the TENANT header — a unique identifier assigned during onboarding.

TENANT: BANK_TENANT_ID

The tenant header determines:

  • Which bank's data the request operates on
  • Which product configuration applies
  • Which CBS connector to use
  • Which notification channels are active

Required on Every Request

Requests without a valid TENANT header will return 400 Bad Request with error code tenant.header.missing.


JWT Authentication

DCMS uses JWT (JSON Web Token) based authentication.

Obtain Token

Request
POST /api/authenticate
Content-Type: application/json
Request Body
{
  "username": "api_user",
  "password": "encrypted_password"
}
Response
{
  "id_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Use Token in Requests

Include the token in the Authorization header along with the TENANT header:

Authenticated Request
POST /card/activate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
TENANT: BANK_TENANT_ID
Content-Type: application/json
PropertyDetail
TypeJWT (JSON Web Token)
ExpiryConfigurable — typically 1 hour
RefreshRe-authenticate to obtain a new token
ScopeToken scoped to the authenticated user's role and permissions

Request Encryption

For sensitive operations (PIN, card data), the gateway supports encrypted request bodies:

PropertyDetail
AlgorithmECDH key exchange + AES-256
Key ExchangeEncryption keys exchanged during onboarding
DecryptionHandled automatically at the gateway
Sensitive ResponsesFields like card number and CVV encrypted in response

Security Requirement

PIN values must never be sent in clear text. Always use the encrypted PIN block format (HSM-compatible) provided during onboarding.


Role-Based Access Control (RBAC)

RoleAccess Level
AdminFull access — all APIs including configuration and user management
OperationsCard lifecycle, customer management, reporting
Read-OnlyView-only — card details, transaction history, reports
API IntegrationProgrammatic access for system-to-system integration

On this page