Settings & Keys
Overview
The Settings page in your provider dashboard contains all the credentials and configuration you need to integrate Affihub with your website and payment provider.
Program ID
Your Program ID identifies your affiliate program. It's used in:
- The tracking script (
data-programattribute) - Webhook URLs (
?program_id=parameter) - API calls (returned in responses)
prog_abc123def456Find it at the top of the Settings page in your provider dashboard.
API Key
Your API key authenticates server-side API calls. Use it in the Authorization header:
curl "https://api.affihub.com/api/v1/partners" \
-H "Authorization: Bearer YOUR_API_KEY"Keep your API key secret. Never expose it in client-side code, public repositories, or frontend bundles. Store it in environment variables.
Regenerating your key
If your API key is compromised, regenerate it from the Settings page. The old key will immediately stop working.
Webhook URLs
Stripe webhook
https://api.affihub.com/webhooks/stripe?program_id=YOUR_PROGRAM_IDAdd this as a webhook endpoint in your Stripe Dashboard under Developers → Webhooks. Select events:
checkout.session.completedinvoice.paid
Paddle webhook
https://api.affihub.com/webhooks/paddle?program_id=YOUR_PROGRAM_IDAdd this as a notification destination in your Paddle Dashboard under Developer Tools → Notifications. Select events:
transaction.completedsubscription.canceledadjustment.updated
Webhook secrets
After creating your webhook endpoints, paste the signing secrets here:
| Field | Source |
|---|---|
| Stripe Webhook Secret | Stripe Dashboard → Developers → Webhooks → Signing secret (whsec_...) |
| Paddle Webhook Secret | Paddle Dashboard → Developer Tools → Notifications → Secret key |
These secrets allow Affihub to verify that incoming webhooks are authentic.
Integration snippet
Copy this snippet and add it to every page of your website, before </body>:
<script
src="https://api.affihub.com/affihub.js"
data-program="YOUR_PROGRAM_ID"
></script>The Settings page shows this snippet pre-filled with your actual Program ID — just copy and paste.
Program settings
Configure your affiliate program:
| Setting | Description | Default |
|---|---|---|
| Program name | Display name for your program | — |
| Domain | Your website domain | — |
| Currency | Currency for commissions and payouts | USD |
| Default commission | Default commission percentage | 20% |
| Payout term | Payment schedule (e.g., NET-15, NET-30) | NET-15 |
| Minimum payout | Minimum amount for payout generation | $0.00 |
Updating settings via API
curl -X PATCH "https://api.affihub.com/api/v1/programs/me" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Affiliate Program",
"default_commission_pct": 25,
"payout_term": "NET-30",
"min_payout_cents": 5000
}'Integration status
Check which integrations are connected:
curl "https://api.affihub.com/api/v1/integrations/status" \
-H "Authorization: Bearer YOUR_API_KEY"Response:
{
"stripe": {
"configured": true,
"webhook_secret_set": true
},
"paddle": {
"configured": true,
"webhook_secret_set": true
},
"svix": {
"configured": true
}
}Quick setup checklist
- Copy your Program ID and API Key
- Install the tracking script on your website
- Add the Stripe or Paddle webhook URL in your payment provider's dashboard
- Paste the webhook signing secret in Affihub Settings
- Pass the referral at checkout using
AffiHub.getRef() - Create your first partner
- Test with a referral link and test purchase
See the Quickstart for a complete walkthrough.