Overview
The Anderro API lets you programmatically manage affiliates in your program. You can register new affiliates, remove them, and receive real-time webhook notifications when events occur.
Step 1: Get your API key
- Log in to your Anderro dashboard
- Go to Products and select your SaaS product
- Navigate to the Integration tab
- Copy your Secret Key (starts with
sk_)
Keep your key secret
Never expose your secret key in client-side code or public repositories. It grants full API access to your product.
Step 2: Make your first API call
Register an affiliate using a simple POST request:
curl -X POST https://anderro.com/api/v1/affiliates \
-H "Content-Type: application/json" \
-H "x-api-key: sk_your_secret_key" \
-d '{
"email": "[email protected]",
"name": "Jane Smith"
}'
You'll receive a response like this:
{
"affiliate": {
"id": "abc123",
"email": "[email protected]",
"name": "Jane Smith",
"isNew": true
},
"partnership": {
"id": "xyz789",
"status": "active",
"referralCode": "jane-smith"
}
}
Step 3: Set up webhooks (optional)
To receive real-time notifications when affiliates sign up through referral links or generate commissions:
- Go to your product's Webhooks tab in the dashboard
- Enter your webhook endpoint URL
- Select the events you want to receive
- Copy the webhook secret for signature verification
See the Webhooks Overview for implementation details.
Record payments with POST /events
Send server-side signup and payment events to /events on your tracking service base URL from the Integration tab. This is separate from the /api/v1 management API. Authenticate with x-api-key: your live secret key records live events, while sk_test_ selects sandbox mode.
/events| Parameter | Type | Description |
|---|---|---|
typerequired | string | signup or payment. |
visitorId | string | Visitor ID from the tracking integration. Provide this or customerEmail. |
customerEmail | string | Customer email, trimmed and lowercased. Provide this or visitorId. |
amountCents | integer | Required for payments: 1 through 2,147,483,647 cents, inclusive. |
externalId | string | Your stable transaction ID, up to 255 characters. Trimmed before use; reuse it for retries of the same payment. |
isRenewal | boolean | Payment only. true marks a renewal. On a one-time program the event is recorded and no commission is created. false, null, and omission leave commission rules unchanged. Ignored on signup. |
curl -X POST "$TRACKING_BASE_URL/events" \
-H "Content-Type: application/json" \
-H "x-api-key: sk_your_secret_key" \
-d '{
"type": "payment",
"customerEmail": "[email protected]",
"amountCents": 4900,
"externalId": "order_123"
}'
Set TRACKING_BASE_URL to your tracking service URL. A successful request returns 202 with {"ok":true} and queues the event for processing.
Payments with a non-empty externalId are deduplicated per product and mode (live or sandbox). Keep the same ID when retrying a payment; use a new ID for a distinct payment. Payments without externalId are not deduplicated on retry and can create duplicate records and commissions. The maximum accepted payment amount is 2,147,483,647 cents; larger amounts return 400.
Send isRenewal: true only for a renewal payment. On a one-time program that payment is stored and creates no commission. A recurring program still creates a commission. Paddle and SamCart renewals do not use this field.
Next steps
- Authentication - learn about API key management
- API Overview - base URL, error format, rate limits
- List Affiliates - query your affiliates with stats
- Get Stats - retrieve KPIs for your program
- List Commissions - view commission records
- List Payouts - manage affiliate payouts
- Pagination - navigate large result sets
- Rate Limits - understand API usage limits
- Webhooks - receive real-time event notifications