API Reference
Welcome to the Richdale Affiliate API. You can use this API to programmatically read your platform's affiliate data, retrieve commissions, and securely handle real-time webhook events inside your own backend or via IPaaS tools like Zapier and Make.
Authentication
The Richdale API uses API keys to authenticate requests. You can view and manage your API keys in the Business Settings dashboard.
Authentication to the API is performed via HTTP Bearer Auth. Provide your API key as the bearer token in the Authorization header.
curl https://api.richdale.app/api/v1/business/{businessId}/affiliates \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx"Base URL
All API requests must be made over HTTPS. Calls made over plain HTTP will fail.
https://api.richdale.app/api/v1/business/{businessId}Webhooks & Security
Richdale can send webhook events that notify your application any time an event happens (e.g., when a commission is approved). To verify that a webhook was actually sent by Richdale and not a malicious third party, you must verify the HMAC signature included in the headers.
Verifying Signatures
The x-richdale-signature header contains a timestamp and a signature. Extract these values, compute an HMAC with the SHA256 hash function using your webhook's secret, and compare it.
const crypto = require('crypto');
// The headers and raw body from the incoming POST request
const signatureHeader = req.headers['x-richdale-signature'];
const rawBody = req.body; // Ensure this is the RAW JSON string, not parsed
const secret = 'whsec_live_...';
// Parse the header (format: t=1612345678,v1=abcdef123...)
const [tPart, v1Part] = signatureHeader.split(',');
const timestamp = tPart.split('=')[1];
const signature = v1Part.split('=')[1];
// Construct the signed payload string
const signedPayload = `${timestamp}.${rawBody}`;
// Compute expected signature
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(signedPayload)
.digest('hex');
if (signature === expectedSignature) {
console.log("Valid Webhook!");
} else {
console.error("Invalid Signature");
}List Commissions
Returns a list of commissions generated for your business programs.
/api/v1/business/{businessId}/commissions