ONDC Integration Flow Diagram
The following flow diagram illustrates the complete integration process for ONDC BAP APIs. This shows how data flows between your application, the relay server, and the ONDC network including encryption, decryption, and API communication patterns.
ONDC Integration Flow
This diagram shows the complete request-response cycle from your application through the relay server to the ONDC BAP APIs, including data encryption and decryption processes.
Flow Process Explanation:
- Client Request: Your application sends a request to your relay server with the required data and parameters.
- Authentication: The relay server adds the X-API-KEY header for authentication.
- API Call: The relay server forwards the request to the appropriate ONDC BAP API endpoint.
- Encrypted Response: The ONDC API returns an encrypted response with data and initialization vector (IV).
- Response Forwarding: The relay server passes the encrypted response back to your application.
- Decryption: Your application decrypts the response data using the provided IV and your encryption key.
Key Integration Components:
- Relay Server: Handles authentication and forwards requests to ONDC APIs
- API Authentication: X-API-KEY header required for all requests
- Data Encryption: AES-256-CBC encryption for secure data transmission
- Error Handling: Proper error responses and status codes for debugging
- Response Processing: Encrypted data decryption and JSON parsing
Implementation Notes:
- Ensure your relay server is properly configured with the correct base URLs for different environments (staging/production).
- Store your API keys and encryption keys securely - never expose them in client-side code.
- Implement proper error handling for network failures, authentication errors, and decryption issues.
- Consider implementing request/response logging for debugging and monitoring purposes.
- Test the complete flow in staging environment before deploying to production.
Integration Support
For assistance with ONDC integration or questions about the flow diagram, please contact support at help@meribachat.in