Overview
All protected Daya Onramp 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.co
- Navigate to API Keys
- Generate separate keys for Sandbox and Production
Key Format
| Environment | Prefix | Example |
|---|---|---|
| Sandbox | sk_sandbox_ | sk_sandbox_abc123... |
| Production | sk_live_ | sk_live_xyz789... |
Environments
| Environment | Purpose | Base URL |
|---|---|---|
| Sandbox | Testing with fake funds | https://api.sandbox.daya.co |
| Production | Live transactions with real money | https://api.daya.co |
Sandbox and Production environments are completely isolated. Data and keys do not cross environments.
Making Authenticated Requests
Include your API key in theX-Api-Key header on every protected request:
Idempotent Write Requests
Endpoints that create resources, such asPOST /v1/onramp and POST /v1/merchant/withdrawals, also require an X-Idempotency-Key header. Use a new value for each new write attempt, and reuse the same value only when retrying the exact same request.
cURL
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
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)
Error Responses
401 Unauthorized
Missing or invalid API key:- Missing
X-Api-Keyheader - Empty or malformed API key value
- 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.
Webhook Authentication
Webhooks use HMAC-SHA256 signatures, not API keys. See Webhook Verification.Testing Authentication
Verify your API key works:Next Steps
Core Concepts
Understand onramps, deposits, and rates
Quick Start
Create your first onramp