Skip to content
HALOWERK

Datenwerk

discount run plan

Each invoice carries terms as fields or as text (same parser as payment-terms-parse). With a lead time for the transfer to arrive, the service decides per invoice: capture a discount now (the best tier still reachable), defer because the same discount is still reachable at the next run, pay now because the net due date falls before the next run or is already past, or defer because it is not yet due. Within an optional budget, payments are prioritized discount first by annualized return.

POST https://daten.halowerk.com/v1/discount-run-plan

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
run_datestringYesExecution date of this payment run.
next_run_datestringNoDate of the next run; without it everything payable now is paid now.
lead_daysintegerNoCalendar days until the payment reaches the creditor.
budgetstringNoAvailable liquidity for this run.
prioritystringNo
invoicesarrayYes
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "run_date",
    "invoices"
  ],
  "properties": {
    "run_date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Execution date of this payment run."
    },
    "next_run_date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Date of the next run; without it everything payable now is paid now."
    },
    "lead_days": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10,
      "default": 1,
      "description": "Calendar days until the payment reaches the creditor."
    },
    "budget": {
      "type": "string",
      "pattern": "^\\d{1,12}(\\.\\d{1,2})?$",
      "description": "Available liquidity for this run."
    },
    "priority": {
      "type": "string",
      "enum": [
        "discount_first",
        "due_first"
      ],
      "default": "discount_first"
    },
    "invoices": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "amount",
          "invoice_date"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "amount": {
            "type": "string",
            "pattern": "^\\d{1,12}(\\.\\d{1,2})?$",
            "description": "Open gross amount."
          },
          "invoice_date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "terms_text": {
            "type": "string",
            "maxLength": 500
          },
          "discount_percent": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 50
          },
          "discount_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "net_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "due_date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          }
        }
      }
    }
  }
}

Open original schema

Published input example

{
  "run_date": "2026-11-10",
  "next_run_date": "2026-11-17",
  "budget": "5000.00",
  "invoices": [
    {
      "id": "R-1",
      "amount": "1000.00",
      "invoice_date": "2026-11-02",
      "terms_text": "2 % Skonto innerhalb 10 Tagen, netto 30 Tage"
    }
  ]
}

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 โ†’