Zum Inhalt

Reference

Purchase contracts

POST/api/v1/purchase-contractsSave purchase contract

Creates a purchase contract with a supplier, or -- with contract -- edits one: only the fields given change, the rest stays. A new contract needs company (an active company with the supplier role) and title; business unit, cost center and payment term start as the page proposes them: the default unit, its cost center, the billing settings' payment term, and its status is active. The company of an existing contract stays. Lines are added afterwards with add_purchase_contract_line. Sales contracts are edited through their order (save_contract). finance.manage only.scope finance:write

Body (JSON)

contractstringOmit to create a new purchase contract.
companystringOnly for a new contract: the supplier's company id.
titlestring
business_unitstringName or id of a business unit (list_business_units). New contract default: the default unit.
cost_centerstring | nullDATEV KOST1: up to 8 letters or digits; null for none. New contract default: the unit's cost center.
payment_term_daysintegerNew contract default: the billing settings' payment term.
statusone of active, ended, cancelledOnly when editing: active, ended or cancelled.

Response 200

createdboolean
contractobject | null
contract.idstring
contract.titlestring
contract.statusstring
contract.companyobject
contract.company.idstring
contract.company.namestring
contract.business_unitstring | null
contract.cost_centerstring | null
contract.payment_term_daysinteger
contract.signed_onstring | null
contract.lines[]object[]
contract.lines[].idstring
contract.lines[].labelstring
contract.lines[].kindstring
contract.lines[].categorystring
contract.lines[].vat_rate_pctnumber
contract.lines[].reverse_chargeboolean
contract.lines[].amount_centsinteger | null
contract.lines[].planned_datestring | null
contract.lines[].completed_onstring | null
contract.lines[].intervalstring | null
contract.lines[].timingstring | null
contract.lines[].start_datestring | null
contract.lines[].end_datestring | null
contract.lines[].minimum_term_monthsinteger | null
contract.lines[].renewal_monthsinteger | null
contract.lines[].notice_periodinteger | null
contract.lines[].notice_unitstring | null
contract.lines[].notice_effectivestring | null
contract.lines[].notice_given_onstring | null
contract.lines[].valuesobject
contract.urlstring
Schema
{
  "type": "object",
  "properties": {
    "created": {
      "type": "boolean"
    },
    "contract": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "company": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ],
              "additionalProperties": false
            },
            "business_unit": {
              "type": [
                "string",
                "null"
              ]
            },
            "cost_center": {
              "type": [
                "string",
                "null"
              ]
            },
            "payment_term_days": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "signed_on": {
              "type": [
                "string",
                "null"
              ]
            },
            "lines": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "vat_rate_pct": {
                    "type": "number"
                  },
                  "reverse_charge": {
                    "type": "boolean"
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "planned_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "completed_on": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "interval": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "timing": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "start_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "end_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "minimum_term_months": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "renewal_months": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notice_period": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notice_unit": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "notice_effective": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "notice_given_on": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "values": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  }
                },
                "required": [
                  "id",
                  "label",
                  "kind",
                  "category",
                  "vat_rate_pct",
                  "reverse_charge",
                  "amount_cents",
                  "planned_date",
                  "completed_on",
                  "interval",
                  "timing",
                  "start_date",
                  "end_date",
                  "minimum_term_months",
                  "renewal_months",
                  "notice_period",
                  "notice_unit",
                  "notice_effective",
                  "notice_given_on",
                  "values"
                ],
                "additionalProperties": false
              }
            },
            "url": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "title",
            "status",
            "company",
            "business_unit",
            "cost_center",
            "payment_term_days",
            "signed_on",
            "lines",
            "url"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "created",
    "contract"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

GET/api/v1/purchase-contracts/{id}Get purchase contract

A purchase contract with a supplier: terms, and every line with amounts in cents, dates, term and notice, and month values.scope finance:read

Path

idrequiredstringThe contract's id, from list_contracts.

Response 200

idstring
titlestring
statusstring
companyobject
company.idstring
company.namestring
business_unitstring | null
cost_centerstring | null
payment_term_daysinteger
signed_onstring | null
lines[]object[]
lines[].idstring
lines[].labelstring
lines[].kindstring
lines[].categorystring
lines[].vat_rate_pctnumber
lines[].reverse_chargeboolean
lines[].amount_centsinteger | null
lines[].planned_datestring | null
lines[].completed_onstring | null
lines[].intervalstring | null
lines[].timingstring | null
lines[].start_datestring | null
lines[].end_datestring | null
lines[].minimum_term_monthsinteger | null
lines[].renewal_monthsinteger | null
lines[].notice_periodinteger | null
lines[].notice_unitstring | null
lines[].notice_effectivestring | null
lines[].notice_given_onstring | null
lines[].valuesobject
urlstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "company": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "additionalProperties": false
    },
    "business_unit": {
      "type": [
        "string",
        "null"
      ]
    },
    "cost_center": {
      "type": [
        "string",
        "null"
      ]
    },
    "payment_term_days": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "signed_on": {
      "type": [
        "string",
        "null"
      ]
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "vat_rate_pct": {
            "type": "number"
          },
          "reverse_charge": {
            "type": "boolean"
          },
          "amount_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "planned_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "completed_on": {
            "type": [
              "string",
              "null"
            ]
          },
          "interval": {
            "type": [
              "string",
              "null"
            ]
          },
          "timing": {
            "type": [
              "string",
              "null"
            ]
          },
          "start_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "end_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "minimum_term_months": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "renewal_months": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "notice_period": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "notice_unit": {
            "type": [
              "string",
              "null"
            ]
          },
          "notice_effective": {
            "type": [
              "string",
              "null"
            ]
          },
          "notice_given_on": {
            "type": [
              "string",
              "null"
            ]
          },
          "values": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          }
        },
        "required": [
          "id",
          "label",
          "kind",
          "category",
          "vat_rate_pct",
          "reverse_charge",
          "amount_cents",
          "planned_date",
          "completed_on",
          "interval",
          "timing",
          "start_date",
          "end_date",
          "minimum_term_months",
          "renewal_months",
          "notice_period",
          "notice_unit",
          "notice_effective",
          "notice_given_on",
          "values"
        ],
        "additionalProperties": false
      }
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "title",
    "status",
    "company",
    "business_unit",
    "cost_center",
    "payment_term_days",
    "signed_on",
    "lines",
    "url"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

POST/api/v1/purchase-contracts/{id}/linesAdd purchase contract line

Adds a line to a purchase contract: what it costs and when. label, kind and category (a cost category) are required, and each kind needs its own fields (see the field descriptions). finance.manage only.scope finance:write

Path

idrequiredstringThe purchase contract's id, from list_contracts.

Body (JSON)

labelstring
kindone of instalment, recurring, time_material, forecast, monthly_valuesinstalment (a part delivered once), recurring, time_material, forecast, or monthly_values (a year of month amounts).
categorystringA cost category key, from list_finance_categories.
vat_rate_pctnumberDefault for a new line: 19.
amount_centsintegerEvery kind but time_material and monthly_values.
planned_datestring | nullinstalment and forecast.
completed_onstring | nullinstalment: the day it was delivered.
intervalone of monthly, yearlyrecurring.
timingone of advance, arrearsrecurring: in advance or in arrears.
start_datestring | nullrecurring and time_material.
end_datestring | null
minimum_term_monthsinteger | null
renewal_monthsinteger | null
notice_periodinteger | null
notice_unitone of weeks, months | null
notice_effectiveone of month_end, term_end | null
notice_given_onstring | nullRecorded notice; without an end, the earliest end the term allows is set.
values_yearintegermonthly_values: the year the values belong to.
valuesobjectmonthly_values: cents per month of values_year, e.g. {"2026-03": 120000}. A month left out is empty.
reverse_chargebooleanReverse charge (§ 13b UStG): the VAT is owed by us, the buyer, not paid to the supplier. Default for a new line: false.

Response 200

linestring
contractobject | null
contract.idstring
contract.titlestring
contract.statusstring
contract.companyobject
contract.company.idstring
contract.company.namestring
contract.business_unitstring | null
contract.cost_centerstring | null
contract.payment_term_daysinteger
contract.signed_onstring | null
contract.lines[]object[]
contract.lines[].idstring
contract.lines[].labelstring
contract.lines[].kindstring
contract.lines[].categorystring
contract.lines[].vat_rate_pctnumber
contract.lines[].reverse_chargeboolean
contract.lines[].amount_centsinteger | null
contract.lines[].planned_datestring | null
contract.lines[].completed_onstring | null
contract.lines[].intervalstring | null
contract.lines[].timingstring | null
contract.lines[].start_datestring | null
contract.lines[].end_datestring | null
contract.lines[].minimum_term_monthsinteger | null
contract.lines[].renewal_monthsinteger | null
contract.lines[].notice_periodinteger | null
contract.lines[].notice_unitstring | null
contract.lines[].notice_effectivestring | null
contract.lines[].notice_given_onstring | null
contract.lines[].valuesobject
contract.urlstring
Schema
{
  "type": "object",
  "properties": {
    "line": {
      "type": "string"
    },
    "contract": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "company": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ],
              "additionalProperties": false
            },
            "business_unit": {
              "type": [
                "string",
                "null"
              ]
            },
            "cost_center": {
              "type": [
                "string",
                "null"
              ]
            },
            "payment_term_days": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "signed_on": {
              "type": [
                "string",
                "null"
              ]
            },
            "lines": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "vat_rate_pct": {
                    "type": "number"
                  },
                  "reverse_charge": {
                    "type": "boolean"
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "planned_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "completed_on": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "interval": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "timing": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "start_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "end_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "minimum_term_months": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "renewal_months": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notice_period": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notice_unit": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "notice_effective": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "notice_given_on": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "values": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  }
                },
                "required": [
                  "id",
                  "label",
                  "kind",
                  "category",
                  "vat_rate_pct",
                  "reverse_charge",
                  "amount_cents",
                  "planned_date",
                  "completed_on",
                  "interval",
                  "timing",
                  "start_date",
                  "end_date",
                  "minimum_term_months",
                  "renewal_months",
                  "notice_period",
                  "notice_unit",
                  "notice_effective",
                  "notice_given_on",
                  "values"
                ],
                "additionalProperties": false
              }
            },
            "url": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "title",
            "status",
            "company",
            "business_unit",
            "cost_center",
            "payment_term_days",
            "signed_on",
            "lines",
            "url"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "line",
    "contract"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

PATCH/api/v1/purchase-contracts/{id}/lines/{line_id}Update purchase contract line

Changes a line of a purchase contract: only the fields given, the rest stays as the line holds it. For monthly_values, values_year with values replaces that year's months. finance.manage only.scope finance:write

Path

idrequiredstringThe purchase contract's id, from list_contracts.
line_idrequiredstringThe line's id, from get_purchase_contract.

Body (JSON)

labelstring
kindone of instalment, recurring, time_material, forecast, monthly_valuesinstalment (a part delivered once), recurring, time_material, forecast, or monthly_values (a year of month amounts).
categorystringA cost category key, from list_finance_categories.
vat_rate_pctnumberDefault for a new line: 19.
amount_centsintegerEvery kind but time_material and monthly_values.
planned_datestring | nullinstalment and forecast.
completed_onstring | nullinstalment: the day it was delivered.
intervalone of monthly, yearlyrecurring.
timingone of advance, arrearsrecurring: in advance or in arrears.
start_datestring | nullrecurring and time_material.
end_datestring | null
minimum_term_monthsinteger | null
renewal_monthsinteger | null
notice_periodinteger | null
notice_unitone of weeks, months | null
notice_effectiveone of month_end, term_end | null
notice_given_onstring | nullRecorded notice; without an end, the earliest end the term allows is set.
values_yearintegermonthly_values: the year the values belong to.
valuesobjectmonthly_values: cents per month of values_year, e.g. {"2026-03": 120000}. A month left out is empty.
reverse_chargebooleanReverse charge (§ 13b UStG): the VAT is owed by us, the buyer, not paid to the supplier. Default for a new line: false.

Response 200

linestring
contractobject | null
contract.idstring
contract.titlestring
contract.statusstring
contract.companyobject
contract.company.idstring
contract.company.namestring
contract.business_unitstring | null
contract.cost_centerstring | null
contract.payment_term_daysinteger
contract.signed_onstring | null
contract.lines[]object[]
contract.lines[].idstring
contract.lines[].labelstring
contract.lines[].kindstring
contract.lines[].categorystring
contract.lines[].vat_rate_pctnumber
contract.lines[].reverse_chargeboolean
contract.lines[].amount_centsinteger | null
contract.lines[].planned_datestring | null
contract.lines[].completed_onstring | null
contract.lines[].intervalstring | null
contract.lines[].timingstring | null
contract.lines[].start_datestring | null
contract.lines[].end_datestring | null
contract.lines[].minimum_term_monthsinteger | null
contract.lines[].renewal_monthsinteger | null
contract.lines[].notice_periodinteger | null
contract.lines[].notice_unitstring | null
contract.lines[].notice_effectivestring | null
contract.lines[].notice_given_onstring | null
contract.lines[].valuesobject
contract.urlstring
Schema
{
  "type": "object",
  "properties": {
    "line": {
      "type": "string"
    },
    "contract": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "company": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ],
              "additionalProperties": false
            },
            "business_unit": {
              "type": [
                "string",
                "null"
              ]
            },
            "cost_center": {
              "type": [
                "string",
                "null"
              ]
            },
            "payment_term_days": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "signed_on": {
              "type": [
                "string",
                "null"
              ]
            },
            "lines": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "vat_rate_pct": {
                    "type": "number"
                  },
                  "reverse_charge": {
                    "type": "boolean"
                  },
                  "amount_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "planned_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "completed_on": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "interval": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "timing": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "start_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "end_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "minimum_term_months": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "renewal_months": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notice_period": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notice_unit": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "notice_effective": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "notice_given_on": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "values": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  }
                },
                "required": [
                  "id",
                  "label",
                  "kind",
                  "category",
                  "vat_rate_pct",
                  "reverse_charge",
                  "amount_cents",
                  "planned_date",
                  "completed_on",
                  "interval",
                  "timing",
                  "start_date",
                  "end_date",
                  "minimum_term_months",
                  "renewal_months",
                  "notice_period",
                  "notice_unit",
                  "notice_effective",
                  "notice_given_on",
                  "values"
                ],
                "additionalProperties": false
              }
            },
            "url": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "title",
            "status",
            "company",
            "business_unit",
            "cost_center",
            "payment_term_days",
            "signed_on",
            "lines",
            "url"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "line",
    "contract"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.