m2pfintech
API Guide

Integration Best Practices

Error handling, idempotency, rate limiting, timeout configuration, and security best practices for DCMS API integration.

Error Handling

  1. Always check the exception field — even on HTTP 200, validate that exception is null
  2. Match on errorCode — use machine-readable codes for branching, not errorMessage (can change)
  3. Retry 5xx errors — use exponential backoff with a maximum of 3 retries
  4. Do not retry 4xx errors — these are deterministic; retrying produces the same result

Idempotency

For critical operations (card issuance, transactions), include a unique requestId or txnId:

PropertyDetail
PurposePrevents duplicate processing on retry
FormatUUID or unique string per request
BehaviorDuplicate requests with the same ID return the same result
ScopeApplied to card issuance, transactions, PIN operations, wallet loads

Rate Limiting

TierRateBurst
Standard100 requests/second200 requests
High Volume500 requests/second1,000 requests
CustomNegotiableBased on traffic profile

Rate limits are configured per tenant during onboarding. When exceeded, the API returns 429 Too Many Requests.


Timeouts

Operation TypeRecommended Timeout
Card Status / Details5 seconds
Transaction Processing10 seconds
CBS Operations15 seconds
Report Generation30 seconds

Security

Critical Security Rules

  • Never log full card numbers, PINs, CVVs, or tokens
  • Rotate JWT tokens — do not cache beyond expiry
  • Use HTTPS only — TLS 1.2 minimum
  • Validate SSL certificates — never disable verification
  • Encrypt sensitive fields per the encryption spec from onboarding
  • IP whitelisting — available for production environments

On this page