m2pfintech
API LibraryAuthentication

Authenticate and obtain JWT token

Obtain a JWT access token for API access. This is the entry point for all API interactions. The token must be included in the Authorization header of all subsequent API calls as a Bearer token.

Rate limited to 10 requests per minute per IP address. This endpoint does not require prior authentication.

POST
/auth/login

Request Body

application/json

username*string

API username provided by M2P during onboarding

password*string

API password provided by M2P during onboarding

Formatpassword

Response Body

application/json

application/json

application/json

curl -X POST "https://api.m2p.com/auth/login" \  -H "Content-Type: application/json" \  -d '{    "username": "acme_api_user",    "password": "s3cur3P@ssw0rd"  }'
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "604d5f1e8a2b3c001f8e4567",
    "username": "acme_api_user",
    "entityId": "ACMEBANK",
    "role": "ISSUER_API"
  }
}

{
  "error": "Invalid credentials",
  "code": "AUTH_001"
}

{
  "error": "Rate limit exceeded",
  "code": "AUTH_008"
}