Endpoints
Get Scenario Codes
Retrieves a list of supported scenario codes for direct debit contracts. Use these IDs when creating a contract. Scenarios define the type of service and transaction limits.Authentication
Requires HMAC authentication with headers:x-api-key: Your API key ID only (e.g.,ak_live_xxx)x-timestamp: Current Unix timestamp in millisecondsx-signature: HMAC-SHA256 signature (using derived signing key)
Query Parameters
Example Request
Example Response
Error Responses
Create Contract
Creates a pre-authorization contract that users can sign to enable on-demand payments. Supports multiple payment providers (currently: BINANCE_PAY). Returns QR code and deep link for user approval.Authentication
Requires HMAC authentication with headers:x-api-key: Your API key ID only (e.g.,ak_live_xxx)x-timestamp: Current Unix timestamp in millisecondsx-signature: HMAC-SHA256 signature (using derived signing key)
Request Body
Example Request (USDT Contract)
Example Request (LKR Contract with Slippage)
Example Response (USDT Contract)
Example Response (LKR Contract)
singleUpperLimitshows the USDT amount sent to Binance (after currency conversion + slippage buffer)singleUpperLimitLkrshows the original LKR amount specifiedslippageBpsshows the slippage buffer applied (10000 bps = 100%)- In this example: 33000 LKR ÷ 330 (exchange rate) = 100 USDT, with 100% slippage = 200 USDT total limit
Error Responses
List Contracts
Retrieves a paginated list of contracts for the authenticated merchant. Supports filtering by status, branch, currency, payment provider, and search.Authentication
Requires HMAC authentication with headers:x-api-key: Your API key ID only (e.g.,ak_live_xxx)x-timestamp: Current Unix timestamp in millisecondsx-signature: HMAC-SHA256 signature (using derived signing key)
Query Parameters
Example Request
Example Response
Error Responses
Get Contract Details
Retrieves contract details by ID. Only returns contracts belonging to the authenticated merchant.Authentication
Requires HMAC authentication with headers:x-api-key: Your API key ID only (e.g.,ak_live_xxx)x-timestamp: Current Unix timestamp in millisecondsx-signature: HMAC-SHA256 signature (using derived signing key)
Path Parameters
Example Request
Example Response
Error Responses
Query/Sync Contract Status
Queries the payment provider for the latest contract status and syncs it to the database. Use this to check if a user has signed the contract.Authentication
Requires HMAC authentication with headers:x-api-key: Your API key ID only (e.g.,ak_live_xxx)x-timestamp: Current Unix timestamp in millisecondsx-signature: HMAC-SHA256 signature (using derived signing key)
Path Parameters
Request Body
Empty object{}
Example Request
Example Response
Error Responses
Terminate Contract
Terminates a signed Direct Debit contract. Only contracts inSIGNED status can be terminated.
Authentication
Requires HMAC authentication with headers:x-api-key: Your API key ID only (e.g.,ak_live_xxx)x-timestamp: Current Unix timestamp in millisecondsx-signature: HMAC-SHA256 signature (using derived signing key)
Path Parameters
Request Body
Example Request
Example Response
Error Responses
Execute Payment
Executes an on-demand payment against a signed Direct Debit contract. Amount must not exceed the contract’s single upper limit.Authentication
Requires HMAC authentication with headers:x-api-key: Your API key ID only (e.g.,ak_live_xxx)x-timestamp: Current Unix timestamp in millisecondsx-signature: HMAC-SHA256 signature (using derived signing key)
Path Parameters
Request Body
Goods Item Structure
Customer Billing Structure
Example Request (USDT Payment)
Example Request (LKR Payment)
Example Response
Response Notes
- Direct debit payments do not include
qrContentorcheckoutLinkfields as the payment is charged directly without user interaction - Payment starts in
INITIATEDstatus and transitions toPAIDvia webhook notification - In sandbox mode, payments are automatically marked as
PAID
Error Responses
Currency & Slippage
Currency Support
Direct Debit contracts support two currencies:Cross-Currency Payments
You can execute payments in either USDT or LKR regardless of the contract’s currency:- USDT contract → Can accept both USDT and LKR payments
- LKR contract → Can accept both LKR and USDT payments
Slippage Protection for LKR Contracts
When creating an LKR contract, exchange rates may fluctuate between contract creation and payment execution. Slippage protection adds a buffer to handle these fluctuations. Example:- 0 bps = 0% (no buffer)
- 5000 bps = 50%
- 10000 bps = 100%
- 20000 bps = 200% (maximum)
- Slippage only applies to LKR contracts
- USDT contracts do not use slippage (rejected if provided)
- Slippage defaults to 0 if not specified for LKR contracts
- Maximum allowed slippage is 20000 bps (200%)
Payment Validation
When executing a payment:- Currency conversion: Payment amount is converted to USDT using current exchange rate
- Limit validation: Converted USDT amount must not exceed contract’s
singleUpperLimit(which includes slippage buffer for LKR contracts) - Error handling: If payment exceeds limit, request is rejected with clear error message showing the conversion
Contract Status Reference
Direct Debit contracts have the following lifecycle statuses:Webhooks
SetwebhookUrl in your contract creation request to receive real-time contract and payment status updates.
See Webhooks Guide for payload format, signature verification, and retry policy.
Error Responses
See Error Codes for detailed error handling.
Related Documentation
- Quick Start - Getting started guide
- Authentication - HMAC signature details
- Webhooks - Receive payment notifications
- Rate Limits - API rate limiting
- Errors - Error codes reference