Skip to main content

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 order
  • expired - Payment expired, offer retry

Important webhook fields:

  • payment_history[] - Array of all deposits
  • total_paid_amount - Sum of all deposits
  • payment_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

IssueSolution
"Currency not supported"Check /currencies/ for available options
Webhook not receivedEnsure HTTPS, check firewall, verify callback_url
Amount below minimumCheck /payments/min-amount/?currency=XXX
Wrong endpointUse /payments/ not /transactions/
Missing payment_historyAll 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