Docs
API reference
Every endpoint of the Affiligato API v2: what it takes and what it answers.
Every answer is { "data": … }, a list adds has_more, and an error is { "error": { "code", "message" } }. A key sees only its own program. Amounts are in minor units and times in milliseconds since the epoch. Lists come newest first; pass the last id you saw as starting_after.
Base URL: https://app.affiligato.com/api/v2. A secret API key from Integrations → Conversions API, sent as Bearer afk_….
Meta
GET /openapi.json
This OpenAPI document
200This OpenAPI document
Program
GET /program
The program this key belongs to
200The program this key belongs to401unauthorized429rate_limited
Partners
GET /partners
List partners, newest first, or find one by email
| Parameter | In | Type | About |
|---|---|---|---|
limit | query | integer | |
starting_after | query | string | |
email | query | string |
200List partners, newest first, or find one by email400invalid_request401unauthorized429rate_limited
POST /partners
Add an approved partner and email them their link
| Body field | Type | About |
|---|---|---|
email (required) | string | |
group_id | string | |
name (required) | string |
201Add an approved partner and email them their link400invalid_request401unauthorized409conflict429rate_limited
GET /partners/{id}
Get a partner
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Get a partner401unauthorized404not_found429rate_limited
PATCH /partners/{id}
Change a partner's name, group or tags
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
| Body field | Type | About |
|---|---|---|
group_id | object | |
name | string | |
tags | string[] |
200Change a partner's name, group or tags400invalid_request401unauthorized404not_found429rate_limited
POST /partners/{id}/approve
Set a partner's status to approved
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Set a partner's status to approved401unauthorized404not_found429rate_limited
POST /partners/{id}/reject
Set a partner's status to rejected
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Set a partner's status to rejected401unauthorized404not_found429rate_limited
POST /partners/{id}/suspend
Set a partner's status to suspended
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Set a partner's status to suspended401unauthorized404not_found429rate_limited
Commissions
GET /commissions
List commissions, newest first
| Parameter | In | Type | About |
|---|---|---|---|
limit | query | integer | |
starting_after | query | string |
200List commissions, newest first400invalid_request401unauthorized429rate_limited
POST /commissions
Create a manual commission for a partner
| Body field | Type | About |
|---|---|---|
amount (required) | integer | |
currency | string | |
note | string | |
partner_id (required) | string | |
revenue | integer | |
status | "approved" | "pending" |
201Create a manual commission for a partner400invalid_request401unauthorized409conflict429rate_limited
GET /commissions/{id}
Get a commission
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Get a commission401unauthorized404not_found429rate_limited
PATCH /commissions/{id}
Change an unpaid commission's amount or note
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
| Body field | Type | About |
|---|---|---|
amount | integer | |
note | string |
200Change an unpaid commission's amount or note400invalid_request401unauthorized404not_found409conflict429rate_limited
DELETE /commissions/{id}
Delete a commission that was never paid
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Delete a commission that was never paid401unauthorized404not_found409conflict429rate_limited
POST /commissions/{id}/approve
Approve a pending commission
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Approve a pending commission401unauthorized404not_found409conflict429rate_limited
POST /commissions/{id}/decline
Decline an unpaid commission
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Decline an unpaid commission401unauthorized404not_found409conflict429rate_limited
Transactions
GET /transactions
List transactions, newest first
| Parameter | In | Type | About |
|---|---|---|---|
limit | query | integer |
200List transactions, newest first400invalid_request401unauthorized429rate_limited
POST /transactions
Record a payment; the partner who referred the customer is credited
| Body field | Type | About |
|---|---|---|
amount (required) | integer | |
currency (required) | string | |
customer_id | string | |
email | string | |
paid_at | integer | |
product_ids | string[] | |
source_id | string |
201Record a payment; the partner who referred the customer is credited400invalid_request401unauthorized409conflict429rate_limited
GET /transactions/{id}
Get a transaction
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Get a transaction401unauthorized404not_found429rate_limited
DELETE /transactions/{id}
Delete a transaction and reverse what it earned
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Delete a transaction and reverse what it earned401unauthorized404not_found429rate_limited
Links
GET /links
List partners' links, newest first
| Parameter | In | Type | About |
|---|---|---|---|
limit | query | integer | |
starting_after | query | string | |
partner_id | query | string |
200List partners' links, newest first400invalid_request401unauthorized429rate_limited
Clicks
GET /clicks
List clicks, newest first
| Parameter | In | Type | About |
|---|---|---|---|
limit | query | integer | |
starting_after | query | string | |
country | query | string | |
device | query | "desktop" | "mobile" | "tablet" | |
link_id | query | string | |
partner_id | query | string |
200List clicks, newest first400invalid_request401unauthorized429rate_limited
Promotion codes
GET /promo_codes
List partners' promotion codes, newest first
| Parameter | In | Type | About |
|---|---|---|---|
limit | query | integer | |
starting_after | query | string |
200List partners' promotion codes, newest first400invalid_request401unauthorized429rate_limited
Customers
GET /customers
List referred customers, newest first
| Parameter | In | Type | About |
|---|---|---|---|
limit | query | integer |
200List referred customers, newest first400invalid_request401unauthorized429rate_limited
POST /customers/status
Set a referred customer's subscription status (active, trialing or canceled) by the customer id your billing reported, e.g. after a cancellation your own webhook received
| Body field | Type | About |
|---|---|---|
customer_id (required) | string | |
status (required) | "active" | "canceled" | "trialing" |
200Set a referred customer's subscription status (active, trialing or canceled) by the customer id your billing reported, e.g. after a cancellation your own webhook received400invalid_request401unauthorized404not_found429rate_limited
Payouts
GET /payouts
List payouts, newest first
| Parameter | In | Type | About |
|---|---|---|---|
limit | query | integer | |
starting_after | query | string |
200List payouts, newest first400invalid_request401unauthorized429rate_limited
Webhooks
GET /webhooks
List the webhook endpoints, oldest first
200List the webhook endpoints, oldest first401unauthorized429rate_limited
POST /webhooks
Subscribe an HTTPS URL to events; the answer carries its signing secret, once
| Body field | Type | About |
|---|---|---|
events (required) | "*" | "partner.created" | "partner.updated" | "referral.created" | "customer.updated" | "link.created" | "link.updated" | "transaction.created" | "transaction.updated" | "commission.created" | "commission.updated" | "payout.created" | "payout.paid"[] | |
url (required) | string |
201Subscribe an HTTPS URL to events; the answer carries its signing secret, once400invalid_request401unauthorized429rate_limited
DELETE /webhooks/{id}
Unsubscribe a webhook endpoint
| Parameter | In | Type | About |
|---|---|---|---|
id (required) | path | string |
200Unsubscribe a webhook endpoint401unauthorized404not_found429rate_limited