API referenceContracts
Retrieve a contract
GET
The contract with its items, its next billing date, usage_open_from and the cycles billed so far with their invoices. Scope partner:contracts:read.
apiKey partner:contracts:readheader
AuthorizationBearer <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:contracts:read
source*SourceMatch
^[a-z0-9][a-z0-9_-]{0,49}$external_ref*External RefMatch
^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$AlphaCount-Version?stringThe API version to use. Default: the current one.
OK
application/json- response
billing_interval*Billing IntervalValue in
"month""quarter""year"billing_starts_on*|nullcustomer_external_ref*string|nullcycles*array<>end_date*|nullexternal_ref*string|nullexternal_source*string|nullid*Idinvoice_mode*Invoice ModeValue in
"draft""issue""issue_send"items*array<>name*Namenext_billing_date*|nullnumber*Numberpayment_terms_days*integer|nullstart_date*Start DateFormat
datestatus*StatusValue in
"draft""active""paused""cancelled""ended"usage_open_from*|Usage before this day is billed already and refused.
curl -X GET 'https://app.alphacount.ai/api/partner/v1/contracts/by-ref/string/string' \ -H 'Authorization: Bearer ab_...'Example Response
{ "billing_interval": "month", "billing_starts_on": null, "customer_external_ref": "school-7", "cycles": [ { "end": "2026-01-31", "invoice_id": "00000000-0000-4000-8000-000000000002", "invoice_number": null, "invoice_status": "draft", "start": "2026-01-01", "status": "billed", "total_net": "425.00" }, { "end": "2026-02-28", "invoice_id": "00000000-0000-4000-8000-000000000003", "invoice_number": null, "invoice_status": "draft", "start": "2026-02-01", "status": "billed", "total_net": "825.00" } ], "end_date": null, "external_ref": "c-7", "external_source": "alphalearn", "id": "00000000-0000-4000-8000-000000000001", "invoice_mode": "draft", "items": [ { "billing_timing": "advance", "description": "Seat", "ends_after": null, "pricing_model": "per_unit", "product_ref": "seat", "quantity": "10", "ref": "seats", "unit_price_net": "12.50" }, { "billing_timing": "arrears", "description": "Token", "ends_after": null, "pricing_model": "per_unit", "product_ref": "tokens", "quantity": "0", "ref": "tokens", "unit_price_net": "0.20" }, { "billing_timing": "advance", "description": "SLA", "ends_after": null, "pricing_model": "flat", "product_ref": "sla", "quantity": "1", "ref": "sla", "unit_price_net": "300.00" } ], "name": "Lernplattform", "next_billing_date": "2026-03-01", "number": "VT-2026-0001", "payment_terms_days": null, "start_date": "2026-01-01", "status": "active", "usage_open_from": "2026-02-01"}