{
  "components": {
    "parameters": {
      "Version": {
        "description": "The API version to use. Default: the current one.",
        "in": "header",
        "name": "AlphaCount-Version",
        "required": false,
        "schema": {
          "example": "2026-10-19",
          "type": "string"
        }
      }
    },
    "schemas": {
      "Balance": {
        "additionalProperties": false,
        "properties": {
          "open": {
            "description": "Cents earned, not on a statement yet.",
            "title": "Open",
            "type": "integer"
          },
          "paid": {
            "description": "Cents paid out.",
            "title": "Paid",
            "type": "integer"
          },
          "statemented": {
            "description": "Cents on an issued statement, unpaid.",
            "title": "Statemented",
            "type": "integer"
          }
        },
        "required": [
          "open",
          "statemented",
          "paid"
        ],
        "title": "Balance",
        "type": "object"
      },
      "CommissionAgreement": {
        "additionalProperties": false,
        "properties": {
          "accrue_from": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Revenue paid before this day earns nothing here.",
            "title": "Accrue From"
          },
          "anchor": {
            "enum": [
              "attribution_start",
              "first_paid_revenue"
            ],
            "title": "Anchor",
            "type": "string"
          },
          "applies_to": {
            "enum": [
              "attributed_customers",
              "all_customers"
            ],
            "title": "Applies To",
            "type": "string"
          },
          "basis": {
            "title": "Basis",
            "type": "string"
          },
          "condition_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Condition Id"
          },
          "contract_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract Reference"
          },
          "end_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Ref"
          },
          "external_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Source"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "partner_id": {
            "title": "Partner Id",
            "type": "string"
          },
          "partner_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Name"
          },
          "product_ids": {
            "items": {
              "type": "string"
            },
            "title": "Product Ids",
            "type": "array"
          },
          "start_date": {
            "format": "date",
            "title": "Start Date",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "tiers": {
            "items": {
              "$ref": "#/components/schemas/CommissionTier"
            },
            "title": "Tiers",
            "type": "array"
          }
        },
        "required": [
          "id",
          "partner_id",
          "partner_name",
          "condition_id",
          "name",
          "start_date",
          "end_date",
          "accrue_from",
          "contract_reference",
          "status",
          "external_source",
          "external_ref",
          "applies_to",
          "product_ids",
          "tiers",
          "anchor",
          "basis"
        ],
        "title": "CommissionAgreement",
        "type": "object"
      },
      "CommissionAttribution": {
        "additionalProperties": false,
        "properties": {
          "agreement_id": {
            "title": "Agreement Id",
            "type": "string"
          },
          "agreement_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agreement Name"
          },
          "confirmed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confirmed At"
          },
          "conflicts_with_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conflicts With Id"
          },
          "customer_id": {
            "title": "Customer Id",
            "type": "string"
          },
          "customer_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Name"
          },
          "end_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Ref"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "partner_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Id"
          },
          "partner_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Name"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "source_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Ref"
          },
          "start_date": {
            "format": "date",
            "title": "Start Date",
            "type": "string"
          },
          "status": {
            "enum": [
              "proposed",
              "active",
              "ended",
              "rejected"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "agreement_id",
          "agreement_name",
          "partner_id",
          "partner_name",
          "customer_id",
          "customer_name",
          "start_date",
          "end_date",
          "status",
          "source",
          "source_ref",
          "conflicts_with_id",
          "confirmed_at",
          "external_ref"
        ],
        "title": "CommissionAttribution",
        "type": "object"
      },
      "CommissionEntry": {
        "additionalProperties": false,
        "properties": {
          "agreement_id": {
            "title": "Agreement Id",
            "type": "string"
          },
          "amount_cents": {
            "title": "Amount Cents",
            "type": "integer"
          },
          "basis_cents": {
            "title": "Basis Cents",
            "type": "integer"
          },
          "contract_month": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract Month"
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "customer_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Name"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "paid_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paid At"
          },
          "partner_id": {
            "title": "Partner Id",
            "type": "string"
          },
          "partner_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Name"
          },
          "percent": {
            "title": "Percent",
            "type": "number"
          },
          "revenue_event_id": {
            "title": "Revenue Event Id",
            "type": "string"
          },
          "service_period_start": {
            "format": "date",
            "title": "Service Period Start",
            "type": "string"
          },
          "source_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Id"
          },
          "source_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Type"
          },
          "statement_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Statement Id"
          },
          "status": {
            "enum": [
              "open",
              "statemented",
              "paid",
              "void"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "partner_id",
          "partner_name",
          "agreement_id",
          "customer_id",
          "customer_name",
          "revenue_event_id",
          "source_type",
          "source_id",
          "service_period_start",
          "paid_at",
          "contract_month",
          "percent",
          "basis_cents",
          "amount_cents",
          "status",
          "statement_id"
        ],
        "title": "CommissionEntry",
        "type": "object"
      },
      "CommissionPartner": {
        "additionalProperties": false,
        "properties": {
          "balance": {
            "$ref": "#/components/schemas/Balance"
          },
          "bic": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bic"
          },
          "billing_mode": {
            "enum": [
              "self_billing",
              "settlement",
              "partner_invoice"
            ],
            "title": "Billing Mode",
            "type": "string"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "country_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country Code"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "e_invoice_format": {
            "enum": [
              "auto",
              "zugferd",
              "xrechnung",
              "none"
            ],
            "title": "E Invoice Format",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Ref"
          },
          "external_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Source"
          },
          "has_payee_account": {
            "title": "Has Payee Account",
            "type": "boolean"
          },
          "house_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "House Number"
          },
          "iban_masked": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The payout account, masked. Set only in the app, by a person.",
            "title": "Iban Masked"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "enum": [
              "sales_partner",
              "developer",
              "other"
            ],
            "title": "Kind",
            "type": "string"
          },
          "kreditorennummer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Creditor number in the company's books.",
            "title": "Kreditorennummer"
          },
          "language": {
            "enum": [
              "de",
              "en"
            ],
            "title": "Language",
            "type": "string"
          },
          "min_payout_cents": {
            "title": "Min Payout Cents",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "payee_changed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payee Changed At"
          },
          "payout_rail": {
            "title": "Payout Rail",
            "type": "string"
          },
          "self_billing_agreed_on": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Self Billing Agreed On"
          },
          "self_billing_contract_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Self Billing Contract Ref"
          },
          "self_billing_objected_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Self Billing Objected At"
          },
          "statement_cadence": {
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "title": "Statement Cadence",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Street"
          },
          "supplier_id": {
            "title": "Supplier Id",
            "type": "string"
          },
          "tax_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Number"
          },
          "tax_status": {
            "enum": [
              "domestic_regular",
              "domestic_small_business",
              "eu_reverse_charge",
              "third_country",
              "private_person"
            ],
            "title": "Tax Status",
            "type": "string"
          },
          "vat_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Id"
          },
          "zip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Zip"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "kind",
          "tax_status",
          "billing_mode",
          "self_billing_agreed_on",
          "self_billing_contract_ref",
          "self_billing_objected_at",
          "statement_cadence",
          "min_payout_cents",
          "payout_rail",
          "e_invoice_format",
          "has_payee_account",
          "iban_masked",
          "bic",
          "payee_changed_at",
          "language",
          "status",
          "notes",
          "supplier_id",
          "kreditorennummer",
          "street",
          "house_number",
          "zip",
          "city",
          "country_code",
          "vat_id",
          "tax_number",
          "external_source",
          "external_ref",
          "balance",
          "created_at"
        ],
        "title": "CommissionPartner",
        "type": "object"
      },
      "CommissionStatement": {
        "additionalProperties": false,
        "properties": {
          "cancelled_by_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancelled By Id"
          },
          "cancels_statement_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancels Statement Id"
          },
          "document_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Id"
          },
          "e_invoice_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "E Invoice Format"
          },
          "gross_cents": {
            "title": "Gross Cents",
            "type": "integer"
          },
          "has_pdf": {
            "title": "Has Pdf",
            "type": "boolean"
          },
          "has_xml": {
            "title": "Has Xml",
            "type": "boolean"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "issue_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issue Date"
          },
          "kind": {
            "description": "self_billing is a Gutschrift (self-billed invoice, VAT law); settlement a statement for a private person; partner_invoice asks the partner to invoice.",
            "enum": [
              "self_billing",
              "settlement",
              "partner_invoice"
            ],
            "title": "Kind",
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/StatementLine"
            },
            "title": "Lines",
            "type": "array"
          },
          "net_cents": {
            "title": "Net Cents",
            "type": "integer"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Number"
          },
          "objected_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Objected At"
          },
          "paid_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paid At"
          },
          "partner_id": {
            "title": "Partner Id",
            "type": "string"
          },
          "partner_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Name"
          },
          "period_end": {
            "format": "date",
            "title": "Period End",
            "type": "string"
          },
          "sent_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent At"
          },
          "sent_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent To"
          },
          "status": {
            "enum": [
              "draft",
              "issued",
              "sent",
              "cancelled",
              "objected"
            ],
            "title": "Status",
            "type": "string"
          },
          "tax_note": {
            "enum": [
              "regular",
              "small_business",
              "reverse_charge",
              "private_person"
            ],
            "title": "Tax Note",
            "type": "string"
          },
          "vat_cents": {
            "title": "Vat Cents",
            "type": "integer"
          },
          "vat_rate": {
            "title": "Vat Rate",
            "type": "number"
          }
        },
        "required": [
          "id",
          "partner_id",
          "partner_name",
          "kind",
          "status",
          "number",
          "issue_date",
          "period_end",
          "net_cents",
          "vat_rate",
          "vat_cents",
          "gross_cents",
          "tax_note",
          "lines",
          "has_pdf",
          "e_invoice_format",
          "has_xml",
          "document_id",
          "cancels_statement_id",
          "cancelled_by_id",
          "objected_at",
          "sent_at",
          "sent_to",
          "paid_at"
        ],
        "title": "CommissionStatement",
        "type": "object"
      },
      "CommissionTier": {
        "additionalProperties": false,
        "properties": {
          "from_month": {
            "title": "From Month",
            "type": "integer"
          },
          "percent": {
            "title": "Percent",
            "type": "number"
          },
          "to_month": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "To Month"
          }
        },
        "required": [
          "from_month",
          "to_month",
          "percent"
        ],
        "title": "CommissionTier",
        "type": "object"
      },
      "Contract": {
        "additionalProperties": false,
        "properties": {
          "billing_interval": {
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "title": "Billing Interval",
            "type": "string"
          },
          "billing_starts_on": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Starts On"
          },
          "customer_external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer External Ref"
          },
          "cycles": {
            "items": {
              "$ref": "#/components/schemas/ContractCycle"
            },
            "title": "Cycles",
            "type": "array"
          },
          "end_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Ref"
          },
          "external_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Source"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "invoice_mode": {
            "enum": [
              "draft",
              "issue",
              "issue_send"
            ],
            "title": "Invoice Mode",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ContractItem"
            },
            "title": "Items",
            "type": "array"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "next_billing_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Billing Date"
          },
          "number": {
            "title": "Number",
            "type": "string"
          },
          "payment_terms_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payment Terms Days"
          },
          "start_date": {
            "format": "date",
            "title": "Start Date",
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "active",
              "paused",
              "cancelled",
              "ended"
            ],
            "title": "Status",
            "type": "string"
          },
          "usage_open_from": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Usage before this day is billed already and refused.",
            "title": "Usage Open From"
          }
        },
        "required": [
          "id",
          "number",
          "external_source",
          "external_ref",
          "customer_external_ref",
          "name",
          "status",
          "billing_interval",
          "start_date",
          "billing_starts_on",
          "end_date",
          "invoice_mode",
          "payment_terms_days",
          "next_billing_date",
          "usage_open_from",
          "items",
          "cycles"
        ],
        "title": "Contract",
        "type": "object"
      },
      "ContractCycle": {
        "additionalProperties": false,
        "properties": {
          "end": {
            "format": "date",
            "title": "End",
            "type": "string"
          },
          "invoice_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Id"
          },
          "invoice_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Number"
          },
          "invoice_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Status"
          },
          "start": {
            "format": "date",
            "title": "Start",
            "type": "string"
          },
          "status": {
            "enum": [
              "billed",
              "skipped",
              "paused",
              "failed"
            ],
            "title": "Status",
            "type": "string"
          },
          "total_net": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Net"
          }
        },
        "required": [
          "start",
          "end",
          "status",
          "invoice_id",
          "invoice_number",
          "invoice_status",
          "total_net"
        ],
        "title": "ContractCycle",
        "type": "object"
      },
      "ContractItem": {
        "additionalProperties": false,
        "properties": {
          "billing_timing": {
            "enum": [
              "advance",
              "arrears"
            ],
            "title": "Billing Timing",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "ends_after": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last day the item is billed for.",
            "title": "Ends After"
          },
          "pricing_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Model"
          },
          "product_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Product Ref"
          },
          "quantity": {
            "title": "Quantity",
            "type": "string"
          },
          "ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your reference of the item.",
            "title": "Ref"
          },
          "unit_price_net": {
            "description": "Agreed price, frozen when the item was added.",
            "title": "Unit Price Net",
            "type": "string"
          }
        },
        "required": [
          "ref",
          "product_ref",
          "description",
          "quantity",
          "billing_timing",
          "unit_price_net",
          "pricing_model",
          "ends_after"
        ],
        "title": "ContractItem",
        "type": "object"
      },
      "Customer": {
        "additionalProperties": false,
        "properties": {
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "contact_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Name"
          },
          "country_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 3166-1 alpha-2.",
            "title": "Country Code"
          },
          "customer_type": {
            "enum": [
              "business",
              "private"
            ],
            "title": "Customer Type",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your id of the customer.",
            "title": "External Ref"
          },
          "external_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your system's name, as in the path.",
            "title": "External Source"
          },
          "house_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "House Number"
          },
          "id": {
            "description": "AlphaCount's id of the customer.",
            "title": "Id",
            "type": "string"
          },
          "kundennummer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Customer number in the company's books (debtor number).",
            "title": "Kundennummer"
          },
          "leitweg_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Routing id of a public-sector buyer (XRechnung).",
            "title": "Leitweg Id"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Street"
          },
          "vat_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Id"
          },
          "zip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Zip"
          }
        },
        "required": [
          "id",
          "kundennummer",
          "external_source",
          "external_ref",
          "name",
          "email",
          "street",
          "house_number",
          "zip",
          "city",
          "country_code",
          "vat_id",
          "customer_type",
          "leitweg_id",
          "contact_name"
        ],
        "title": "Customer",
        "type": "object"
      },
      "ErrorDetail": {
        "additionalProperties": true,
        "description": "Every refusal: a stable ``code`` (see the error reference) and, for some\ncodes, fields that say more — ``errors`` for ``validation_failed``,\n``scope`` for ``api_key_scope_missing``, ``args``, ``message(s)``.",
        "properties": {
          "code": {
            "description": "Stable, machine-readable error code.",
            "examples": [
              "customer_not_found"
            ],
            "title": "Code",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "title": "ErrorDetail",
        "type": "object"
      },
      "ErrorResponse": {
        "properties": {
          "detail": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        },
        "required": [
          "detail"
        ],
        "title": "ErrorResponse",
        "type": "object"
      },
      "Invoice": {
        "additionalProperties": false,
        "properties": {
          "amount_paid": {
            "title": "Amount Paid",
            "type": "string"
          },
          "cancelled_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InvoiceRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "cancels_invoice": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InvoiceRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "contract_external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The contract that billed it, if any.",
            "title": "Contract External Ref"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "customer_external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer External Ref"
          },
          "due_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due Date"
          },
          "dunning_level": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Highest dunning level sent (0 = payment reminder).",
            "title": "Dunning Level"
          },
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Ref"
          },
          "external_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Source"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "issue_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issue Date"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Invoice number; null while a draft.",
            "title": "Number"
          },
          "overdue": {
            "title": "Overdue",
            "type": "boolean"
          },
          "paid_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Paid in full, UTC.",
            "title": "Paid At"
          },
          "sent_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "First mail, UTC.",
            "title": "Sent At"
          },
          "service_period": {
            "$ref": "#/components/schemas/ServicePeriod"
          },
          "status": {
            "enum": [
              "draft",
              "issued",
              "sent",
              "partially_paid",
              "paid",
              "cancelled"
            ],
            "title": "Status",
            "type": "string"
          },
          "total_gross": {
            "title": "Total Gross",
            "type": "string"
          },
          "total_net": {
            "title": "Total Net",
            "type": "string"
          },
          "total_tax": {
            "title": "Total Tax",
            "type": "string"
          },
          "type": {
            "description": "A cancellation invoice (Stornorechnung) is type storno with negative amounts.",
            "enum": [
              "invoice",
              "storno"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "status",
          "type",
          "external_source",
          "external_ref",
          "customer_external_ref",
          "contract_external_ref",
          "total_net",
          "total_tax",
          "total_gross",
          "amount_paid",
          "currency",
          "issue_date",
          "due_date",
          "service_period",
          "sent_at",
          "paid_at",
          "overdue",
          "dunning_level",
          "cancels_invoice",
          "cancelled_by"
        ],
        "title": "Invoice",
        "type": "object"
      },
      "InvoiceCreated": {
        "additionalProperties": false,
        "properties": {
          "amount_paid": {
            "title": "Amount Paid",
            "type": "string"
          },
          "cancelled_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InvoiceRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "cancels_invoice": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InvoiceRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "contract_external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The contract that billed it, if any.",
            "title": "Contract External Ref"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "customer_external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer External Ref"
          },
          "due_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due Date"
          },
          "dunning_level": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Highest dunning level sent (0 = payment reminder).",
            "title": "Dunning Level"
          },
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Ref"
          },
          "external_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Source"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "issue_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issue Date"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Invoice number; null while a draft.",
            "title": "Number"
          },
          "overdue": {
            "title": "Overdue",
            "type": "boolean"
          },
          "paid_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Paid in full, UTC.",
            "title": "Paid At"
          },
          "send_error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SendError"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when send was requested and the mail failed; the invoice exists either way."
          },
          "sent_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "First mail, UTC.",
            "title": "Sent At"
          },
          "service_period": {
            "$ref": "#/components/schemas/ServicePeriod"
          },
          "status": {
            "enum": [
              "draft",
              "issued",
              "sent",
              "partially_paid",
              "paid",
              "cancelled"
            ],
            "title": "Status",
            "type": "string"
          },
          "total_gross": {
            "title": "Total Gross",
            "type": "string"
          },
          "total_net": {
            "title": "Total Net",
            "type": "string"
          },
          "total_tax": {
            "title": "Total Tax",
            "type": "string"
          },
          "type": {
            "description": "A cancellation invoice (Stornorechnung) is type storno with negative amounts.",
            "enum": [
              "invoice",
              "storno"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "status",
          "type",
          "external_source",
          "external_ref",
          "customer_external_ref",
          "contract_external_ref",
          "total_net",
          "total_tax",
          "total_gross",
          "amount_paid",
          "currency",
          "issue_date",
          "due_date",
          "service_period",
          "sent_at",
          "paid_at",
          "overdue",
          "dunning_level",
          "cancels_invoice",
          "cancelled_by",
          "send_error"
        ],
        "title": "InvoiceCreated",
        "type": "object"
      },
      "InvoiceList": {
        "additionalProperties": false,
        "properties": {
          "invoices": {
            "items": {
              "$ref": "#/components/schemas/Invoice"
            },
            "title": "Invoices",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          }
        },
        "required": [
          "invoices",
          "limit",
          "offset"
        ],
        "title": "InvoiceList",
        "type": "object"
      },
      "InvoiceRef": {
        "additionalProperties": false,
        "properties": {
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Ref"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Number"
          }
        },
        "required": [
          "id",
          "number"
        ],
        "title": "InvoiceRef",
        "type": "object"
      },
      "PartnerApiAgreement": {
        "additionalProperties": false,
        "description": "``PUT /commission-agreements/by-ref/{source}/{ref}``. The terms count on\ncreate only — a running agreement's terms are frozen (409 on change).",
        "properties": {
          "accrue_from": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accrue From"
          },
          "anchor": {
            "anyOf": [
              {
                "enum": [
                  "attribution_start",
                  "first_paid_revenue"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Anchor"
          },
          "applies_to": {
            "anyOf": [
              {
                "enum": [
                  "attributed_customers",
                  "all_customers"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Applies To"
          },
          "contract_reference": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract Reference"
          },
          "end_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "partner_ref": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
            "title": "Partner Ref",
            "type": "string"
          },
          "product_ids": {
            "anyOf": [
              {
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Product Ids"
          },
          "product_numbers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 200,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Product Numbers"
          },
          "start_date": {
            "format": "date",
            "title": "Start Date",
            "type": "string"
          },
          "tiers": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/Tier"
                },
                "maxItems": 20,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tiers"
          }
        },
        "required": [
          "partner_ref",
          "start_date"
        ],
        "title": "PartnerApiAgreement",
        "type": "object"
      },
      "PartnerApiAttribution": {
        "additionalProperties": false,
        "description": "``PUT /commission-attributions/by-ref/{source}/{ref}``.",
        "properties": {
          "agreement_ref": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
            "title": "Agreement Ref",
            "type": "string"
          },
          "customer": {
            "$ref": "#/components/schemas/PartnerCustomerRef"
          },
          "end_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "start_date": {
            "format": "date",
            "title": "Start Date",
            "type": "string"
          }
        },
        "required": [
          "agreement_ref",
          "customer",
          "start_date"
        ],
        "title": "PartnerApiAttribution",
        "type": "object"
      },
      "PartnerApiCommissionPartner": {
        "additionalProperties": false,
        "description": "``PUT /commission-partners/by-ref/{source}/{ref}``.",
        "properties": {
          "billing_mode": {
            "anyOf": [
              {
                "enum": [
                  "self_billing",
                  "settlement",
                  "partner_invoice"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Mode"
          },
          "city": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "country_code": {
            "anyOf": [
              {
                "maxLength": 2,
                "minLength": 2,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country Code"
          },
          "e_invoice_format": {
            "anyOf": [
              {
                "enum": [
                  "auto",
                  "zugferd",
                  "xrechnung",
                  "none"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "E Invoice Format"
          },
          "email": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "house_number": {
            "anyOf": [
              {
                "maxLength": 20,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "House Number"
          },
          "kind": {
            "anyOf": [
              {
                "enum": [
                  "sales_partner",
                  "developer",
                  "other"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind"
          },
          "language": {
            "anyOf": [
              {
                "enum": [
                  "de",
                  "en"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "min_payout_cents": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Payout Cents"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "notes": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "payout_rail": {
            "anyOf": [
              {
                "enum": [
                  "external",
                  "sepa",
                  "finapi",
                  "stripe_connect"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Rail"
          },
          "self_billing_agreed_on": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Self Billing Agreed On"
          },
          "self_billing_contract_ref": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Self Billing Contract Ref"
          },
          "statement_cadence": {
            "anyOf": [
              {
                "enum": [
                  "month",
                  "quarter",
                  "year"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Statement Cadence"
          },
          "street": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Street"
          },
          "tax_number": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Number"
          },
          "tax_status": {
            "anyOf": [
              {
                "enum": [
                  "domestic_regular",
                  "domestic_small_business",
                  "eu_reverse_charge",
                  "third_country",
                  "private_person"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Status"
          },
          "vat_id": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Id"
          },
          "zip": {
            "anyOf": [
              {
                "maxLength": 10,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Zip"
          }
        },
        "required": [
          "name"
        ],
        "title": "PartnerApiCommissionPartner",
        "type": "object"
      },
      "PartnerApiRevenueEvent": {
        "additionalProperties": false,
        "description": "``POST /revenue-events`` — revenue AlphaCount cannot see itself (paid\nelsewhere). Idempotent by ``(source, external_ref)``. Negative with\n``reverses_ref`` for a refund of an earlier event.",
        "properties": {
          "currency": {
            "const": "EUR",
            "default": "EUR",
            "title": "Currency",
            "type": "string"
          },
          "customer": {
            "$ref": "#/components/schemas/PartnerCustomerRef"
          },
          "external_ref": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
            "title": "External Ref",
            "type": "string"
          },
          "lines": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PartnerApiRevenueLine"
                },
                "maxItems": 200,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lines"
          },
          "net_amount": {
            "pattern": "^-?\\d{1,9}(\\.\\d{1,2})?$",
            "title": "Net Amount",
            "type": "string"
          },
          "paid_at": {
            "format": "date",
            "title": "Paid At",
            "type": "string"
          },
          "partner_ref": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Partner Ref"
          },
          "reverses_ref": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reverses Ref"
          },
          "service_period": {
            "$ref": "#/components/schemas/PartnerServicePeriod"
          },
          "source": {
            "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "source",
          "external_ref",
          "customer",
          "paid_at",
          "service_period",
          "net_amount"
        ],
        "title": "PartnerApiRevenueEvent",
        "type": "object"
      },
      "PartnerApiRevenueLine": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "net_amount": {
            "pattern": "^-?\\d{1,9}(\\.\\d{1,2})?$",
            "title": "Net Amount",
            "type": "string"
          },
          "product_number": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Product Number"
          }
        },
        "required": [
          "net_amount"
        ],
        "title": "PartnerApiRevenueLine",
        "type": "object"
      },
      "PartnerContractItem": {
        "additionalProperties": false,
        "description": "A building block of the contract under the caller's own reference — the\nkey by which a later ``PUT`` changes its quantity and usage names it.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "product_number": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Product Number"
          },
          "product_ref": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Product Ref"
          },
          "quantity": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,10}|(?=[\\d.]{1,15}0*$)\\d{0,10}\\.\\d{0,4}0*$)",
                "type": "string"
              }
            ],
            "default": "1",
            "title": "Quantity"
          },
          "ref": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
            "title": "Ref",
            "type": "string"
          }
        },
        "required": [
          "ref"
        ],
        "title": "PartnerContractItem",
        "type": "object"
      },
      "PartnerContractUpsert": {
        "additionalProperties": false,
        "description": "``PUT /contracts/by-ref/{source}/{external_ref}``. Interval and start are\nfixed once the contract runs; quantities change from the next cycle, an\nitem left out stops after the current one.",
        "properties": {
          "billing_interval": {
            "default": "month",
            "enum": [
              "month",
              "quarter",
              "year"
            ],
            "title": "Billing Interval",
            "type": "string"
          },
          "billing_starts_on": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Starts On"
          },
          "customer": {
            "$ref": "#/components/schemas/PartnerCustomerRef"
          },
          "end_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "invoice_mode": {
            "default": "draft",
            "enum": [
              "draft",
              "issue",
              "issue_send"
            ],
            "title": "Invoice Mode",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/PartnerContractItem"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Items",
            "type": "array"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "payment_terms_days": {
            "anyOf": [
              {
                "maximum": 365.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payment Terms Days"
          },
          "start_date": {
            "format": "date",
            "title": "Start Date",
            "type": "string"
          },
          "status": {
            "default": "active",
            "enum": [
              "draft",
              "active",
              "paused"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "customer",
          "name",
          "start_date",
          "items"
        ],
        "title": "PartnerContractUpsert",
        "type": "object"
      },
      "PartnerCustomerRef": {
        "additionalProperties": false,
        "properties": {
          "external_ref": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
            "title": "External Ref",
            "type": "string"
          },
          "source": {
            "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "source",
          "external_ref"
        ],
        "title": "PartnerCustomerRef",
        "type": "object"
      },
      "PartnerCustomerUpsert": {
        "additionalProperties": false,
        "description": "``PUT /customers/by-ref/{source}/{external_ref}``. Replaces every field\nlisted here; fields the partner API does not own (customer number, tags,\nphone, booking defaults) stay as they are.",
        "properties": {
          "city": {
            "maxLength": 100,
            "minLength": 1,
            "title": "City",
            "type": "string"
          },
          "contact_name": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Name"
          },
          "country_code": {
            "maxLength": 2,
            "minLength": 2,
            "title": "Country Code",
            "type": "string"
          },
          "customer_type": {
            "default": "business",
            "enum": [
              "business",
              "private"
            ],
            "title": "Customer Type",
            "type": "string"
          },
          "email": {
            "maxLength": 255,
            "title": "Email",
            "type": "string"
          },
          "house_number": {
            "anyOf": [
              {
                "maxLength": 20,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "House Number"
          },
          "leitweg_id": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Leitweg Id"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "street": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Street",
            "type": "string"
          },
          "vat_id": {
            "anyOf": [
              {
                "maxLength": 30,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vat Id"
          },
          "zip": {
            "maxLength": 10,
            "minLength": 1,
            "title": "Zip",
            "type": "string"
          }
        },
        "required": [
          "name",
          "email",
          "street",
          "zip",
          "city",
          "country_code"
        ],
        "title": "PartnerCustomerUpsert",
        "type": "object"
      },
      "PartnerInvoiceAttribution": {
        "additionalProperties": false,
        "description": "Optional on ``POST /invoices``: the customer came from this partner\n(docs/technical/commissions.md). ``source`` defaults to the customer's.",
        "properties": {
          "agreement_ref": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agreement Ref"
          },
          "partner_ref": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
            "title": "Partner Ref",
            "type": "string"
          },
          "source": {
            "anyOf": [
              {
                "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "required": [
          "partner_ref"
        ],
        "title": "PartnerInvoiceAttribution",
        "type": "object"
      },
      "PartnerInvoiceCreate": {
        "additionalProperties": false,
        "description": "``POST /invoices`` (with the ``Idempotency-Key`` header).",
        "properties": {
          "attribution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PartnerInvoiceAttribution"
              },
              {
                "type": "null"
              }
            ]
          },
          "customer": {
            "$ref": "#/components/schemas/PartnerCustomerRef"
          },
          "external_ref": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
            "title": "External Ref",
            "type": "string"
          },
          "issue": {
            "default": false,
            "title": "Issue",
            "type": "boolean"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/PartnerInvoiceLine"
            },
            "maxItems": 200,
            "minItems": 1,
            "title": "Lines",
            "type": "array"
          },
          "notes": {
            "anyOf": [
              {
                "maxLength": 2000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "payment_terms_days": {
            "anyOf": [
              {
                "maximum": 365.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payment Terms Days"
          },
          "send": {
            "default": false,
            "title": "Send",
            "type": "boolean"
          },
          "service_period": {
            "$ref": "#/components/schemas/PartnerServicePeriod"
          }
        },
        "required": [
          "customer",
          "external_ref",
          "lines",
          "service_period"
        ],
        "title": "PartnerInvoiceCreate",
        "type": "object"
      },
      "PartnerInvoiceLine": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "maxLength": 1000,
            "minLength": 1,
            "title": "Description",
            "type": "string"
          },
          "product_number": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Product Number"
          },
          "product_ref": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Product Ref"
          },
          "quantity": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,8}|(?=[\\d.]{1,13}0*$)\\d{0,8}\\.\\d{0,4}0*$)",
                "type": "string"
              }
            ],
            "title": "Quantity"
          },
          "unit": {
            "anyOf": [
              {
                "maxLength": 20,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "unit_price_net": {
            "pattern": "^\\d{1,9}(\\.\\d{1,2})?$",
            "title": "Unit Price Net",
            "type": "string"
          },
          "vat_rate": {
            "enum": [
              0,
              7,
              19
            ],
            "title": "Vat Rate",
            "type": "integer"
          }
        },
        "required": [
          "description",
          "quantity",
          "unit_price_net",
          "vat_rate"
        ],
        "title": "PartnerInvoiceLine",
        "type": "object"
      },
      "PartnerProductTier": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              }
            ],
            "title": "From"
          },
          "to": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "To"
          },
          "unit_price": {
            "pattern": "^\\d{1,9}(\\.\\d{1,4})?$",
            "title": "Unit Price",
            "type": "string"
          }
        },
        "required": [
          "from",
          "unit_price"
        ],
        "title": "PartnerProductTier",
        "type": "object"
      },
      "PartnerProductUpsert": {
        "additionalProperties": false,
        "description": "``PUT /products/by-ref/{source}/{external_ref}``. Replaces the fields\nlisted here; the article number is AlphaCount's (given on create, else\nassigned).",
        "properties": {
          "article_number": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Article Number"
          },
          "billing_interval": {
            "default": "one_off",
            "enum": [
              "one_off",
              "month",
              "quarter",
              "year"
            ],
            "title": "Billing Interval",
            "type": "string"
          },
          "billing_timing": {
            "default": "advance",
            "enum": [
              "advance",
              "arrears"
            ],
            "title": "Billing Timing",
            "type": "string"
          },
          "included_quantity": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,10}|(?=[\\d.]{1,15}0*$)\\d{0,10}\\.\\d{0,4}0*$)",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Included Quantity"
          },
          "kind": {
            "default": "service",
            "enum": [
              "base_fee",
              "seats",
              "usage",
              "credits",
              "sla",
              "service"
            ],
            "title": "Kind",
            "type": "string"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "overage_unit_price": {
            "anyOf": [
              {
                "pattern": "^\\d{1,9}(\\.\\d{1,4})?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Overage Unit Price"
          },
          "price_tiers": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PartnerProductTier"
                },
                "maxItems": 20,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Tiers"
          },
          "pricing_model": {
            "default": "per_unit",
            "enum": [
              "flat",
              "per_unit",
              "tiered_volume",
              "tiered_graduated",
              "package"
            ],
            "title": "Pricing Model",
            "type": "string"
          },
          "unit": {
            "anyOf": [
              {
                "maxLength": 20,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "unit_price_net": {
            "pattern": "^\\d{1,9}(\\.\\d{1,4})?$",
            "title": "Unit Price Net",
            "type": "string"
          },
          "vat_rate": {
            "enum": [
              0,
              7,
              19
            ],
            "title": "Vat Rate",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "unit_price_net",
          "vat_rate"
        ],
        "title": "PartnerProductUpsert",
        "type": "object"
      },
      "PartnerServicePeriod": {
        "additionalProperties": false,
        "properties": {
          "end": {
            "format": "date",
            "title": "End",
            "type": "string"
          },
          "start": {
            "format": "date",
            "title": "Start",
            "type": "string"
          }
        },
        "required": [
          "start",
          "end"
        ],
        "title": "PartnerServicePeriod",
        "type": "object"
      },
      "PartnerUsageRecord": {
        "additionalProperties": false,
        "properties": {
          "external_ref": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
            "title": "External Ref",
            "type": "string"
          },
          "item_ref": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
            "title": "Item Ref",
            "type": "string"
          },
          "occurred_on": {
            "format": "date",
            "title": "Occurred On",
            "type": "string"
          },
          "quantity": {
            "anyOf": [
              {
                "exclusiveMinimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,10}|(?=[\\d.]{1,15}0*$)\\d{0,10}\\.\\d{0,4}0*$)",
                "type": "string"
              }
            ],
            "title": "Quantity"
          }
        },
        "required": [
          "item_ref",
          "quantity",
          "occurred_on",
          "external_ref"
        ],
        "title": "PartnerUsageRecord",
        "type": "object"
      },
      "PartnerUsageReport": {
        "additionalProperties": false,
        "properties": {
          "records": {
            "items": {
              "$ref": "#/components/schemas/PartnerUsageRecord"
            },
            "maxItems": 500,
            "minItems": 1,
            "title": "Records",
            "type": "array"
          }
        },
        "required": [
          "records"
        ],
        "title": "PartnerUsageReport",
        "type": "object"
      },
      "PriceTier": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "title": "From",
            "type": "number"
          },
          "to": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "To"
          },
          "unit_price": {
            "title": "Unit Price",
            "type": "number"
          }
        },
        "required": [
          "from",
          "to",
          "unit_price"
        ],
        "title": "PriceTier",
        "type": "object"
      },
      "Product": {
        "additionalProperties": false,
        "properties": {
          "article_number": {
            "description": "Article number in the company's books.",
            "title": "Article Number",
            "type": "string"
          },
          "billing_interval": {
            "anyOf": [
              {
                "enum": [
                  "one_off",
                  "month",
                  "quarter",
                  "year"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Interval"
          },
          "billing_timing": {
            "anyOf": [
              {
                "enum": [
                  "advance",
                  "arrears"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Timing"
          },
          "external_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Ref"
          },
          "external_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Source"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "included_quantity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quota per period; for package, the package size.",
            "title": "Included Quantity"
          },
          "kind": {
            "anyOf": [
              {
                "enum": [
                  "base_fee",
                  "seats",
                  "usage",
                  "credits",
                  "sla",
                  "service"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "overage_unit_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Price per unit above the quota.",
            "title": "Overage Unit Price"
          },
          "price_tiers": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PriceTier"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Tiers"
          },
          "pricing_model": {
            "anyOf": [
              {
                "enum": [
                  "flat",
                  "per_unit",
                  "tiered_volume",
                  "tiered_graduated",
                  "package"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Model"
          },
          "revenue_account": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Revenue account the lines of this product are booked to.",
            "title": "Revenue Account"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "unit_price_net": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Price of one unit (of the whole block for flat, of one package for package).",
            "title": "Unit Price Net"
          },
          "vat_rate": {
            "title": "Vat Rate",
            "type": "number"
          }
        },
        "required": [
          "id",
          "article_number",
          "external_source",
          "external_ref",
          "name",
          "unit_price_net",
          "vat_rate",
          "unit",
          "kind",
          "pricing_model",
          "price_tiers",
          "billing_interval",
          "billing_timing",
          "included_quantity",
          "overage_unit_price",
          "revenue_account"
        ],
        "title": "Product",
        "type": "object"
      },
      "RevenueEventResult": {
        "additionalProperties": false,
        "properties": {
          "customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "net_cents": {
            "title": "Net Cents",
            "type": "integer"
          },
          "paid_at": {
            "format": "date",
            "title": "Paid At",
            "type": "string"
          },
          "processed": {
            "description": "Shares computed already.",
            "title": "Processed",
            "type": "boolean"
          },
          "service_period_start": {
            "format": "date",
            "title": "Service Period Start",
            "type": "string"
          },
          "source_id": {
            "title": "Source Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "source_id",
          "customer_id",
          "paid_at",
          "service_period_start",
          "net_cents",
          "processed"
        ],
        "title": "RevenueEventResult",
        "type": "object"
      },
      "SendError": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "SendError",
        "type": "object"
      },
      "ServicePeriod": {
        "additionalProperties": false,
        "properties": {
          "end": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End"
          },
          "start": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start"
          }
        },
        "required": [
          "start",
          "end"
        ],
        "title": "ServicePeriod",
        "type": "object"
      },
      "StatementLine": {
        "additionalProperties": false,
        "properties": {
          "amount_cents": {
            "title": "Amount Cents",
            "type": "integer"
          },
          "basis_cents": {
            "title": "Basis Cents",
            "type": "integer"
          },
          "contract_month": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contract Month"
          },
          "customer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer"
          },
          "entry_id": {
            "title": "Entry Id",
            "type": "string"
          },
          "paid_at": {
            "title": "Paid At",
            "type": "string"
          },
          "percent": {
            "title": "Percent",
            "type": "number"
          },
          "service_period_start": {
            "title": "Service Period Start",
            "type": "string"
          }
        },
        "required": [
          "entry_id",
          "paid_at",
          "customer",
          "service_period_start",
          "contract_month",
          "percent",
          "basis_cents",
          "amount_cents"
        ],
        "title": "StatementLine",
        "type": "object"
      },
      "Tier": {
        "additionalProperties": false,
        "properties": {
          "from_month": {
            "minimum": 1.0,
            "title": "From Month",
            "type": "integer"
          },
          "percent": {
            "anyOf": [
              {
                "maximum": 100.0,
                "minimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,3}|(?=[\\d.]{1,8}0*$)\\d{0,3}\\.\\d{0,4}0*$)",
                "type": "string"
              }
            ],
            "title": "Percent"
          },
          "to_month": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "To Month"
          }
        },
        "required": [
          "from_month",
          "percent"
        ],
        "title": "Tier",
        "type": "object"
      },
      "UsageReportResult": {
        "additionalProperties": false,
        "properties": {
          "duplicates": {
            "description": "Records whose external_ref was known already; not stored again.",
            "title": "Duplicates",
            "type": "integer"
          },
          "recorded": {
            "title": "Recorded",
            "type": "integer"
          }
        },
        "required": [
          "recorded",
          "duplicates"
        ],
        "title": "UsageReportResult",
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "bearerFormat": "ab_…",
        "description": "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.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "The AlphaCount API lets your product keep customers, products, invoices,\ncontracts and revenue shares in an AlphaCount company — by your own\nreferences — and have AlphaCount number, book, render, send and dun them.\n\nAuthenticate with an API key (`Authorization: Bearer ab_…`). A key belongs to\nexactly one company and carries scopes. Every refusal is\n`{\"detail\": {\"code\": \"…\"}}` with a stable code from the error reference.\nVersions are dates; send `AlphaCount-Version` to pin one.\n",
    "title": "AlphaCount API",
    "version": "2026-10-19"
  },
  "openapi": "3.1.0",
  "paths": {
    "/commission-agreements/by-ref/{source}/{external_ref}": {
      "put": {
        "description": "An agreement between the company and a partner: which revenue counts (customers attributed to the partner, or all customers, optionally limited to products), the tiers by contract month (for example 15 % in months 1–12, then 5 %), and from when. Terms are frozen once made; to change them, make a new agreement. Scope `partner:commissions:write`.",
        "operationId": "upsertCommissionAgreement",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
              "title": "Source",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external_ref",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
              "title": "External Ref",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "partner_ref": "lernlink",
                "start_date": "2026-01-01",
                "tiers": [
                  {
                    "from_month": 1,
                    "percent": 15,
                    "to_month": 12
                  },
                  {
                    "from_month": 13,
                    "percent": 5,
                    "to_month": null
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/PartnerApiAgreement"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "accrue_from": null,
                  "anchor": "attribution_start",
                  "applies_to": "attributed_customers",
                  "basis": "paid_net",
                  "condition_id": null,
                  "contract_reference": null,
                  "end_date": null,
                  "external_ref": "lernlink-2026",
                  "external_source": "alphalearn",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "name": "lern.link GmbH",
                  "partner_id": "00000000-0000-4000-8000-000000000002",
                  "partner_name": "lern.link GmbH",
                  "product_ids": [],
                  "start_date": "2026-01-01",
                  "status": "active",
                  "tiers": [
                    {
                      "from_month": 1,
                      "percent": 15.0,
                      "to_month": 12
                    },
                    {
                      "from_month": 13,
                      "percent": 5.0,
                      "to_month": null
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/CommissionAgreement"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "accrue_from": null,
                  "anchor": "attribution_start",
                  "applies_to": "attributed_customers",
                  "basis": "paid_net",
                  "condition_id": null,
                  "contract_reference": null,
                  "end_date": null,
                  "external_ref": "lernlink-2026",
                  "external_source": "alphalearn",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "name": "lern.link GmbH",
                  "partner_id": "00000000-0000-4000-8000-000000000002",
                  "partner_name": "lern.link GmbH",
                  "product_ids": [],
                  "start_date": "2026-01-01",
                  "status": "active",
                  "tiers": [
                    {
                      "from_month": 1,
                      "percent": 15.0,
                      "to_month": 12
                    },
                    {
                      "from_month": 13,
                      "percent": 5.0,
                      "to_month": null
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/CommissionAgreement"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.condition_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.agreement_partner_mismatch"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.anchor_invalid"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:commissions:write"
            ]
          }
        ],
        "summary": "Create or update an agreement",
        "tags": [
          "Revenue share"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "commission.agreement_partner_mismatch",
          "commission.agreement_terms_frozen",
          "commission.anchor_invalid",
          "commission.applies_to_invalid",
          "commission.condition_not_found",
          "commission.date_range_invalid",
          "commission.partner_not_found",
          "commission.product_not_found",
          "commission.product_scope_invalid",
          "commission.start_date_missing",
          "commission.tiers_empty",
          "conflict_retry",
          "validation_failed"
        ]
      }
    },
    "/commission-attributions/by-ref/{source}/{external_ref}": {
      "put": {
        "description": "This customer came from that agreement's partner. Attributions made through the API are active at once. Scope `partner:commissions:write`.",
        "operationId": "upsertCommissionAttribution",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
              "title": "Source",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external_ref",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
              "title": "External Ref",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "agreement_ref": "lernlink-2026",
                "customer": {
                  "external_ref": "org-1",
                  "source": "alphalearn"
                },
                "start_date": "2026-10-01"
              },
              "schema": {
                "$ref": "#/components/schemas/PartnerApiAttribution"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "agreement_id": "00000000-0000-4000-8000-000000000002",
                  "agreement_name": "lern.link GmbH",
                  "confirmed_at": "2026-10-19T15:09:58.234062",
                  "conflicts_with_id": null,
                  "customer_id": "00000000-0000-4000-8000-000000000004",
                  "customer_name": "Musterschule",
                  "end_date": null,
                  "external_ref": "org-1-lernlink",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "partner_id": "00000000-0000-4000-8000-000000000003",
                  "partner_name": "lern.link GmbH",
                  "source": "api",
                  "source_ref": "alphalearn:org-1-lernlink",
                  "start_date": "2026-10-01",
                  "status": "active"
                },
                "schema": {
                  "$ref": "#/components/schemas/CommissionAttribution"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "agreement_id": "00000000-0000-4000-8000-000000000002",
                  "agreement_name": "lern.link GmbH",
                  "confirmed_at": "2026-10-19T15:09:58.234062",
                  "conflicts_with_id": null,
                  "customer_id": "00000000-0000-4000-8000-000000000004",
                  "customer_name": "Musterschule",
                  "end_date": null,
                  "external_ref": "org-1-lernlink",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "partner_id": "00000000-0000-4000-8000-000000000003",
                  "partner_name": "lern.link GmbH",
                  "source": "api",
                  "source_ref": "alphalearn:org-1-lernlink",
                  "start_date": "2026-10-01",
                  "status": "active"
                },
                "schema": {
                  "$ref": "#/components/schemas/CommissionAttribution"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.agreement_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.attribution_conflict"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.agreement_takes_no_attributions"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:commissions:write"
            ]
          }
        ],
        "summary": "Attribute a customer to an agreement",
        "tags": [
          "Revenue share"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "commission.agreement_not_found",
          "commission.agreement_takes_no_attributions",
          "commission.attribution_conflict",
          "commission.attribution_reference_mismatch",
          "commission.date_range_invalid",
          "conflict_retry",
          "customer_not_found",
          "validation_failed"
        ]
      }
    },
    "/commission-entries": {
      "get": {
        "description": "The ledger: one entry per partner and paid revenue, with basis, contract month, percent and share in cents. Scope `partner:commissions:read`.",
        "operationId": "listCommissionEntries",
        "parameters": [
          {
            "in": "query",
            "name": "partner_source",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Partner Source"
            }
          },
          {
            "in": "query",
            "name": "partner_ref",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Partner Ref"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 500,
              "maximum": 5000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "agreement_id": "00000000-0000-4000-8000-000000000003",
                    "amount_cents": 15000,
                    "basis_cents": 100000,
                    "contract_month": 1,
                    "customer_id": "00000000-0000-4000-8000-000000000004",
                    "customer_name": null,
                    "id": "00000000-0000-4000-8000-000000000001",
                    "paid_at": "2026-10-20T00:00:00",
                    "partner_id": "00000000-0000-4000-8000-000000000002",
                    "partner_name": "lern.link GmbH",
                    "percent": 15.0,
                    "revenue_event_id": "00000000-0000-4000-8000-000000000005",
                    "service_period_start": "2026-10-01",
                    "source_id": "00000000-0000-4000-8000-000000000006",
                    "source_type": "invoice_payment",
                    "statement_id": null,
                    "status": "open"
                  }
                ],
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CommissionEntry"
                  },
                  "title": "Response 200 Listcommissionentries",
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.partner_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:commissions:read"
            ]
          }
        ],
        "summary": "List commission entries",
        "tags": [
          "Revenue share"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "commission.partner_not_found",
          "validation_failed"
        ]
      }
    },
    "/commission-partners/by-ref/{source}/{external_ref}": {
      "get": {
        "description": "The partner with its balance in cents: open, on a statement, paid out. Scope `partner:commissions:read`.",
        "operationId": "retrieveCommissionPartner",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
              "title": "Source",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external_ref",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
              "title": "External Ref",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "balance": {
                    "open": 15000,
                    "paid": 0,
                    "statemented": 0
                  },
                  "bic": null,
                  "billing_mode": "self_billing",
                  "city": "München",
                  "country_code": "DE",
                  "created_at": "2026-10-19T15:09:58.181504",
                  "e_invoice_format": "auto",
                  "email": null,
                  "external_ref": "lernlink",
                  "external_source": "alphalearn",
                  "has_payee_account": false,
                  "house_number": null,
                  "iban_masked": null,
                  "id": "00000000-0000-4000-8000-000000000001",
                  "kind": "sales_partner",
                  "kreditorennummer": "70001",
                  "language": "de",
                  "min_payout_cents": 0,
                  "name": "lern.link GmbH",
                  "notes": null,
                  "payee_changed_at": null,
                  "payout_rail": "external",
                  "self_billing_agreed_on": "2026-09-01",
                  "self_billing_contract_ref": null,
                  "self_billing_objected_at": null,
                  "statement_cadence": "month",
                  "status": "active",
                  "street": "Allee 1",
                  "supplier_id": "00000000-0000-4000-8000-000000000002",
                  "tax_number": null,
                  "tax_status": "domestic_regular",
                  "vat_id": "DE123456789",
                  "zip": "80331"
                },
                "schema": {
                  "$ref": "#/components/schemas/CommissionPartner"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.partner_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:commissions:read"
            ]
          }
        ],
        "summary": "Retrieve a partner and its balance",
        "tags": [
          "Revenue share"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "commission.partner_not_found",
          "validation_failed"
        ]
      },
      "put": {
        "description": "Creates or updates a partner who earns a share of revenue — a sales partner, a developer, an affiliate. Its tax status decides what it is paid by: a Gutschrift (self-billed invoice) with or without VAT, a settlement statement for a private person, or a request to invoice. The payout account cannot be set through the API. Scope `partner:commissions:write`.",
        "operationId": "upsertCommissionPartner",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
              "title": "Source",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external_ref",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
              "title": "External Ref",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "city": "München",
                "country_code": "DE",
                "name": "lern.link GmbH",
                "self_billing_agreed_on": "2026-09-01",
                "street": "Allee 1",
                "tax_status": "domestic_regular",
                "vat_id": "DE123456789",
                "zip": "80331"
              },
              "schema": {
                "$ref": "#/components/schemas/PartnerApiCommissionPartner"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "balance": {
                    "open": 0,
                    "paid": 0,
                    "statemented": 0
                  },
                  "bic": null,
                  "billing_mode": "self_billing",
                  "city": "München",
                  "country_code": "DE",
                  "created_at": "2026-10-19T15:09:58.181504",
                  "e_invoice_format": "auto",
                  "email": null,
                  "external_ref": "lernlink",
                  "external_source": "alphalearn",
                  "has_payee_account": false,
                  "house_number": null,
                  "iban_masked": null,
                  "id": "00000000-0000-4000-8000-000000000001",
                  "kind": "sales_partner",
                  "kreditorennummer": "70001",
                  "language": "de",
                  "min_payout_cents": 0,
                  "name": "lern.link GmbH",
                  "notes": null,
                  "payee_changed_at": null,
                  "payout_rail": "external",
                  "self_billing_agreed_on": "2026-09-01",
                  "self_billing_contract_ref": null,
                  "self_billing_objected_at": null,
                  "statement_cadence": "month",
                  "status": "active",
                  "street": "Allee 1",
                  "supplier_id": "00000000-0000-4000-8000-000000000002",
                  "tax_number": null,
                  "tax_status": "domestic_regular",
                  "vat_id": "DE123456789",
                  "zip": "80331"
                },
                "schema": {
                  "$ref": "#/components/schemas/CommissionPartner"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "balance": {
                    "open": 0,
                    "paid": 0,
                    "statemented": 0
                  },
                  "bic": null,
                  "billing_mode": "self_billing",
                  "city": "München",
                  "country_code": "DE",
                  "created_at": "2026-10-19T15:09:58.181504",
                  "e_invoice_format": "auto",
                  "email": null,
                  "external_ref": "lernlink",
                  "external_source": "alphalearn",
                  "has_payee_account": false,
                  "house_number": null,
                  "iban_masked": null,
                  "id": "00000000-0000-4000-8000-000000000001",
                  "kind": "sales_partner",
                  "kreditorennummer": "70001",
                  "language": "de",
                  "min_payout_cents": 0,
                  "name": "lern.link GmbH",
                  "notes": null,
                  "payee_changed_at": null,
                  "payout_rail": "external",
                  "self_billing_agreed_on": "2026-09-01",
                  "self_billing_contract_ref": null,
                  "self_billing_objected_at": null,
                  "statement_cadence": "month",
                  "status": "active",
                  "street": "Allee 1",
                  "supplier_id": "00000000-0000-4000-8000-000000000002",
                  "tax_number": null,
                  "tax_status": "domestic_regular",
                  "vat_id": "DE123456789",
                  "zip": "80331"
                },
                "schema": {
                  "$ref": "#/components/schemas/CommissionPartner"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.supplier_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.creditor_number_range_exhausted"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.billing_mode_invalid"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:commissions:write"
            ]
          }
        ],
        "summary": "Create or update a revenue-share partner",
        "tags": [
          "Revenue share"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "commission.billing_mode_invalid",
          "commission.creditor_number_range_exhausted",
          "commission.e_invoice_format_invalid",
          "commission.min_payout_invalid",
          "commission.partner_archived",
          "commission.partner_kind_invalid",
          "commission.partner_name_missing",
          "commission.supplier_not_found",
          "commission.tax_status_invalid",
          "conflict_retry",
          "validation_failed"
        ]
      }
    },
    "/commission-statements": {
      "get": {
        "description": "Issued statements, newest first. Drafts are the company's business and not listed. Scope `partner:commissions:read`.",
        "operationId": "listCommissionStatements",
        "parameters": [
          {
            "in": "query",
            "name": "partner_source",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Partner Source"
            }
          },
          {
            "in": "query",
            "name": "partner_ref",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Partner Ref"
            }
          },
          {
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "cancelled_by_id": null,
                    "cancels_statement_id": null,
                    "document_id": "00000000-0000-4000-8000-000000000004",
                    "e_invoice_format": "zugferd",
                    "gross_cents": 17850,
                    "has_pdf": true,
                    "has_xml": false,
                    "id": "00000000-0000-4000-8000-000000000001",
                    "issue_date": "2026-10-19",
                    "kind": "self_billing",
                    "lines": [
                      {
                        "amount_cents": 15000,
                        "basis_cents": 100000,
                        "contract_month": 2,
                        "customer": "Neunte Schule",
                        "entry_id": "00000000-0000-4000-8000-000000000003",
                        "paid_at": "2026-02-10",
                        "percent": 15.0,
                        "service_period_start": "2026-02-01"
                      }
                    ],
                    "net_cents": 15000,
                    "number": "GS-2026-0001",
                    "objected_at": null,
                    "paid_at": null,
                    "partner_id": "00000000-0000-4000-8000-000000000002",
                    "partner_name": "lern.link GmbH",
                    "period_end": "2026-03-01",
                    "sent_at": null,
                    "sent_to": null,
                    "status": "issued",
                    "tax_note": "regular",
                    "vat_cents": 2850,
                    "vat_rate": 19.0
                  }
                ],
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CommissionStatement"
                  },
                  "title": "Response 200 Listcommissionstatements",
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.partner_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:commissions:read"
            ]
          }
        ],
        "summary": "List statements",
        "tags": [
          "Revenue share"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "commission.partner_not_found",
          "validation_failed"
        ]
      }
    },
    "/commission-statements/{statement_id}": {
      "get": {
        "description": "One issued statement with its lines. Scope `partner:commissions:read`.",
        "operationId": "retrieveCommissionStatement",
        "parameters": [
          {
            "in": "path",
            "name": "statement_id",
            "required": true,
            "schema": {
              "title": "Statement Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "cancelled_by_id": null,
                  "cancels_statement_id": null,
                  "document_id": "00000000-0000-4000-8000-000000000004",
                  "e_invoice_format": "zugferd",
                  "gross_cents": 17850,
                  "has_pdf": true,
                  "has_xml": false,
                  "id": "00000000-0000-4000-8000-000000000001",
                  "issue_date": "2026-10-19",
                  "kind": "self_billing",
                  "lines": [
                    {
                      "amount_cents": 15000,
                      "basis_cents": 100000,
                      "contract_month": 2,
                      "customer": "Neunte Schule",
                      "entry_id": "00000000-0000-4000-8000-000000000003",
                      "paid_at": "2026-02-10",
                      "percent": 15.0,
                      "service_period_start": "2026-02-01"
                    }
                  ],
                  "net_cents": 15000,
                  "number": "GS-2026-0001",
                  "objected_at": null,
                  "paid_at": null,
                  "partner_id": "00000000-0000-4000-8000-000000000002",
                  "partner_name": "lern.link GmbH",
                  "period_end": "2026-03-01",
                  "sent_at": null,
                  "sent_to": null,
                  "status": "issued",
                  "tax_note": "regular",
                  "vat_cents": 2850,
                  "vat_rate": 19.0
                },
                "schema": {
                  "$ref": "#/components/schemas/CommissionStatement"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.statement_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:commissions:read"
            ]
          }
        ],
        "summary": "Retrieve a statement",
        "tags": [
          "Revenue share"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "commission.statement_not_found",
          "validation_failed"
        ]
      }
    },
    "/commission-statements/{statement_id}/pdf": {
      "get": {
        "description": "The statement's PDF as issued, with the embedded e-invoice where it carries one. Scope `partner:commissions:read`.",
        "operationId": "downloadCommissionStatementPdf",
        "parameters": [
          {
            "in": "path",
            "name": "statement_id",
            "required": true,
            "schema": {
              "title": "Statement Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {}
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.statement_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:commissions:read"
            ]
          }
        ],
        "summary": "Download a statement's PDF",
        "tags": [
          "Revenue share"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "commission.statement_not_found",
          "validation_failed"
        ]
      }
    },
    "/contracts/by-ref/{source}/{external_ref}": {
      "get": {
        "description": "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`.",
        "operationId": "retrieveContract",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
              "title": "Source",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external_ref",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
              "title": "External Ref",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "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"
                },
                "schema": {
                  "$ref": "#/components/schemas/Contract"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "contract_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:contracts:read"
            ]
          }
        ],
        "summary": "Retrieve a contract",
        "tags": [
          "Contracts"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "contract_not_found",
          "validation_failed"
        ]
      },
      "put": {
        "description": "Creates or updates a contract by your reference. AlphaCount bills it every cycle: advance items for the coming period, usage and overage for the past one, each line with its own service period.\n\nItems carry your own `ref`. A later PUT changes an item's quantity from the next cycle on, adds new items and ends left-out items after the current cycle; agreed prices stay frozen. While a contract is a draft, everything is replaced. Once it runs, interval and start are fixed. Scope `partner:contracts:write`.",
        "operationId": "upsertContract",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
              "title": "Source",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external_ref",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
              "title": "External Ref",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "customer": {
                  "external_ref": "school-7",
                  "source": "alphalearn"
                },
                "invoice_mode": "draft",
                "items": [
                  {
                    "product_ref": "seat",
                    "quantity": 10,
                    "ref": "seats"
                  },
                  {
                    "product_ref": "tokens",
                    "quantity": 0,
                    "ref": "tokens"
                  },
                  {
                    "product_ref": "sla",
                    "ref": "sla"
                  }
                ],
                "name": "Lernplattform",
                "start_date": "2026-01-01"
              },
              "schema": {
                "$ref": "#/components/schemas/PartnerContractUpsert"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "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_date": null,
                  "external_ref": "c-8",
                  "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": "20",
                      "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": "2026-01-31",
                      "pricing_model": "flat",
                      "product_ref": "sla",
                      "quantity": "1",
                      "ref": "sla",
                      "unit_price_net": "300.00"
                    }
                  ],
                  "name": "Lernplattform",
                  "next_billing_date": "2026-02-01",
                  "number": "VT-2026-0001",
                  "payment_terms_days": null,
                  "start_date": "2026-01-01",
                  "status": "active",
                  "usage_open_from": "2026-01-01"
                },
                "schema": {
                  "$ref": "#/components/schemas/Contract"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "billing_interval": "month",
                  "billing_starts_on": null,
                  "customer_external_ref": "school-7",
                  "cycles": [],
                  "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-01-01",
                  "number": "VT-2026-0001",
                  "payment_terms_days": null,
                  "start_date": "2026-01-01",
                  "status": "active",
                  "usage_open_from": null
                },
                "schema": {
                  "$ref": "#/components/schemas/Contract"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "customer_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "contract.customer_mismatch"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "contract.date_range_invalid"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:contracts:write"
            ]
          }
        ],
        "summary": "Create or update a contract",
        "tags": [
          "Contracts"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "conflict_retry",
          "contract.customer_mismatch",
          "contract.date_range_invalid",
          "contract.end_before_billed",
          "contract.ended",
          "contract.interval_mismatch",
          "contract.item_product_changed",
          "contract.not_active",
          "contract.not_draft",
          "contract.terms_frozen",
          "customer_not_found",
          "pricing.model_unknown",
          "pricing.negative_value",
          "pricing.overage_needs_quota",
          "pricing.package_size_missing",
          "pricing.quantity_negative",
          "pricing.tier_incomplete",
          "pricing.tier_invalid",
          "pricing.tiers_empty",
          "pricing.tiers_overlap",
          "product_not_found",
          "validation_failed"
        ]
      }
    },
    "/contracts/by-ref/{source}/{external_ref}/usage": {
      "post": {
        "description": "Up to 500 usage records in one call, all or none. Each `external_ref` is stored once — the answer counts what was recorded and what was a duplicate, so a retry is safe. Usage before `usage_open_from` belongs to a period already billed and is refused. Scope `partner:usage:write`; a metering service needs no other.",
        "operationId": "reportUsage",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
              "title": "Source",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external_ref",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
              "title": "External Ref",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "records": [
                  {
                    "external_ref": "u-1",
                    "item_ref": "tokens",
                    "occurred_on": "2026-01-10",
                    "quantity": 1500
                  },
                  {
                    "external_ref": "u-2",
                    "item_ref": "tokens",
                    "occurred_on": "2026-01-20",
                    "quantity": 500
                  },
                  {
                    "external_ref": "u-2",
                    "item_ref": "tokens",
                    "occurred_on": "2026-01-20",
                    "quantity": 500
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/PartnerUsageReport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "duplicates": 1,
                  "recorded": 2
                },
                "schema": {
                  "$ref": "#/components/schemas/UsageReportResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "contract.item_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "contract.not_active"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "contract.usage_period_closed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:usage:write"
            ]
          }
        ],
        "summary": "Report usage",
        "tags": [
          "Contracts"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "conflict_retry",
          "contract.item_not_found",
          "contract.not_active",
          "contract.usage_period_closed",
          "contract_not_found",
          "validation_failed"
        ]
      }
    },
    "/customers/by-ref/{source}/{external_ref}": {
      "put": {
        "description": "Creates the customer you know under `{source}/{external_ref}`, or replaces its fields. A PUT replaces: a field you leave out is emptied. Answers 201 when it created the customer, 200 when it updated it. Scope `partner:customers:write`.",
        "operationId": "upsertCustomer",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
              "title": "Source",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external_ref",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
              "title": "External Ref",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "city": "Köln",
                "country_code": "DE",
                "email": "buchhaltung@musterschule.example",
                "name": "Musterschule",
                "street": "Schulweg",
                "zip": "50667"
              },
              "schema": {
                "$ref": "#/components/schemas/PartnerCustomerUpsert"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "city": "Köln",
                  "contact_name": null,
                  "country_code": "DE",
                  "customer_type": "business",
                  "email": "buchhaltung@musterschule.example",
                  "external_ref": "org-17",
                  "external_source": "alphalearn",
                  "house_number": null,
                  "id": "00000000-0000-4000-8000-000000000001",
                  "kundennummer": "10001",
                  "leitweg_id": null,
                  "name": "Musterschule",
                  "street": "Schulweg",
                  "vat_id": null,
                  "zip": "50667"
                },
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "city": "Köln",
                  "contact_name": null,
                  "country_code": "DE",
                  "customer_type": "business",
                  "email": "buchhaltung@musterschule.example",
                  "external_ref": "org-17",
                  "external_source": "alphalearn",
                  "house_number": null,
                  "id": "00000000-0000-4000-8000-000000000001",
                  "kundennummer": "10001",
                  "leitweg_id": null,
                  "name": "Musterschule",
                  "street": "Schulweg",
                  "vat_id": null,
                  "zip": "50667"
                },
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "customer_number_range_exhausted"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:customers:write"
            ]
          }
        ],
        "summary": "Create or update a customer",
        "tags": [
          "Customers"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "conflict_retry",
          "customer_number_range_exhausted",
          "validation_failed"
        ]
      }
    },
    "/invoices": {
      "get": {
        "description": "The invoices the API can see — those it created, those its contracts billed, and their cancellation invoices — most recently changed first. Use `changed_since` for a sync that fetches only what moved. Scope `partner:invoices:read`.",
        "operationId": "listInvoices",
        "parameters": [
          {
            "in": "query",
            "name": "customer_ref",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Customer Ref"
            }
          },
          {
            "in": "query",
            "name": "contract_ref",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Contract Ref"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 20,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "changed_since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Changed Since"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "invoices": [
                    {
                      "amount_paid": "0.00",
                      "cancelled_by": null,
                      "cancels_invoice": null,
                      "contract_external_ref": "c-7",
                      "currency": "EUR",
                      "customer_external_ref": "school-7",
                      "due_date": null,
                      "dunning_level": null,
                      "external_ref": null,
                      "external_source": null,
                      "id": "00000000-0000-4000-8000-000000000001",
                      "issue_date": null,
                      "number": null,
                      "overdue": false,
                      "paid_at": null,
                      "sent_at": null,
                      "service_period": {
                        "end": "2026-02-28",
                        "start": "2026-01-01"
                      },
                      "status": "draft",
                      "total_gross": "981.75",
                      "total_net": "825.00",
                      "total_tax": "156.75",
                      "type": "invoice"
                    },
                    {
                      "amount_paid": "0.00",
                      "cancelled_by": null,
                      "cancels_invoice": null,
                      "contract_external_ref": "c-7",
                      "currency": "EUR",
                      "customer_external_ref": "school-7",
                      "due_date": null,
                      "dunning_level": null,
                      "external_ref": null,
                      "external_source": null,
                      "id": "00000000-0000-4000-8000-000000000002",
                      "issue_date": null,
                      "number": null,
                      "overdue": false,
                      "paid_at": null,
                      "sent_at": null,
                      "service_period": {
                        "end": "2026-01-31",
                        "start": "2026-01-01"
                      },
                      "status": "draft",
                      "total_gross": "505.75",
                      "total_net": "425.00",
                      "total_tax": "80.75",
                      "type": "invoice"
                    }
                  ],
                  "limit": 100,
                  "offset": 0
                },
                "schema": {
                  "$ref": "#/components/schemas/InvoiceList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:invoices:read"
            ]
          }
        ],
        "summary": "List invoices",
        "tags": [
          "Invoices"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "validation_failed"
        ]
      },
      "post": {
        "description": "Creates an invoice for one of your customers. AlphaCount numbers it, books it, renders the PDF (with ZUGFeRD or XRechnung where the customer needs one) and, with `send: true`, mails it from the company's mailbox. With `issue: false` it stays a draft for review in the app.\n\nRequires an `Idempotency-Key` header: a repeated request with the same key and body answers 200 with the first answer; the same key with another body is refused. A request that fails leaves nothing behind and may be repeated as it is. Scope `partner:invoices:write`.",
        "operationId": "createInvoice",
        "parameters": [
          {
            "description": "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.",
            "example": "8e0b3c5e-2f7a-4f6e-9a51-0c2d6f0e1a77",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "customer": {
                  "external_ref": "org-17",
                  "source": "alphalearn"
                },
                "external_ref": "order-1",
                "issue": true,
                "lines": [
                  {
                    "description": "Lizenz",
                    "quantity": 1,
                    "unit_price_net": "100.00",
                    "vat_rate": 19
                  }
                ],
                "service_period": {
                  "end": "2026-10-31",
                  "start": "2026-10-01"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/PartnerInvoiceCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "amount_paid": "0.00",
                  "cancelled_by": null,
                  "cancels_invoice": null,
                  "contract_external_ref": null,
                  "currency": "EUR",
                  "customer_external_ref": "org-17",
                  "due_date": "2026-11-02",
                  "dunning_level": null,
                  "external_ref": "order-1",
                  "external_source": "alphalearn",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "issue_date": "2026-10-19",
                  "number": "RE-2026-0001",
                  "overdue": false,
                  "paid_at": null,
                  "send_error": null,
                  "sent_at": null,
                  "service_period": {
                    "end": "2026-10-31",
                    "start": "2026-10-01"
                  },
                  "status": "issued",
                  "total_gross": "119.00",
                  "total_net": "100.00",
                  "total_tax": "19.00",
                  "type": "invoice"
                },
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCreated"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "amount_paid": "0.00",
                  "cancelled_by": null,
                  "cancels_invoice": null,
                  "contract_external_ref": null,
                  "currency": "EUR",
                  "customer_external_ref": "org-17",
                  "due_date": "2026-11-02",
                  "dunning_level": null,
                  "external_ref": "order-1",
                  "external_source": "alphalearn",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "issue_date": "2026-10-19",
                  "number": "RE-2026-0001",
                  "overdue": false,
                  "paid_at": null,
                  "send_error": null,
                  "sent_at": null,
                  "service_period": {
                    "end": "2026-10-31",
                    "start": "2026-10-01"
                  },
                  "status": "issued",
                  "total_gross": "119.00",
                  "total_net": "100.00",
                  "total_tax": "19.00",
                  "type": "invoice"
                },
                "schema": {
                  "$ref": "#/components/schemas/InvoiceCreated"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "idempotency_key_invalid"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.agreement_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.attribution_conflict"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.agreement_takes_no_attributions"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          },
          "500": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "invoice_render_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server error"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:invoices:write"
            ]
          }
        ],
        "summary": "Create an invoice",
        "tags": [
          "Invoices"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "commission.agreement_not_found",
          "commission.agreement_takes_no_attributions",
          "commission.attribution_conflict",
          "commission.attribution_reference_mismatch",
          "conflict_retry",
          "customer_not_found",
          "idempotency_key_invalid",
          "idempotency_key_missing",
          "idempotency_key_reused",
          "invoice_external_ref_exists",
          "invoice_not_issuable",
          "invoice_render_failed",
          "period_locked",
          "product_not_found",
          "validation_failed"
        ]
      }
    },
    "/invoices/by-ref/{source}/{external_ref}": {
      "get": {
        "description": "The invoice you created under `{source}/{external_ref}`. Scope `partner:invoices:read`.",
        "operationId": "retrieveInvoiceByRef",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
              "title": "Source",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external_ref",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
              "title": "External Ref",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "amount_paid": "0.00",
                  "cancelled_by": null,
                  "cancels_invoice": null,
                  "contract_external_ref": null,
                  "currency": "EUR",
                  "customer_external_ref": "org-17",
                  "due_date": "2026-11-02",
                  "dunning_level": null,
                  "external_ref": "order-1",
                  "external_source": "alphalearn",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "issue_date": "2026-10-19",
                  "number": "RE-2026-0001",
                  "overdue": false,
                  "paid_at": null,
                  "sent_at": null,
                  "service_period": {
                    "end": "2026-10-31",
                    "start": "2026-10-01"
                  },
                  "status": "issued",
                  "total_gross": "119.00",
                  "total_net": "100.00",
                  "total_tax": "19.00",
                  "type": "invoice"
                },
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "invoice_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:invoices:read"
            ]
          }
        ],
        "summary": "Retrieve an invoice by your reference",
        "tags": [
          "Invoices"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "invoice_not_found",
          "validation_failed"
        ]
      }
    },
    "/invoices/{invoice_id}": {
      "get": {
        "description": "An invoice by AlphaCount's id. Invoices written in the app are not visible to the API. Scope `partner:invoices:read`.",
        "operationId": "retrieveInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "invoice_id",
            "required": true,
            "schema": {
              "title": "Invoice Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "amount_paid": "0.00",
                  "cancelled_by": null,
                  "cancels_invoice": null,
                  "contract_external_ref": null,
                  "currency": "EUR",
                  "customer_external_ref": "org-17",
                  "due_date": "2026-11-02",
                  "dunning_level": null,
                  "external_ref": "order-1",
                  "external_source": "alphalearn",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "issue_date": "2026-10-19",
                  "number": "RE-2026-0001",
                  "overdue": false,
                  "paid_at": null,
                  "sent_at": null,
                  "service_period": {
                    "end": "2026-10-31",
                    "start": "2026-10-01"
                  },
                  "status": "issued",
                  "total_gross": "119.00",
                  "total_net": "100.00",
                  "total_tax": "19.00",
                  "type": "invoice"
                },
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "invoice_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:invoices:read"
            ]
          }
        ],
        "summary": "Retrieve an invoice",
        "tags": [
          "Invoices"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "invoice_not_found",
          "validation_failed"
        ]
      }
    },
    "/invoices/{invoice_id}/cancel": {
      "post": {
        "description": "An issued invoice cannot be changed. It is cancelled by a cancellation invoice (Stornorechnung) with negative amounts, which this answers with 201. An invoice cancelled already answers 200 with the cancellation invoice that cancelled it. Scope `partner:invoices:write`.",
        "operationId": "cancelInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "invoice_id",
            "required": true,
            "schema": {
              "title": "Invoice Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "amount_paid": "0.00",
                  "cancelled_by": null,
                  "cancels_invoice": {
                    "external_ref": "order-2",
                    "id": "00000000-0000-4000-8000-000000000002",
                    "number": "RE-2026-0001"
                  },
                  "contract_external_ref": null,
                  "currency": "EUR",
                  "customer_external_ref": "org-17",
                  "due_date": "2026-10-19",
                  "dunning_level": null,
                  "external_ref": null,
                  "external_source": null,
                  "id": "00000000-0000-4000-8000-000000000001",
                  "issue_date": "2026-10-19",
                  "number": "ST-2026-0001",
                  "overdue": false,
                  "paid_at": null,
                  "sent_at": null,
                  "service_period": {
                    "end": "2026-10-31",
                    "start": "2026-10-01"
                  },
                  "status": "issued",
                  "total_gross": "-119.00",
                  "total_net": "-100.00",
                  "total_tax": "-19.00",
                  "type": "storno"
                },
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "amount_paid": "0.00",
                  "cancelled_by": null,
                  "cancels_invoice": {
                    "external_ref": "order-2",
                    "id": "00000000-0000-4000-8000-000000000002",
                    "number": "RE-2026-0001"
                  },
                  "contract_external_ref": null,
                  "currency": "EUR",
                  "customer_external_ref": "org-17",
                  "due_date": "2026-10-19",
                  "dunning_level": null,
                  "external_ref": null,
                  "external_source": null,
                  "id": "00000000-0000-4000-8000-000000000001",
                  "issue_date": "2026-10-19",
                  "number": "ST-2026-0001",
                  "overdue": false,
                  "paid_at": null,
                  "sent_at": null,
                  "service_period": {
                    "end": "2026-10-31",
                    "start": "2026-10-01"
                  },
                  "status": "issued",
                  "total_gross": "-119.00",
                  "total_net": "-100.00",
                  "total_tax": "-19.00",
                  "type": "storno"
                },
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "invoice_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "period_locked"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "invoice_not_cancellable"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          },
          "500": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "invoice_render_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server error"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:invoices:write"
            ]
          }
        ],
        "summary": "Cancel an invoice (Stornorechnung)",
        "tags": [
          "Invoices"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "invoice_not_cancellable",
          "invoice_not_found",
          "invoice_render_failed",
          "period_locked",
          "validation_failed"
        ]
      }
    },
    "/invoices/{invoice_id}/pdf": {
      "get": {
        "description": "The issued PDF exactly as it was mailed, with the embedded ZUGFeRD XML where the invoice carries one. A draft has none. Scope `partner:invoices:read`.",
        "operationId": "downloadInvoicePdf",
        "parameters": [
          {
            "in": "path",
            "name": "invoice_id",
            "required": true,
            "schema": {
              "title": "Invoice Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {}
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "invoice_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "invoice_not_issued"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "validation_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:invoices:read"
            ]
          }
        ],
        "summary": "Download an invoice's PDF",
        "tags": [
          "Invoices"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "invoice_not_found",
          "invoice_not_issued",
          "invoice_pdf_missing",
          "validation_failed"
        ]
      }
    },
    "/invoices/{invoice_id}/send": {
      "post": {
        "description": "Mails an issued invoice to the customer's address. An invoice that went out already is not mailed again; the answer is the invoice as it is. Scope `partner:invoices:write`.",
        "operationId": "sendInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "invoice_id",
            "required": true,
            "schema": {
              "title": "Invoice Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "amount_paid": "0.00",
                  "cancelled_by": null,
                  "cancels_invoice": null,
                  "contract_external_ref": null,
                  "currency": "EUR",
                  "customer_external_ref": "org-17",
                  "due_date": "2026-11-02",
                  "dunning_level": null,
                  "external_ref": "order-1",
                  "external_source": "alphalearn",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "issue_date": "2026-10-19",
                  "number": "RE-2026-0001",
                  "overdue": false,
                  "paid_at": null,
                  "sent_at": "2026-10-19T09:30:00Z",
                  "service_period": {
                    "end": "2026-10-31",
                    "start": "2026-10-01"
                  },
                  "status": "sent",
                  "total_gross": "119.00",
                  "total_net": "100.00",
                  "total_tax": "19.00",
                  "type": "invoice"
                },
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "invoice_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "invoice_send_failed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:invoices:write"
            ]
          }
        ],
        "summary": "Send an invoice to the customer",
        "tags": [
          "Invoices"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "invoice_not_found",
          "invoice_send_failed",
          "validation_failed"
        ]
      }
    },
    "/products/by-ref/{source}/{external_ref}": {
      "put": {
        "description": "Creates or updates a product by your reference: name, net unit price, VAT rate and how it is priced and billed — flat, per unit, tiered (volume or graduated) or by package; one-off or per month, quarter or year; in advance or in arrears; with an optional quota and an overage price. Invoice lines and contract items can then name it. An unsuitable combination is refused with a `pricing.*` code. Scope `partner:products:write`.",
        "operationId": "upsertProduct",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,49}$",
              "title": "Source",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external_ref",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$",
              "title": "External Ref",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "billing_interval": "month",
                "billing_timing": "arrears",
                "kind": "usage",
                "name": "1 Mio. Token",
                "pricing_model": "per_unit",
                "unit": "Paket",
                "unit_price_net": "40.00",
                "vat_rate": 19
              },
              "schema": {
                "$ref": "#/components/schemas/PartnerProductUpsert"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "article_number": "ART-0001",
                  "billing_interval": "month",
                  "billing_timing": "arrears",
                  "external_ref": "tokens-1m",
                  "external_source": "alphalearn",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "included_quantity": null,
                  "kind": "usage",
                  "name": "1 Mio. Token",
                  "overage_unit_price": null,
                  "price_tiers": null,
                  "pricing_model": "per_unit",
                  "revenue_account": null,
                  "unit": "Paket",
                  "unit_price_net": "40.00",
                  "vat_rate": 19.0
                },
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "article_number": "ART-0001",
                  "billing_interval": "month",
                  "billing_timing": "arrears",
                  "external_ref": "tokens-1m",
                  "external_source": "alphalearn",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "included_quantity": null,
                  "kind": "usage",
                  "name": "1 Mio. Token",
                  "overage_unit_price": null,
                  "price_tiers": null,
                  "pricing_model": "per_unit",
                  "revenue_account": null,
                  "unit": "Paket",
                  "unit_price_net": "40.00",
                  "vat_rate": 19.0
                },
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "product_number_taken"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "pricing.model_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:products:write"
            ]
          }
        ],
        "summary": "Create or update a product (building block)",
        "tags": [
          "Products"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "conflict_retry",
          "pricing.model_unknown",
          "pricing.negative_value",
          "pricing.overage_needs_quota",
          "pricing.package_size_missing",
          "pricing.quantity_negative",
          "pricing.tier_incomplete",
          "pricing.tier_invalid",
          "pricing.tiers_empty",
          "pricing.tiers_overlap",
          "product_number_taken",
          "validation_failed"
        ]
      }
    },
    "/revenue-events": {
      "post": {
        "description": "Revenue AlphaCount does not book itself — paid outside its invoices and outside a connected Stripe account. Idempotent by `(source, external_ref)`: a repeat answers 200 with the first event. Do not report revenue AlphaCount sees already; it would count twice. A refund is a negative event with `reverses_ref`. Scope `partner:revenue:write`.",
        "operationId": "createRevenueEvent",
        "parameters": [
          {
            "$ref": "#/components/parameters/Version"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "customer": {
                  "external_ref": "org-3",
                  "source": "alphalearn"
                },
                "external_ref": "pay-77",
                "net_amount": "200.00",
                "paid_at": "2026-03-05",
                "service_period": {
                  "end": "2026-03-31",
                  "start": "2026-03-01"
                },
                "source": "alphalearn"
              },
              "schema": {
                "$ref": "#/components/schemas/PartnerApiRevenueEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "customer_id": "00000000-0000-4000-8000-000000000002",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "net_cents": 20000,
                  "paid_at": "2026-03-05",
                  "processed": true,
                  "service_period_start": "2026-03-01",
                  "source_id": "alphalearn:pay-77"
                },
                "schema": {
                  "$ref": "#/components/schemas/RevenueEventResult"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "customer_id": "00000000-0000-4000-8000-000000000002",
                  "id": "00000000-0000-4000-8000-000000000001",
                  "net_cents": 20000,
                  "paid_at": "2026-03-05",
                  "processed": true,
                  "service_period_start": "2026-03-01",
                  "source_id": "alphalearn:pay-77"
                },
                "schema": {
                  "$ref": "#/components/schemas/RevenueEventResult"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_version_unknown"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad request"
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_expired"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "api_key_admin_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.product_not_found"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "conflict_retry"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "detail": {
                    "code": "commission.revenue_lines_do_not_add_up"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable"
          }
        },
        "security": [
          {
            "apiKey": [
              "partner:revenue:write"
            ]
          }
        ],
        "summary": "Report revenue paid elsewhere",
        "tags": [
          "Revenue share"
        ],
        "x-error-codes": [
          "api_key_admin_required",
          "api_key_entity_not_accessible",
          "api_key_entity_not_single",
          "api_key_expired",
          "api_key_invalid",
          "api_key_missing",
          "api_key_scope_missing",
          "api_key_user_inactive",
          "api_version_unknown",
          "commission.product_not_found",
          "commission.revenue_event_not_found",
          "commission.revenue_lines_do_not_add_up",
          "conflict_retry",
          "customer_not_found",
          "validation_failed"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://app.alphacount.ai/api/partner/v1"
    }
  ],
  "tags": [
    {
      "description": "Your customers, mirrored by your own reference.",
      "name": "Customers"
    },
    {
      "description": "Building blocks: pricing model, tiers, interval, quota.",
      "name": "Products"
    },
    {
      "description": "Invoices AlphaCount numbers, books, renders, sends and duns.",
      "name": "Invoices"
    },
    {
      "description": "Recurring billing per cycle, and the usage it bills.",
      "name": "Contracts"
    },
    {
      "description": "Partners, agreements, attributions, the ledger and statements.",
      "name": "Revenue share"
    }
  ]
}
