Basics
Errors
One shape for every refusal, with a stable code — and what to do about each.
Every refusal has the same shape:
{ "detail": { "code": "invoice_not_issuable", "messages": ["Kundenadresse ist unvollständig."] } }Programs decide on code — it is stable and documented below. Some codes carry fields of their own (scope,
invoice_id, open_from …), listed with the code. message and messages appear where AlphaCount's invoicing has
a sentence for a person, in German; do not parse them.
A body that does not fit
Wrong type, a missing field, an unknown field, a value out of range: 422 validation_failed with the places, without
the values you sent.
{
"detail": {
"code": "validation_failed",
"errors": [
{ "loc": ["body", "lines", 0, "vat_rate"], "type": "literal_error", "msg": "Input should be 0, 7 or 19" }
]
}
}Rely on loc and type. msg is for reading.
Status codes
| Status | Means | Retry? |
|---|---|---|
400 | the request is malformed (a header, the version) | no — fix it |
401 | the key is missing, unknown, expired, or its creator inactive | no |
403 | the key may not do this | no |
404 | not found in the key's company | no |
409 | a conflict with what exists | only conflict_retry |
422 | the request is understood but refused | no — fix the cause |
500 | AlphaCount failed | yes — a POST with an Idempotency-Key with the same key; it was not used up |
503 | a stored file cannot be read right now (file_unavailable) | yes — after a short wait |
Every code
| Code | Status | Meaning | Returned by |
|---|---|---|---|
api_key_admin_required | 403 | The key's creator is not an admin of the organisation. API keys act with an admin's rights. An admin creates the key. | every operation |
api_key_entity_not_accessible | 403 | The key's company is no longer reachable for its creator. | every operation |
api_key_entity_not_single | 403 | The key is not limited to exactly one company. The API works on one company per key. Create the key for exactly one company. | every operation |
api_key_expired | 401 | The key has passed its expiry date. Create a new key. | every operation |
api_key_invalid | 401 | The key is unknown, revoked, or not an AlphaCount API key. Create a new key under Integrations → API keys. | every operation |
api_key_missing | 401 | No API key: the request has no `Authorization: Bearer …` header. Send the key as `Authorization: Bearer ab_…`. | every operation |
api_key_scope_missing | 403 | The key lacks the scope this route needs. Create a key with the scope named in `scope`. Extra fields: scope | every operation |
api_key_user_inactive | 401 | The person who created the key no longer has access to the organisation. An active admin creates a new key. | every operation |
api_version_unknown | 400 | The `AlphaCount-Version` header names a version this API does not offer. Use one of `supported`, or leave the header out for the current version. Extra fields: supported | every operation |
billing.contract_ended_read_only | 403 | A write after the organisation's contract ended: a trial that ended without a plan, or a subscription whose cancellation took effect. For 30 days the organisation can still be read and exported, then its data are deleted. Reads keep working. `since` names when the contract ended, `reason` why (`trial`, `canceled`), `delete_on` the day the data go. Export what you need before `delete_on`. To keep working, an admin chooses a plan in AlphaCount (Settings → Billing → Plan); writes work again at once. Extra fields: since, reason, delete_on | every operation |
billing.read_only | 403 | A write while the organisation is read-only: a payment of its subscription has been open for 14 days or more, or was disputed. Reads keep working. `since` names when read-only began, `reason` why (`payment_failed`, `disputed`, `topup_failed`). An admin pays the open invoice in AlphaCount (Settings → Billing); writes work again at once. | every operation |
billing.storage_limit_reached | 403 | The organisation's storage is full: the files of its documents reach the limit of its plan. Nothing stored is deleted, reading and exporting keep working — only a new file is refused. `args.limit_gb` names the limit. Contact AlphaCount support; the limit is raised per organisation. Extra fields: args | importInvoice, registerCommissionStatement |
commission.agreement_not_found | 404 | No agreement with this reference. | createInvoice, upsertCommissionAttribution |
commission.agreement_partner_mismatch | 409 | The agreement belongs to another partner. | upsertCommissionAgreement |
commission.agreement_takes_no_attributions | 422 | The agreement applies to all customers and takes no attributions. | createInvoice, upsertCommissionAttribution |
commission.agreement_terms_frozen | 409 | An agreement's terms cannot change once made. Make a new agreement; end the old one with `end_date`. | upsertCommissionAgreement |
commission.anchor_invalid | 422 | `anchor` is neither `attribution_start` nor `first_paid_revenue`. | upsertCommissionAgreement |
commission.applies_to_invalid | 422 | `applies_to` is neither `attributed_customers` nor `all_customers`. | upsertCommissionAgreement |
commission.attribution_conflict | 409 | Another partner holds this customer. End that attribution first. | createInvoice, upsertCommissionAttribution |
commission.attribution_reference_mismatch | 409 | The attribution reference exists for another customer or agreement. | createInvoice, upsertCommissionAttribution |
commission.billing_mode_invalid | 422 | Unknown billing mode. | upsertCommissionPartner |
commission.condition_not_found | 404 | The condition named in `condition_id` does not exist. | upsertCommissionAgreement |
commission.creditor_number_range_exhausted | 409 | The company has no free creditor number left (70000–79999). | upsertCommissionPartner |
commission.date_range_invalid | 422 | The end is before the start. | upsertCommissionAgreement, upsertCommissionAttribution |
commission.e_invoice_failed | 422 | The e-invoice for the statement could not be created — details are missing, such as the partner's address or tax number. Nothing was issued or numbered. Complete the partner's master data and settle again. | createCommissionStatement |
commission.e_invoice_format_invalid | 422 | Unknown e-invoice format. | upsertCommissionPartner |
commission.issuer_address_missing | 409 | The issuing company has no full address (street, postal code, city). Complete the company's address in its master data. | createCommissionStatement, registerCommissionStatement |
commission.issuer_tax_id_missing | 409 | The issuing company has neither a tax number nor a VAT ID. | createCommissionStatement, registerCommissionStatement |
commission.issuer_vat_id_missing | 409 | A Gutschrift to a partner in another EU country (reverse charge) must carry the company's VAT ID (Art. 226 no. 4 of the VAT Directive); it has none. Add the company's VAT ID in its master data. | createCommissionStatement, registerCommissionStatement |
commission.min_payout_invalid | 422 | The minimum payout cannot be negative. | upsertCommissionPartner |
commission.no_mailbox | 201 | The statement was issued but not mailed: the company has no mailbox to send from. | createCommissionStatement |
commission.nothing_to_settle | 422 | Nothing to settle for this partner: no open revenue before `period_end`, nothing positive, or below the partner's minimum payout. Report revenue first (`POST /revenue-events`), or call again once more has accrued. | createCommissionStatement |
commission.partner_address_missing | 409 | The partner has no full address (street, postal code, city). A Gutschrift or settlement statement must name it (§ 14 Abs. 4 Nr. 1 UStG, § 34a UStDV) — without it there is no input tax. Set `street`, `zip` and `city` on the partner and settle again. | createCommissionStatement, registerCommissionStatement |
commission.partner_archived | 409 | The partner is archived. | upsertCommissionAgreement, upsertCommissionPartner |
commission.partner_contact_missing | 409 | The partner is to receive an XRechnung, which must name the seller's telephone and e-mail (BR-DE-6, BR-DE-7) — in a Gutschrift, the partner's. One of them is missing. Set `phone` and `email` on the partner, or choose another `e_invoice_format`. | createCommissionStatement |
commission.partner_country_missing | 409 | The partner has no country, and an e-invoice needs one; it is never assumed. Set the partner's country (`country_code`) and settle again. | createCommissionStatement |
commission.partner_email_missing | 201 | The statement was issued but not mailed: the partner has no e-mail address. Set `email` on the partner; send the statement from the app. | createCommissionStatement |
commission.partner_kind_invalid | 422 | Unknown partner kind. | upsertCommissionPartner |
commission.partner_name_implausible | 422 | `name` does not look like a name. | upsertCommissionPartner |
commission.partner_name_missing | 422 | The partner needs a name. | upsertCommissionPartner |
commission.partner_not_found | 404 | No revenue-share partner with this reference. | createCommissionStatement, createInvoice, listCommissionEntries, listCommissionStatements, registerCommissionStatement, retrieveCommissionPartner, upsertCommissionAgreement |
commission.partner_tax_id_missing | 409 | A domestic Gutschrift must name the partner's tax number or VAT ID (§ 14 Abs. 4 UStG) — a small business's too (§ 34a UStDV); the partner has neither. Set `tax_number` or `vat_id` on the partner and settle again. | createCommissionStatement, registerCommissionStatement |
commission.partner_tax_status_mismatch | 409 | The partner's tax status contradicts its country — a domestic status abroad, or a reverse-charge or third-country status in the wrong country. The Gutschrift would show the wrong tax. Correct the partner's tax status or country. | createCommissionStatement, registerCommissionStatement |
commission.partner_tax_status_unknown | 409 | Nobody has said how the partner is taxed (`tax_status` is `unknown`). Nothing is issued on a guess: a Gutschrift showing VAT to a small business is VAT the partner owes and the company cannot deduct (§ 14c UStG). Set the partner's `tax_status` and settle again. | createCommissionStatement, registerCommissionStatement |
commission.partner_vat_id_missing | 409 | A reverse-charge Gutschrift to an EU partner needs the partner's VAT ID. | createCommissionStatement, registerCommissionStatement |
commission.payout_open | 409 | A payout is in flight for this statement — in a SEPA file at the bank, or one the company transfers itself; the same money may be moving already. Cancel the payout in the app first, or let the bank statement settle it. | recordCommissionStatementPayment |
commission.product_not_found | 404 | A named product does not exist in the company. Extra fields: product_numbers | createRevenueEvent, upsertCommissionAgreement |
commission.product_scope_invalid | 422 | The product selection is invalid. | upsertCommissionAgreement |
commission.revenue_event_not_found | 404 | `reverses_ref` names no revenue event of yours. | createRevenueEvent |
commission.revenue_lines_do_not_add_up | 422 | The lines do not add up to `net_amount`. | createRevenueEvent |
commission.self_billing_agreement_date_in_future | 422 | `self_billing_agreed_on` lies in the future. An agreement that is yet to be made is none. | upsertCommissionPartner |
commission.self_billing_not_agreed | 409 | A Gutschrift (self-billed invoice) needs the partner's prior self-billing agreement (§ 14 Abs. 2 Satz 5 UStG); none is on record. Set `self_billing_agreed_on` on the partner — it must lie before the statement. | createCommissionStatement, registerCommissionStatement |
commission.self_billing_objected | 409 | The partner objected to the self-billing procedure; no further Gutschrift until a new agreement. | createCommissionStatement, registerCommissionStatement |
commission.send_failed | 201 | The statement was issued but not mailed: the mail server refused. Send the statement again from the app. | createCommissionStatement |
commission.send_not_confirmed | 201 | The statement was issued; whether its mail went out is not known — the first request with this Idempotency-Key ended before the mail server answered. Read the statement: `sent_at` is set if the mail went out. If not, send it from the app. | createCommissionStatement |
commission.start_date_missing | 422 | The start date is missing. | upsertCommissionAgreement |
commission.statement_below_minimum | 409 | What is open for the partner fell below its minimum payout since the statement was prepared; nothing was issued, the amount is carried forward. | createCommissionStatement |
commission.statement_empty | 409 | The statement would be empty — its rows were settled meanwhile. | createCommissionStatement, registerCommissionStatement |
commission.statement_failed | 500 | The statement could not be created; nothing was issued. Try again with the same Idempotency-Key. | createCommissionStatement, registerCommissionStatement |
commission.statement_frozen | 409 | Another statement is registered under this reference, and a registered statement cannot change. | registerCommissionStatement |
commission.statement_has_no_xml | 404 | The statement was not issued as an XRechnung; there is no XML beside its PDF. Check `has_xml` on the statement. A ZUGFeRD statement carries its XML inside the PDF. | downloadCommissionStatementXml |
commission.statement_not_found | 404 | No issued statement with this id. | downloadCommissionStatementPdf, downloadCommissionStatementXml, recordCommissionStatementPayment, retrieveCommissionStatement |
commission.statement_not_payable | 409 | The statement cannot be marked paid — it is cancelled or objected. | recordCommissionStatementPayment |
commission.statement_not_self_billing | 409 | Only a self-billed invoice (Gutschrift) can be registered: this partner is paid by a settlement statement or invoices you. Check `billing_mode` and `tax_status` of the partner. | registerCommissionStatement |
commission.statement_not_sendable | 201 | The statement was issued but cannot be mailed in its state (cancelled or objected meanwhile). | createCommissionStatement |
commission.statement_number_taken | 409 | A statement with this number exists already. An invoice number is used once. | registerCommissionStatement |
commission.statement_pdf_invalid | 422 | `pdf_base64` is no PDF of at most 10 MB, or it does not match `pdf_sha256`. | registerCommissionStatement |
commission.statement_tax_mismatch | 422 | The figures do not add up, or their VAT does not fit the partner's tax status. `lines` must add up to `net_amount`, net plus VAT to `gross_amount`. Check `tax_status` of the partner. | registerCommissionStatement |
commission.supplier_not_found | 404 | The supplier to link the partner to does not exist. | upsertCommissionPartner |
commission.tax_status_invalid | 422 | Unknown tax status. | upsertCommissionPartner |
commission.tier_incomplete | 422 | A tier is incomplete: give `from_month` and `percent`. | upsertCommissionAgreement |
commission.tier_month_range_invalid | 422 | A tier's month range is invalid: `from_month` starts at 1, and `to_month` must not lie before it. | upsertCommissionAgreement |
commission.tier_percent_invalid | 422 | `percent` must be between 0 and 100. | upsertCommissionAgreement |
commission.tiers_empty | 422 | Give at least one tier. | upsertCommissionAgreement |
commission.tiers_overlap | 422 | The tiers overlap, or an open-ended tier is not the last. | upsertCommissionAgreement |
conflict_retry | 409 | Another request changed the same record at the same moment. Repeat the request. | correctInvoice, createCommissionStatement, createFeeStatement, createInvoice, createRevenueEvent, importInvoice, recordCommissionStatementPayment, recordInvoicePayment, registerCommissionStatement, reportUsage, upsertCommissionAgreement, upsertCommissionAttribution, upsertCommissionPartner, upsertContract, upsertCustomer, upsertProduct |
contract.customer_mismatch | 409 | The contract belongs to another customer; a contract cannot change its customer. | upsertContract |
contract.date_range_invalid | 422 | The end is before the start. | upsertContract |
contract.end_before_billed | 422 | The end lies inside a period already billed in advance. End on `billed_until` or later; an earlier end needs a cancellation invoice in the app. Extra fields: args | upsertContract |
contract.ended | 409 | The contract has ended and cannot change. | upsertContract |
contract.interval_mismatch | 422 | A product recurs in another interval than the contract (or is one-off). Extra fields: product | upsertContract |
contract.item_not_found | 404 | A usage record names an item reference the contract does not have. Extra fields: item_refs | reportUsage |
contract.item_product_changed | 409 | An item reference keeps its product. Use a new `ref` for another product. Extra fields: ref | upsertContract |
contract.not_active | 409 | The contract is not active (a draft, or ended). | reportUsage, upsertContract |
contract.not_draft | 409 | A running contract cannot go back to draft. | upsertContract |
contract.terms_frozen | 409 | The contract runs: its interval and start are fixed. | upsertContract |
contract.usage_period_closed | 422 | Usage before `open_from` belongs to a period already billed; it could never reach an invoice. Extra fields: open_from, refs | reportUsage |
contract_not_found | 404 | No contract with this reference in the company. | reportUsage, retrieveContract |
customer_not_found | 404 | No customer with this reference in the company. Create it first with `PUT /customers/by-ref/{source}/{external_ref}`. | createFeeStatement, createInvoice, createRevenueEvent, importInvoice, quoteTax, upsertCommissionAttribution, upsertContract |
customer_number_range_exhausted | 409 | The company has no free customer number left. | upsertCustomer |
documents.file_too_large | 413 | The file is larger than one file may be (`args.limit_mb`, 25 MB) — the same limit as every other way a file comes into AlphaCount. Send a smaller PDF (a scan at a lower resolution). Extra fields: args | importInvoice, registerCommissionStatement |
fee_statement.fee_abroad | 422 | A fee of the month comes from a partner outside Germany and the company states no fees of partners abroad; its tax (reverse charge, EC sales list) waits for a person in the app. Turn on fee statements (`stripe_platform.fee_statements`) to have them stated and booked here. `bt_id` names the Stripe balance transaction. Extra fields: bt_id | createFeeStatement |
fee_statement.mixed_cases | 422 | The month holds fees of this partner booked as German revenue and fees kept for the statement — the partner's country changed within the month. A person settles it in the app. | createFeeStatement |
fee_statement.nothing_to_state | 409 | No fee of this partner in this month is waiting for a statement — none was kept, or all are stated already. | createFeeStatement |
file_unavailable | 503 | The file exists but cannot be read from storage right now. Repeat the request after a short wait. The record itself is unaffected. | downloadCommissionStatementPdf, downloadCommissionStatementXml, downloadInvoicePdf, downloadInvoiceXml |
idempotency_key_invalid | 400 | The `Idempotency-Key` is not 1–255 printable characters without spaces. | correctInvoice, createCommissionStatement, createFeeStatement, createInvoice, importInvoice, recordInvoicePayment |
idempotency_key_missing | 400 | `POST /invoices` needs an `Idempotency-Key` header. Send a unique key per invoice, for example a UUID, and repeat it on retries. | correctInvoice, createCommissionStatement, createFeeStatement, createInvoice, importInvoice, recordInvoicePayment |
idempotency_key_reused | 409 | This `Idempotency-Key` was used with a different body. Use a new key for a new request. | correctInvoice, createCommissionStatement, createFeeStatement, createInvoice, importInvoice, recordInvoicePayment |
import_failed | 500 | The invoice could not be taken over; nothing was booked. Repeat the request with the same key; if it fails again, contact support. | importInvoice |
invalid_date_range | 422 | `from_date` lies after `to_date`. | retrieveSummary |
invoice_external_ref_exists | 409 | An invoice with this `external_ref` exists already. Retrieve it by reference, or use a new reference for a new invoice. Extra fields: invoice_id | correctInvoice, createInvoice, importInvoice |
invoice_not_cancellable | 422 | The invoice cannot be cancelled in its state. `reasons` says why, as a `code` with `args` (below). `messages` is German prose for people. Extra fields: reasons, messages, messageReasons:
| cancelInvoice |
invoice_not_correctable | 422 | The invoice cannot be corrected as it stands. `reasons` says why, as a `code` with `args` (below). `messages` is German prose for people. Extra fields: reasons, messages, messageReasons:
| correctInvoice |
invoice_not_found | 404 | No invoice the API can see under this id or reference. Invoices written in the app are not visible to the API. | cancelInvoice, correctInvoice, downloadInvoicePdf, downloadInvoiceXml, recordInvoicePayment, retrieveInvoice, retrieveInvoiceByRef, sendInvoice |
invoice_not_importable | 422 | The invoice cannot be taken over as sent. `reasons` says why, as a `code` with `args` (below). Extra fields: reasons, messages, messageReasons:
| importInvoice |
invoice_not_issuable | 422 | A mandatory detail for issuing is missing (on the company, the customer or a line). `reasons` lists each one as a `code` with `args` (below). `messages` says the same in German prose, for people — do not parse it. Extra fields: reasons, messages, messageReasons:
| correctInvoice, createFeeStatement, createInvoice |
invoice_not_issued | 409 | The invoice is a draft and has no PDF yet. | downloadInvoicePdf, downloadInvoiceXml |
invoice_not_payable | 422 | The payment cannot be booked on this invoice — it is a draft or cancelled, the amount is not positive, or it exceeds what is open. `reasons` says why, as a `code` with `args` (below). Check the invoice's `status` and `amount_paid`. `messages` is German prose for people. Extra fields: reasons, messages, messageReasons:
| recordInvoicePayment |
invoice_number_exists | 409 | The company already has an invoice with this number — an imported invoice keeps its own number, and numbers are unique. Extra fields: reasons, messages, message | importInvoice |
invoice_pdf_invalid | 422 | `pdf_base64` is not base64 of a PDF. | importInvoice |
invoice_pdf_missing | 404 | The PDF of this invoice is not available. | downloadInvoicePdf |
invoice_render_failed | 500 | Rendering the PDF or e-invoice failed. Nothing was created. Repeat the request; if it persists, contact support. | cancelInvoice, correctInvoice, createFeeStatement, createInvoice |
invoice_send_failed | 422 | The invoice exists, but the mail could not be sent. Retry with `POST /invoices/{id}/send`. Extra fields: message | sendInvoice |
invoice_xml_missing | 404 | This invoice has no e-invoice XML — it was issued as a plain PDF (a private customer, a small amount, a small business). | downloadInvoiceXml |
partner_filter_incomplete | 422 | `partner_source` and `partner_ref` name a partner only together. Send both to list one partner's rows, or neither to list all. | listCommissionEntries, listCommissionStatements |
payment_failed | 500 | The payment could not be booked — a fault on our side, not in the request. Nothing was booked and the `Idempotency-Key` is free again. Retry later with the same key; if it keeps failing, contact support with the time of the request. | recordInvoicePayment |
period_locked | 409 | The accounting period is locked (Festschreibung). Corrections go into the open period. Extra fields: message | cancelInvoice, correctInvoice, createFeeStatement, createInvoice, importInvoice |
pricing.model_unknown | 422 | Unknown pricing model. | upsertContract, upsertProduct |
pricing.negative_value | 422 | Quantities and prices cannot be negative. | upsertContract, upsertProduct |
pricing.overage_needs_quota | 422 | An overage price needs a quota (`included_quantity`). | upsertContract, upsertProduct |
pricing.package_size_missing | 422 | The package model needs the package size in `included_quantity`. | upsertContract, upsertProduct |
pricing.quantity_negative | 422 | A quantity cannot be negative. | upsertContract, upsertProduct |
pricing.tier_incomplete | 422 | A tier lacks `from` or `unit_price`. | upsertContract, upsertProduct |
pricing.tier_invalid | 422 | A tier is invalid. | upsertContract, upsertProduct |
pricing.tiers_empty | 422 | A tiered model needs at least one tier. | upsertContract, upsertProduct |
pricing.tiers_overlap | 422 | The tiers overlap, or an open-ended tier is not the last. | upsertContract, upsertProduct |
product_not_found | 404 | No product with this reference or article number in the company. Create it with `PUT /products/by-ref/{source}/{external_ref}`. Extra fields: product_ref, product_number | correctInvoice, createInvoice, importInvoice, upsertContract |
product_number_taken | 409 | The article number belongs to another product. | upsertProduct |
rate_limited | 429 | Too many requests from this organization's integrations in ten seconds — reading and writing count apart, all keys of the organization together, the allowance follows its plan (Limits page). Wait `retry_after` seconds (also the `Retry-After` header) and repeat. `RateLimit-Remaining` on every answer says what is left. Extra fields: retry_after | every operation |
service_busy | 503 | The server is overloaded or its database did not answer in time; the request did not complete. Your key is fine. Wait the seconds of the `Retry-After` header and repeat. A write with an `Idempotency-Key` is safe to repeat with the same key. | every operation |
tax_quote_buyer_missing | 422 | The quote names neither a `customer` nor a `buyer` — whom the sale is to decides its tax. | quoteTax |
validation_failed | 422 | The body or a parameter does not fit the schema. `errors` names each field (`loc`), the rule (`type`) and why (`msg`). Values are never echoed. Extra fields: errors | every operation |