Developers
API referenceInvoices

Import an invoice issued elsewhere

POST
/invoices/import

Takes over an invoice another system issued already — when moving from Wix, a shop or an old tool. It keeps its number and issue_date; AlphaCount allocates no number of its own and issues nothing a second time. It is booked as an open item (Bilanz: on its date), counts as sent, is dunned when overdue, and the payments it already had are booked with their dates. Send the original PDF as pdf_base64 (25 MB at most, else 413 documents.file_too_large); it is kept as the document. When the organisation's storage is full, the PDF is refused with 403 billing.storage_limit_reached.

A number the company has already answers 409 invoice_number_exists; a locked period 409 period_locked. Requires an Idempotency-Key. 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

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/import: an invoice another system issued already.

customer*
external_ref*External Ref
Match^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$
issue_date*Issue Date
Formatdate
lines*array<>
Items1 <= items <= 200
number*Number
Match^[^\s/][^\n]{0,49}$
Length1 <= length <= 50
payment_terms_days?|null
payments?array<>
Itemsitems <= 50
pdf_base64?|null
service_period?|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/import' \  -H 'Authorization: Bearer ab_...' \  -H 'Idempotency-Key: 8e0b3c5e-2f7a-4f6e-9a51-0c2d6f0e1a77' \  -H 'Content-Type: application/json' \  -d '{  "customer": {    "external_ref": "org-17",    "source": "explentor"  },  "external_ref": "wix-2026-0815",  "issue_date": "2026-10-14",  "lines": [    {      "description": "Kursbuchung Teamleitung",      "quantity": 1,      "unit_price_net": "490.00",      "vat_rate": 19    }  ],  "number": "WIX-0815",  "payments": [    {      "amount": "583.10",      "paid_on": "2026-10-20"    }  ],  "pdf_base64": "JVBERi0xLjcK",  "service_period": {    "end": "2026-10-14",    "start": "2026-10-14"  }}'
Example Response
{  "amount_paid": "583.10",  "cancelled_by": null,  "cancels_invoice": null,  "contract_external_ref": null,  "currency": "EUR",  "customer_external_ref": "org-17",  "due_date": "2026-10-28",  "dunning_level": null,  "external_ref": "wix-2026-0815",  "external_source": "explentor",  "id": "9a7b5c3d-1e2f-4a6b-8c0d-2e4f6a8b0c19",  "issue_date": "2026-10-14",  "number": "WIX-0815",  "overdue": false,  "paid_at": "2026-11-29T14:02:11Z",  "sent_at": "2026-10-14T12:00:00Z",  "service_period": {    "end": "2026-10-14",    "start": "2026-10-14"  },  "status": "paid",  "total_gross": "583.10",  "total_net": "490.00",  "total_tax": "93.10",  "type": "invoice"}