Quick Integration Checklist
A practical checklist for integrating with Cryptofuse API.
Pre-Integration
- Obtain OAuth2 credentials (client_id, client_secret)
- Set up webhook endpoint (HTTPS required for production)
- Configure webhook secret in dashboard
- Review available currencies:
GET /currencies/?full=true&min_max=true
Payment Integration
1. Display Available Payment Options
# Get currencies with limits and USD values
GET /currencies/?full=true&min_max=true&include_usd=true
2. Create Payment
POST /payments/
{
"amount": 100.00,
"currency": "USDTTRC20",
"callback_url": "https://your-site.com/webhook",
"order_id": "your-order-123"
}
3. Handle Payment Webhooks
Key statuses to handle:
confirming- Payment received, show "processing"completed- Payment done, fulfill orderexpired- Payment expired, offer retry
Important webhook fields:
payment_history[]- Array of all depositstotal_paid_amount- Sum of all depositspayment_type- "full", "partial", or "overpayment"final_usd_value- Actual USD received (for completed)
4. Verify Webhook Signature
const expectedSig = crypto
.createHmac('sha256', webhookSecret)
.update(rawBody)
.digest('hex');
if (expectedSig !== req.headers['x-webhook-signature']) {
return res.status(401).send('Invalid signature');
}
Withdrawal Integration
1. Check Available Balance
GET /user/balances/
2. Validate Address First
POST /withdrawal/validate-address/
{
"address": "TXYZabc123...",
"currency": "USDTTRC20"
}
3. Estimate Fees
POST /withdrawal/estimate/
{
"amount": 100.00,
"currency": "USDTTRC20"
}
4. Create Withdrawal
POST /withdrawal/
{
"amount": 100.00,
"currency": "USDTTRC20",
"address": "TXYZabc123...",
"callback_url": "https://your-site.com/webhook"
}
Testing Checklist
Testnet Amounts (USE_TESTNET=true)
- Test with 123.45 USD for instant success
- Test with 345.67 USD for partial payment
- Test with 456.78 USD for overpayment
- Test with 567.89 USD for expiry
Webhook Testing
- Use webhook.site for initial testing
- Verify signature validation works
- Test idempotency (handle duplicate webhooks)
- Verify all status transitions
Error Handling
- Handle structured error responses
- Test with amounts below minimum
- Test with invalid addresses
- Test with insufficient balance
Common Issues & Solutions
| Issue | Solution |
|---|---|
| "Currency not supported" | Check /currencies/ for available options |
| Webhook not received | Ensure HTTPS, check firewall, verify callback_url |
| Amount below minimum | Check /payments/min-amount/?currency=XXX |
| Wrong endpoint | Use /payments/ not /transactions/ |
| Missing payment_history | All webhooks include this array |
Production Checklist
- Remove hardcoded test amounts
- Implement webhook retry handling
- Add webhook event logging
- Set up monitoring for failed webhooks
- Configure IP whitelist (optional)
- Test with real small amounts first