Introduction
Getting started
Overview
This guide will help you get started with integrating to the Open Finance Malaysia (OFM) platform to test your use cases as a Data Consumer.
Registration Process for Sandbox
Step 1: Register Your Organization
- Contact PayNet through the Contact Us page to initiate the registration process
- Provide your organization details.
- Optionally, provide technical details (your
jwks_uriandredirect_uri). Initially, PayNet can provide test resources for these and you may modify these later.
Step 2: Obtain test certificates or create your own certificates
To make your onboarding easier, PayNet can provide you with a starter pack of digital certificates for testing purposes and a hosted JWKS that hosts your public keys.
Alternatively, you can follow the instructions provides in Creating your digital certificates to generate your own signing and encryption certificates and host the public keys on your own JWKS.
You will need the following certificates:
- Transport Certificate: For mutual TLS authentication
- Signing Certificate: For JWS request signing
- Encryption Certificate: For receiving JWE encrypted responses
Certificate Requirements:
- RSA key with minimum 2048-bit length
- Valid for at least 12 months
- In the Sandbox environment, self-signed certificates are acceptable
Step 3: Configure Your Application
Data Consumer Configuration:
- client_id: You will receive a unique client_id from PayNet. This is your technical identifier used in OIDC flows.
- dc_id: You will receive a unique dc_id from PayNet. This is your legal identifier and used to identify you to other ecosystem participants.
- Redirect URIs: You may register your OAuth redirect URIs or use pre-configured ones provided by PayNet
- Webhook URL: Optionally, register your webhook endpoint for consent events
Step 4: Implement API Integration
For Data Consumers:
Discovery: Retrieve PayNet's OpenID Connect configuration from its well-known endpoint
Implement OAuth Flows:
- Authorization Code Grant for user consent
- Client Credentials Grant for consent management
- Refresh Token Grant for token refresh
Implement Webhook Endpoint:
- Handle POST /consents/events
- Validate JWS signatures
- Return 200 OK acknowledgment
Implement Data Retrieval:
- Call resource server APIs with access tokens
- Verify and decrypt JWE responses
- Handle errors and retries
Security Setup
Mutual TLS Configuration
- Install Certificates: Install your transport certificate and private key
- Configure TLS: Configure your HTTP client for mutual TLS
- Certificate Validation: Implement certificate chain validation
- Certificate Monitoring: Monitor certificate expiration dates
JWS Signing Setup
- Load Signing Key: Load your signing certificate and private key
- Implement Signing: Sign requests/responses per specification
- Key ID (kid): Use certificate thumbprint as key ID
- Verify Signatures: Verify incoming JWS signatures
JWE Encryption Setup (Data Consumers)
- Load Encryption Key: Load your encryption certificate and private key
- Publish Public Key: Ensure public key is available for Data Providers
- Decrypt Responses: Implement JWE decryption for responses
- Key Rotation: Plan for encryption key rotation
Testing in Sandbox
Before going to production, test your integration in the Sandbox environment:
Sandbox Environment Details
URLs for the Sandbox environment will be made available on registration.
Sandbox Features
- Test Data Providers with sample data
- Test user accounts and credentials
- Relaxed certificate requirements (self-signed allowed)
- Extended token lifetimes for testing
- Detailed error messages and logging
Test Scenarios
- Happy Path: Complete consent creation and data retrieval
- Error Handling: Test various error scenarios
- Token Expiry: Test token refresh flow
- Consent Revocation: Test consent lifecycle management
- Webhook Events: Test webhook event handling
- Security: Test certificate validation and signature verification
For detailed sandbox instructions, see Sandbox Guide.
API Endpoints Overview
Authorization Server APIs
- GET /.well-known/openid-configuration - OpenID Connect discovery
- GET /jwks - JSON Web Key Set
- POST /par - Pushed Authorization Request
- GET /authorize - Authorization endpoint
- POST /token - Token endpoint
- POST /introspect - Token introspection
- POST /revoke - Token revocation
- GET /userinfo - User information
Resource Server APIs
- GET /providers - List Data Providers
- GET /consents/{consentId} - Retrieve consent
- POST /consents/{consentId}/revoke - Revoke consent
- POST /consents/{consentId}/suspend - Suspend consent
- POST /consents/{consentId}/reactivate - Reactivate consent
- GET /accounts/{accountId} - Get account
- GET /accounts/{accountId}/balances - Get balances
- GET /accounts/{accountId}/transactions - Get transactions
For detailed API documentation, see DC API Developers Guide.
Integration Flows
1. Authorization Code Grant Flow
Used for creating user consents:
- Send Pushed Authorization Request (PAR)
- Redirect user to authorization endpoint
- User authenticates and grants consent
- Exchange authorization code for tokens
- Access user data with access token
2. Refresh Token Flow
Used for obtaining new access tokens:
- Detect expired access token
- Send token request with refresh_token grant
- Receive new access token
- Continue accessing data
3. Consent Revocation Flow
Used for revoking consents:
- Obtain client credentials grant access token
- Send revocation request
- Receive confirmation
- PayNet notifies Data Provider
Security Best Practices
Certificate Management:
- Store private keys in HSM or secure vault
- Rotate certificates before expiry
- Monitor certificate validity
Token Security:
- Store tokens encrypted at rest
- Never log tokens in plain text
- Implement token refresh logic
- Revoke tokens on logout
Request/Response Security:
- Always verify JWS signatures
- Validate certificate chains
- Check timestamp claims
- Use unique request IDs
Error Handling:
- Don't expose sensitive information in errors
- Log security events
- Implement rate limiting
- Handle failures gracefully
API Rate Limits
PayNet OFP may rate limit requests from Data Consumers to ensure fair usage.
Request Correlation
Use x-fapi-interaction-id header for request correlation:
- Generate unique ID for each request
- Include in all related API calls
- Use for troubleshooting and support
If you require support on a particular request, include the x-fapi-interaction-id in your support request.
Support and Resources
To contact support, please see the Contact Us page.
- Previous
- Introduction
- Next
- DC Sandbox