Overview
All Daya API requests require authentication using API keys. Each key is tied to a specific merchant and environment (Sandbox or Production)API Keys
Generating Keys
- Sign up at dashboard.daya.xyz
- Navigate to API Keys
- Generate separate keys for Sandbox and Production
Key Types
| Environment | Purpose | Base URL |
|---|---|---|
| Sandbox | Testing with fake funds | https://sandbox-api.daya.xyz |
| Production | Live transactions with real money | https://api.daya.xyz |
Sandbox and Production environments are completely isolated. Data and keys do not cross environments.
Making Authenticated Requests
Include your API key in theAuthorization header using Bearer authentication:
Merchant ID Inference
Yourmerchant_id is automatically determined from your API key. You never send it in requests.
Why?
- Security: Prevents merchants from impersonating each other
- Simplicity: One less parameter to manage
- Isolation: Each key is cryptographically bound to a single merchant
All API responses include your
merchant_id for verification purposes, but you never need to send it.Environment Isolation
- Sandbox
- Production
For: Integration testing, developmentCharacteristics:
- Separate API keys from production
- Simulated NGN deposits
- Testnet USDC/USDT (no real value)
- Same API surface as production
- No KYB required
Security Best Practices
Store keys securely
Store keys securely
- Use environment variables or secret management systems (AWS Secrets Manager, HashiCorp Vault)
- Never hardcode keys in source code
- Never commit keys to Git repositories
.env
Rotate keys regularly
Rotate keys regularly
Rotate API keys every 90 days or immediately if compromised:
- Generate new key in dashboard
- Update your application configuration
- Verify new key works
- Delete old key
Use HTTPS only
Use HTTPS only
All API requests must use HTTPS. The API rejects plain HTTP requests.
Implement rate limiting
Implement rate limiting
Implement client-side rate limiting to avoid hitting API limits:
- 100 requests per minute per key
- 1,000 onramp creations per day (see Limits)
Monitor for suspicious activity
Monitor for suspicious activity
- Log all API calls with timestamps
- Alert on unusual patterns (spikes in failed requests, geographic anomalies)
- Review access logs regularly
Error Responses
401 Unauthorized
Missing or invalid API key:- Missing
Authorizationheader - Malformed header (e.g., missing “Bearer” prefix)
- Invalid or revoked API key
- Using sandbox key with production URL (or vice versa)
403 Forbidden
Merchant account frozen or suspended:- Exceeded onramp creation limit (1,000/day)
- Risk or compliance review triggered
- Manual suspension by operations
If your merchant account is frozen, new onramps, FX conversions, and withdrawals are blocked. Contact support for resolution.