Authentication
All API requests to TxnCheck must be authenticated using an API key. This page explains how to obtain and use your API keys, and optionally how to sign requests for enhanced security.Obtaining API Keys
API keys are provided by the TxnCheck team during merchant onboarding. Self-registration is not available.
- Contact your TxnCheck account manager
- Or visit TxnCheck Dashboard
API Key Authentication
Include your API key in theX-API-Key header with every request:
Request Signing (Optional)
For enhanced security, you can sign your requests using HMAC-SHA256. When enabled for your merchant account, signed requests are required.Signature Headers
| Header | Description |
|---|---|
X-API-Key | Your API key (always required) |
X-Timestamp | Current Unix timestamp in milliseconds |
X-Signature | HMAC-SHA256 signature of the request |
Signature Algorithm
The signature is computed as:timestamp- The value ofX-TimestampheaderMETHOD- HTTP method in uppercase (e.g.,POST)path- Full request path including query string (e.g.,/api/v1/upi-by-mobile)body- JSON stringified request body (or{}if empty)api_secret- Your API secret key
Signing Examples
Timestamp Validation
Method Access Control
Your API key may be configured with access to specific verification methods. If you attempt to use a method not enabled for your account, you’ll receive a403 Forbidden error.
Contact your account manager to request access to additional methods.
IP Whitelisting
For enhanced security, you can configure IP whitelisting for your merchant account. When enabled, API requests will only be accepted from your whitelisted IP addresses.IP whitelisting is configured in the Merchant Dashboard under Settings → Security.
Error Responses
Authentication errors return standard HTTP status codes:| Status Code | Description |
|---|---|
401 Unauthorized | Missing or invalid API key |
401 Unauthorized | Invalid or expired signature |
403 Forbidden | API key lacks access to requested method |
403 Forbidden | Request from non-whitelisted IP |
Example Error Response
Best Practices
Use Environment Variables
Store API keys in environment variables, never in code
Enable Request Signing
Use HMAC signatures for production integrations
Use IP Whitelisting
Restrict API access to known IP addresses
Monitor API Usage
Track usage in the dashboard for anomalies
