
Troubleshooting guides and support resources
Troubleshooting and support
Diagnose and resolve common issues with your BitPrimax integration. Find solutions to the most frequent problems merchants encounter.
Use this quick checklist to identify the most common issues:
This error occurs when your API keys are invalid or missing.
Solution: Check your API key configuration and ensure you're using the correct keys for your environment.
// Check your API key format
const apiKey = 'sk_test_...'; // Test environment
const apiKey = 'sk_live_...'; // Production environment
// Ensure proper authorization header
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}Your API key format is correct but the key itself is invalid.
Solution: Regenerate your API keys in the merchant dashboard and update your application configuration.
Your webhook endpoint is not receiving payment notifications.
// Example webhook endpoint
app.post('/webhooks/bitprimax', (req, res) => {
try {
const signature = req.headers['x-bitprimax-signature'];
const payload = req.body;
// Verify webhook signature
if (!verifyWebhookSignature(payload, signature, webhookSecret)) {
console.error('Invalid webhook signature');
return res.status(400).send('Invalid signature');
}
// Process webhook
console.log('Payment status:', payload.status);
// Always respond with 200
res.status(200).send('OK');
} catch (error) {
console.error('Webhook error:', error);
res.status(500).send('Internal error');
}
});Your webhook signature verification is failing.
Solution: Ensure you're using the correct webhook secret from your app dashboard and implementing proper signature verification.
You're unable to create new payments.
// Correct payment creation
const paymentData = {
amount: "100.50", // String format
currency: "USDT",
network: "BEP-20",
description: "Payment for order #123",
customerEmail: "customer@example.com",
// Optional fields
metadata: {
orderId: "123",
customerId: "456"
}
};
const response = await fetch('https://api.bitprimax.com/v1/payments', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(paymentData)
});Payment status remains pending or doesn't update.
Solution: Check your webhook implementation and ensure you're properly handling status updates. You can also poll the payment status manually.
API requests are timing out or taking too long to respond.
Solution: Implement proper timeout handling and retry logic in your application.
// Implement retry logic
async function createPaymentWithRetry(paymentData, maxRetries = 3) {
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
const response = await fetch('https://api.bitprimax.com/v1/payments', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(paymentData),
timeout: 10000 // 10 second timeout
});
if (response.ok) {
return await response.json();
}
} catch (error) {
if (attempt === maxRetries) {
throw error;
}
// Wait before retrying
await new Promise(resolve => setTimeout(resolve, 1000 * attempt));
}
}
}You're hitting API rate limits.
Solution: Implement exponential backoff and respect rate limits. Check the Rate Limits section for current limits.
Still stuck? Get personalized help from our support team.