Quickstart
This guide walks you through integrating Open Pay into your application. By the end, you will be able to create checkout sessions and handle payment webhooks.You need a verified merchant account to get API keys. The verification process typically takes under 24 hours.
Create a Merchant Account
Sign up at the Merchant Portal with your email and password. You will receive a confirmation email to verify your address.
Complete KYC Verification
After signing in, navigate to Settings > KYC Verification and submit the required documents:
- Business registration certificate
- National ID or passport of the business owner
- Bank account details for fiat settlement (LKR)
Get Your API Keys
Once verified, go to the Integrations page in the Merchant Portal:Click Generate API Key to create a new key pair. You will receive:
| Credential | Description |
|---|---|
| API Key | Public identifier sent in the X-API-Key header |
| API Secret | Used to compute HMAC-SHA256 signatures (never expose this client-side) |
Install the SDK
Install the Open Pay SDK for your language of choice.Initialize the client with your credentials:
The SDK handles HMAC-SHA256 request signing automatically. You do not need to compute signatures manually.
Create a Checkout Session
A checkout session generates a hosted payment page where your customer can pay with crypto.The response includes:
| Field | Description |
|---|---|
id | Unique session identifier (e.g., cs_abc123) |
checkoutUrl | URL to redirect your customer to |
paymentId | Associated payment record ID |
expiresAt | Session expiry timestamp (default: 30 minutes) |
status | Session status: pending, completed, expired |
Handle the Webhook Callback
When a payment is confirmed on-chain, Open Pay sends a webhook to your configured endpoint. Webhooks are signed with ED25519 for authenticity.First, configure your webhook URL in the Merchant Portal under Integrations > Webhooks, or via the API:Then, set up a handler to verify and process incoming webhooks:
Always return a
200 status within 10 seconds. If your endpoint fails or times out, Open Pay retries with exponential backoff (up to 5 attempts over 24 hours).Next Steps
Authentication
Understand JWT, HMAC, and ED25519 auth mechanisms in depth
Payment Flow
Full lifecycle of a payment from creation to settlement
Webhooks Guide
Advanced webhook configuration, retry policies, and event types
API Reference
Explore all 80+ API endpoints with examples