Developers
API-ReferenzRevenue share

Register a Gutschrift you issued yourself

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

For a self-billed invoice (Gutschrift) you issued and mailed yourself: number, figures and PDF are taken as they are and booked like a statement of AlphaCount's own — an incoming document, at the issue date against the partner's creditor where the company keeps balance sheets. No number is drawn, nothing is rendered or mailed, and no revenue is needed: never report the same revenue with POST /revenue-events as well, it would be settled a second time.

Frozen once registered: the same request again answers 200 unchanged, another body under the same reference is refused. Report its payment with POST /commission-statements/{id}/payment. No commission_statement.issued webhook fires. The PDF may be 25 MB at most (413 documents.file_too_large); a full storage answers 403 billing.storage_limit_reached. 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-statements/by-ref/{source}/{ref} — a Gutschrift another product of ours issued and mailed itself.

gross_amount*Gross Amount
Match^-?\d{1,9}(\.\d{1,2})?$
issue_date*Issue Date
Formatdate
lines*array<>
Items1 <= items
net_amount*Net Amount
Match^-?\d{1,9}(\.\d{1,2})?$
number*Number
Length1 <= length <= 50
partner_ref*Partner Ref
Match^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$
pdf_base64*Pdf Base64
Length1 <= length
pdf_sha256*Pdf Sha256
Match^[0-9a-f]{64}$
period_end*Period End
Formatdate
vat_amount*Vat Amount
Match^-?\d{1,9}(\.\d{1,2})?$

Response Body

OK

application/json
  1. response
cancelled_by_id*string|null
cancels_statement_id*string|null
document_id*string|null
e_invoice_format*string|null
external_ref?|

Your reference, on a statement you issued yourself and registered here.

gross_cents*Gross Cents
has_pdf*Has Pdf
has_xml*Has Xml
id*Id
issue_date*|null
kind*Kind

self_billing is a Gutschrift (self-billed invoice, VAT law); settlement a statement for a private person; partner_invoice asks the partner to invoice.

Value in"self_billing""settlement""partner_invoice"
lines*array<>
net_cents*Net Cents
number*string|null
objected_at*|null
paid_at*|null
partner_id*Partner Id
partner_name*string|null
period_end*Period End
Formatdate
send_error?|

Set when send was requested on create and the mail failed; the statement exists either way. code is one of commission.partner_email_missing (the partner has no address), commission.no_mailbox (the company has none to send from), commission.send_failed (the mail server refused), commission.statement_not_sendable, or — only in the answer replayed for an Idempotency-Key whose first request never finished — commission.send_not_confirmed.

sent_at*|null
sent_to*string|null
status*Status
Value in"draft""issued""sent""cancelled""objected"
stripe_transfer_ids?array<string>|

The Stripe Connect transfers reported as its payment.

tax_note*Tax Note
Value in"regular""small_business""reverse_charge""private_person"
vat_cents*Vat Cents
vat_rate*Vat Rate
Example Request
curl -X PUT 'https://app.alphacount.ai/api/partner/v1/commission-statements/by-ref/string/string' \  -H 'Authorization: Bearer ab_...' \  -H 'Content-Type: application/json' \  -d '{  "gross_amount": "71.40",  "issue_date": "2026-06-02",  "lines": [    {      "amount": "60.00",      "basis_amount": "400.00",      "contract_month": 5,      "customer": "Zwölfte Schule",      "paid_at": "2026-05-02",      "percent": 15,      "service_period_start": "2026-05-01"    }  ],  "net_amount": "60.00",  "number": "GS-2026-0007",  "partner_ref": "lernlink",  "pdf_base64": "JVBERi0xLjcgR3V0c2NocmlmdCB2b24gYWxwaGFsZWFybg==",  "pdf_sha256": "b7f2a79238f0bd69e20b7ebccc3a59741a65b1e5b1fd3b58765b27779dff64a2",  "period_end": "2026-06-01",  "vat_amount": "11.40"}'
Example Response
{  "cancelled_by_id": null,  "cancels_statement_id": null,  "document_id": "00000000-0000-4000-8000-000000000003",  "e_invoice_format": "none",  "external_ref": "st-7",  "gross_cents": 7140,  "has_pdf": true,  "has_xml": false,  "id": "00000000-0000-4000-8000-000000000001",  "issue_date": "2026-06-02",  "kind": "self_billing",  "lines": [    {      "amount_cents": 6000,      "basis_cents": 40000,      "contract_month": 5,      "customer": "Zwölfte Schule",      "entry_id": "external:1",      "paid_at": "2026-05-02",      "percent": 15,      "service_period_start": "2026-05-01"    }  ],  "net_cents": 6000,  "number": "GS-2026-0007",  "objected_at": null,  "paid_at": null,  "partner_id": "00000000-0000-4000-8000-000000000002",  "partner_name": "lern.link GmbH",  "period_end": "2026-06-01",  "sent_at": null,  "sent_to": null,  "status": "issued",  "stripe_transfer_ids": null,  "tax_note": "regular",  "vat_cents": 1140,  "vat_rate": 19}