Skip to content
HALOWERK

Rechenwerk

payment allocation

Applies § 366(1) BGB (the debtor designation decides) and otherwise the statutory order of § 366(2): due debts before undue ones, then the debt with less security for the creditor, then the more burdensome for the debtor, then the older one, and debts equal in all criteria proportionally. Inside each debt the payment covers costs, then interest, then principal (§ 367(1)); for consumer loans costs, the owed amount, then interest (§ 497(3) BGB, not for real-estate consumer loans). Security and.

POST https://rechen.halowerk.com/v1/payment-allocation

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
payment_amountnumberYesPayment in EUR.
payment_datestringNoPayment date; required if debts carry a due_date.
designationarrayNoDebt ids designated by the debtor, in order (§ 366(1) BGB).
debtsarrayYes
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "payment_amount",
    "debts"
  ],
  "properties": {
    "payment_amount": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 1000000000000,
      "description": "Payment in EUR."
    },
    "payment_date": {
      "type": "string",
      "format": "date",
      "description": "Payment date; required if debts carry a due_date."
    },
    "designation": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "string",
        "maxLength": 64
      },
      "description": "Debt ids designated by the debtor, in order (§ 366(1) BGB)."
    },
    "debts": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "principal"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Debt reference."
          },
          "principal": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000000,
            "description": "Open principal in EUR."
          },
          "interest": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000000,
            "default": 0,
            "description": "Open interest in EUR."
          },
          "costs": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000000,
            "default": 0,
            "description": "Open costs in EUR."
          },
          "due": {
            "type": "boolean",
            "description": "Whether the debt is due; alternative to due_date."
          },
          "due_date": {
            "type": "string",
            "format": "date",
            "description": "Due date; due if on or before payment_date."
          },
          "security_rank": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 0,
            "description": "Security the debt offers the creditor (0 = none, higher = more, e.g. guarantee, lien)."
          },
          "burden_rank": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 0,
            "description": "How burdensome the debt is for the debtor (higher = more, e.g. higher interest, enforceable title, penalty)."
          },
          "created": {
            "type": "string",
            "format": "date",
            "description": "Date the debt arose (older debts first)."
          },
          "consumer_credit": {
            "type": "boolean",
            "default": false,
            "description": "Consumer loan in default: § 497(3) BGB order."
          },
          "real_estate_consumer_loan": {
            "type": "boolean",
            "default": false,
            "description": "Real-estate consumer loan: § 497(3) sentence 1 does not apply (§ 497(4))."
          }
        }
      }
    }
  }
}

Open original schema

Published input example

{
  "payment_amount": 300,
  "debts": [
    {
      "id": "D1",
      "principal": 200,
      "interest": 20,
      "costs": 10,
      "security_rank": 0
    },
    {
      "id": "D2",
      "principal": 100,
      "interest": 15,
      "costs": 5,
      "security_rank": 2
    }
  ]
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub →