Partners
Overview
Partners are the affiliates who promote your product. Each partner has a unique slug used in referral links and can have custom commission rates, payout preferences, and metadata.
All endpoints require API key authentication.
Create a partner
POST /api/v1/partnersRequest body
| Field | Type | Required | Description |
|---|---|---|---|
email |
string | Yes | Partner's email (unique per program) |
first_name |
string | No | First name |
last_name |
string | No | Last name |
slug |
string | Yes | URL-safe identifier for referral links |
commission_pct |
number | No | Custom commission rate (null = use program default) |
payout_method |
string | No | paypal, stripe, bank_transfer, or crypto |
payout_email |
string | No | Email for PayPal payouts |
metadata |
object | No | Arbitrary JSON metadata |
Example
curl -X POST "https://api.affihub.com/api/v1/partners" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"slug": "jane",
"commission_pct": 25
}'Response
{
"id": "par_abc123",
"program_id": "prog_xxx",
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"slug": "jane",
"status": "invited",
"commission_pct": 25,
"payout_method": null,
"payout_email": null,
"stripe_account_id": null,
"metadata": null,
"created_at": "2026-04-01T12:00:00Z"
}New partners are created with status invited.
List partners
GET /api/v1/partnersQuery parameters
| Param | Type | Default | Description |
|---|---|---|---|
page |
number | 1 | Page number |
per_page |
number | 20 | Results per page (max 100) |
status |
string | — | Filter by status: invited, active, deactivated |
search |
string | — | Search by email, name, or slug |
Example
curl "https://api.affihub.com/api/v1/partners?status=active&search=jane" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"data": [
{
"id": "par_abc123",
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"slug": "jane",
"status": "active",
"commission_pct": 25,
"created_at": "2026-04-01T12:00:00Z"
}
],
"total": 1,
"page": 1,
"per_page": 20
}Get a partner
GET /api/v1/partners/:idReturns the partner with aggregated stats.
curl "https://api.affihub.com/api/v1/partners/par_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"id": "par_abc123",
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"slug": "jane",
"status": "active",
"commission_pct": 25,
"payout_method": "stripe",
"stripe_account_id": "acct_xxx",
"metadata": null,
"created_at": "2026-04-01T12:00:00Z",
"stats": {
"total_commissions": 15,
"total_earned_cents": 48500,
"pending_cents": 12000,
"approved_cents": 18500,
"paid_cents": 18000
}
}Update a partner
PATCH /api/v1/partners/:idRequest body
All fields are optional. Only include fields you want to change.
| Field | Type | Description |
|---|---|---|
email |
string | Updated email |
first_name |
string | Updated first name |
last_name |
string | Updated last name |
slug |
string | Updated slug |
status |
string | invited, active, or deactivated |
commission_pct |
number | Custom commission rate |
payout_method |
string | Payment method preference |
payout_email |
string | PayPal payout email |
metadata |
object | Arbitrary metadata |
Example
curl -X PATCH "https://api.affihub.com/api/v1/partners/par_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "active",
"commission_pct": 30
}'Delete a partner
DELETE /api/v1/partners/:idSoft-deletes the partner by setting their status to deactivated. The partner record is preserved for historical reporting.
curl -X DELETE "https://api.affihub.com/api/v1/partners/par_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"Deactivated partners:
- Cannot log in to the portal
- Will not receive new commissions from future referrals
- Retain their existing commission and payout history
Partner statuses
| Status | Description |
|---|---|
invited |
Created but hasn't activated yet |
active |
Fully active, can receive commissions |
deactivated |
Soft-deleted, no new commissions |