Developers
API referenceInvoices

Record a payment collected elsewhere

POST
/invoices/{invoice_id}/payment

Records money you collected yourself — a PSP charge, a direct debit, cash — on an issued invoice. AlphaCount books the payment, sets the invoice to partially or fully paid, stops dunning for what is paid, and the invoice.paid webhook fires when it is settled in full. Payments AlphaCount sees on the company's bank account are matched without this call.

amount is what was collected. Beyond the invoice it may cover what a dunning notice that was sent claims (fee, flat charge, interest — booked without VAT). A payment less the cash discount the invoice offers, inside its window, settles the invoice; so does one that misses the open amount by no more than the company's tolerance (EUR 1.00 unless the company set another). Anything more than that answers 422 invoice_not_payable, and reasons says why (invoicing.payment_exceeds_open with amount, payable and excess as decimal strings).

Requires an Idempotency-Key header: a repeated request with the same key and body answers 200 with the first answer — a payment is additive, so a retry without the key would book it twice. Scope partner:invoices:write.

Authorization

apiKey partner:invoices: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:invoices:write

Path Parameters

invoice_id*Invoice Id

Header Parameters

Idempotency-Key*string

Your key for this request — a UUID, for example. The same key with the same body answers with the first answer; with another body it is refused.

Length1 <= length <= 255
AlphaCount-Version?string

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

Request Body

application/json
  1. body

POST /invoices/{id}/payment (with the Idempotency-Key header): a payment the partner collected elsewhere (PSP, direct debit, cash).

amount*Amount
Match^\d{1,9}(\.\d{1,2})?$
paid_on?|null

Response Body

OK

application/json
  1. response
amount_paid*Amount Paid
cancelled_by*|null
cancels_invoice*|null
contract_external_ref*|

The contract that billed it, if any.

currency*Currency
customer_external_ref*string|null
due_date*|null
dunning_level*|

Highest dunning level sent (0 = payment reminder).

external_ref*string|null
external_source*string|null
id*Id
issue_date*|null
number*|

Invoice number; null while a draft.

overdue*Overdue
paid_at*|

Paid in full, UTC.

sent_at*|

First mail, UTC.

service_period*
status*Status
Value in"draft""issued""sent""partially_paid""paid""cancelled"
total_gross*Total Gross
total_net*Total Net
total_tax*Total Tax
type*Type

A cancellation invoice (Stornorechnung) is type storno with negative amounts.

Value in"invoice""storno"
Example Request
curl -X POST 'https://app.alphacount.ai/api/partner/v1/invoices/string/payment' \  -H 'Authorization: Bearer ab_...' \  -H 'Idempotency-Key: 8e0b3c5e-2f7a-4f6e-9a51-0c2d6f0e1a77' \  -H 'Content-Type: application/json' \  -d '{  "amount": "19.00"}'
Example Response
{  "amount_paid": "19.00",  "cancelled_by": null,  "cancels_invoice": null,  "contract_external_ref": null,  "currency": "EUR",  "customer_external_ref": "org-17",  "due_date": "2026-11-11",  "dunning_level": null,  "external_ref": "order-3",  "external_source": "alphalearn",  "id": "00000000-0000-4000-8000-000000000001",  "issue_date": "2026-10-28",  "number": "RE-2026-0001",  "overdue": false,  "paid_at": null,  "sent_at": null,  "service_period": {    "end": "2026-10-31",    "start": "2026-10-01"  },  "status": "partially_paid",  "total_gross": "119.00",  "total_net": "100.00",  "total_tax": "19.00",  "type": "invoice"}