AlphaCount Developers
API referenceRevenue share

Create or update an agreement

PUT
/commission-agreements/by-ref/{source}/{external_ref}

An agreement between the company and a partner: which revenue counts (customers attributed to the partner, or all customers, optionally limited to products), the tiers by contract month (for example 15 % in months 1–12, then 5 %), and from when. Terms are frozen once made; to change them, make a new agreement. Scope partner:commissions:write.

Authorization

apiKey partner:commissions:write
headerAuthorizationBearer <ab_…>

An API key from Integrations → Connect AI assistants (MCP) → New access, bound to exactly one company. Each operation names the scope the key must carry.

Scope: partner:commissions:write

Path Parameters

source*Source
Match^[a-z0-9][a-z0-9_-]{0,49}$
external_ref*External Ref
Match^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$

Header Parameters

AlphaCount-Version?string

The API version to use. Default: the current one.

Request Body

application/json
  1. body

PUT /commission-agreements/by-ref/{source}/{ref}. The terms count on create only — a running agreement's terms are frozen (409 on change).

accrue_from?|null
anchor?|null
applies_to?|null
contract_reference?|null
end_date?|null
name?|null
partner_ref*Partner Ref
Match^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$
product_ids?array<>|null
product_numbers?array<string>|null
start_date*Start Date
Formatdate
tiers?array<>|null

Response Body

OK

application/json
  1. response
accrue_from*|

Revenue paid before this day earns nothing here.

anchor*Anchor
Value in"attribution_start""first_paid_revenue"
applies_to*Applies To
Value in"attributed_customers""all_customers"
basis*Basis
condition_id*string|null
contract_reference*string|null
end_date*|null
external_ref*string|null
external_source*string|null
id*Id
name*string|null
partner_id*Partner Id
partner_name*string|null
product_ids*array<string>
start_date*Start Date
Formatdate
status*Status
tiers*array<>
Example Request
curl -X PUT 'https://app.alphacount.ai/api/partner/v1/commission-agreements/by-ref/string/string' \  -H 'Authorization: Bearer ab_...' \  -H 'Content-Type: application/json' \  -d '{  "partner_ref": "lernlink",  "start_date": "2026-01-01",  "tiers": [    {      "from_month": 1,      "percent": 15,      "to_month": 12    },    {      "from_month": 13,      "percent": 5,      "to_month": null    }  ]}'
Example Response
{  "accrue_from": null,  "anchor": "attribution_start",  "applies_to": "attributed_customers",  "basis": "paid_net",  "condition_id": null,  "contract_reference": null,  "end_date": null,  "external_ref": "lernlink-2026",  "external_source": "alphalearn",  "id": "00000000-0000-4000-8000-000000000001",  "name": "lern.link GmbH",  "partner_id": "00000000-0000-4000-8000-000000000002",  "partner_name": "lern.link GmbH",  "product_ids": [],  "start_date": "2026-01-01",  "status": "active",  "tiers": [    {      "from_month": 1,      "percent": 15,      "to_month": 12    },    {      "from_month": 13,      "percent": 5,      "to_month": null    }  ]}