Authentication
Using API Keys
All API requests must include your API key in the Authorization header using Bearer token format.
Authorization: Bearer sk_live_your_api_key_hereImportant: API keys provide full access to your account. Keep them secure and never expose them in client-side code.
Rate Limits
API requests are rate limited to protect the service and ensure fair usage.
- 100 requests per minute per API key
- Rate limit headers are included in all responses
X-RateLimit-Limit: Maximum requests allowedX-RateLimit-Remaining: Requests remaining in current windowX-RateLimit-Reset: Unix timestamp when limit resets
Customers
Usage
Charges
Balances
Usage Caps
Webhooks
Webhook Events
Subscribe to events to receive real-time notifications. All webhooks are signed with HMAC-SHA256.
Core Billing
charge.succeededcharge.failedusage.recordedcustomer.balance.low
Deposits & Withdrawals
customer.deposit.confirmedcustomer.withdraw.confirmed
Operations
customer.usage_cap.reachedwebhook.endpoint.unhealthy
Integration
customer.createdapi_key.createdpricing_plan.updated
API Keys
Verifying Webhook Signatures
All webhooks include an X-Drip-Signature header. Verify it using HMAC-SHA256.
import crypto from 'crypto';
function verifyWebhookSignature(
payload: string,
signature: string,
secret: string
): boolean {
const expectedSig = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expectedSig)
);
}
// In your webhook handler
app.post('/webhooks/drip', (req, res) => {
const signature = req.headers['x-drip-signature'];
const isValid = verifyWebhookSignature(
JSON.stringify(req.body),
signature,
process.env.DRIP_WEBHOOK_SECRET
);
if (!isValid) {
return res.status(401).send('Invalid signature');
}
// Process the webhook...
res.status(200).send('OK');
});