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)
| contract | stringOmit to create a new purchase contract. |
| company | stringOnly for a new contract: the supplier's company id. |
| title | string |
| business_unit | stringName or id of a business unit (list_business_units). New contract default: the default unit. |
| cost_center | string | nullDATEV KOST1: up to 8 letters or digits; null for none. New contract default: the unit's cost center. |
| payment_term_days | integerNew contract default: the billing settings' payment term. |
| status | one of active, ended, cancelledOnly when editing: active, ended or cancelled. |
Response 200
| created | boolean |
| contract | object | null |
| contract.id | string |
| contract.title | string |
| contract.status | string |
| contract.company | object |
| contract.company.id | string |
| contract.company.name | string |
| contract.business_unit | string | null |
| contract.cost_center | string | null |
| contract.payment_term_days | integer |
| contract.signed_on | string | null |
| contract.lines[] | object[] |
| contract.lines[].id | string |
| contract.lines[].label | string |
| contract.lines[].kind | string |
| contract.lines[].category | string |
| contract.lines[].vat_rate_pct | number |
| contract.lines[].reverse_charge | boolean |
| contract.lines[].amount_cents | integer | null |
| contract.lines[].planned_date | string | null |
| contract.lines[].completed_on | string | null |
| contract.lines[].interval | string | null |
| contract.lines[].timing | string | null |
| contract.lines[].start_date | string | null |
| contract.lines[].end_date | string | null |
| contract.lines[].minimum_term_months | integer | null |
| contract.lines[].renewal_months | integer | null |
| contract.lines[].notice_period | integer | null |
| contract.lines[].notice_unit | string | null |
| contract.lines[].notice_effective | string | null |
| contract.lines[].notice_given_on | string | null |
| contract.lines[].values | object |
| contract.url | string |
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
| idrequired | stringThe contract's id, from list_contracts. |
Response 200
| id | string |
| title | string |
| status | string |
| company | object |
| company.id | string |
| company.name | string |
| business_unit | string | null |
| cost_center | string | null |
| payment_term_days | integer |
| signed_on | string | null |
| lines[] | object[] |
| lines[].id | string |
| lines[].label | string |
| lines[].kind | string |
| lines[].category | string |
| lines[].vat_rate_pct | number |
| lines[].reverse_charge | boolean |
| lines[].amount_cents | integer | null |
| lines[].planned_date | string | null |
| lines[].completed_on | string | null |
| lines[].interval | string | null |
| lines[].timing | string | null |
| lines[].start_date | string | null |
| lines[].end_date | string | null |
| lines[].minimum_term_months | integer | null |
| lines[].renewal_months | integer | null |
| lines[].notice_period | integer | null |
| lines[].notice_unit | string | null |
| lines[].notice_effective | string | null |
| lines[].notice_given_on | string | null |
| lines[].values | object |
| url | string |
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
| idrequired | stringThe purchase contract's id, from list_contracts. |
Body (JSON)
| label | string |
| kind | one of instalment, recurring, time_material, forecast, monthly_valuesinstalment (a part delivered once), recurring, time_material, forecast, or monthly_values (a year of month amounts). |
| category | stringA cost category key, from list_finance_categories. |
| vat_rate_pct | numberDefault for a new line: 19. |
| amount_cents | integerEvery kind but time_material and monthly_values. |
| planned_date | string | nullinstalment and forecast. |
| completed_on | string | nullinstalment: the day it was delivered. |
| interval | one of monthly, yearlyrecurring. |
| timing | one of advance, arrearsrecurring: in advance or in arrears. |
| start_date | string | nullrecurring and time_material. |
| end_date | string | null |
| minimum_term_months | integer | null |
| renewal_months | integer | null |
| notice_period | integer | null |
| notice_unit | one of weeks, months | null |
| notice_effective | one of month_end, term_end | null |
| notice_given_on | string | nullRecorded notice; without an end, the earliest end the term allows is set. |
| values_year | integermonthly_values: the year the values belong to. |
| values | objectmonthly_values: cents per month of values_year, e.g. {"2026-03": 120000}. A month left out is empty. |
| reverse_charge | booleanReverse charge (§ 13b UStG): the VAT is owed by us, the buyer, not paid to the supplier. Default for a new line: false. |
Response 200
| line | string |
| contract | object | null |
| contract.id | string |
| contract.title | string |
| contract.status | string |
| contract.company | object |
| contract.company.id | string |
| contract.company.name | string |
| contract.business_unit | string | null |
| contract.cost_center | string | null |
| contract.payment_term_days | integer |
| contract.signed_on | string | null |
| contract.lines[] | object[] |
| contract.lines[].id | string |
| contract.lines[].label | string |
| contract.lines[].kind | string |
| contract.lines[].category | string |
| contract.lines[].vat_rate_pct | number |
| contract.lines[].reverse_charge | boolean |
| contract.lines[].amount_cents | integer | null |
| contract.lines[].planned_date | string | null |
| contract.lines[].completed_on | string | null |
| contract.lines[].interval | string | null |
| contract.lines[].timing | string | null |
| contract.lines[].start_date | string | null |
| contract.lines[].end_date | string | null |
| contract.lines[].minimum_term_months | integer | null |
| contract.lines[].renewal_months | integer | null |
| contract.lines[].notice_period | integer | null |
| contract.lines[].notice_unit | string | null |
| contract.lines[].notice_effective | string | null |
| contract.lines[].notice_given_on | string | null |
| contract.lines[].values | object |
| contract.url | string |
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
| idrequired | stringThe purchase contract's id, from list_contracts. |
| line_idrequired | stringThe line's id, from get_purchase_contract. |
Body (JSON)
| label | string |
| kind | one of instalment, recurring, time_material, forecast, monthly_valuesinstalment (a part delivered once), recurring, time_material, forecast, or monthly_values (a year of month amounts). |
| category | stringA cost category key, from list_finance_categories. |
| vat_rate_pct | numberDefault for a new line: 19. |
| amount_cents | integerEvery kind but time_material and monthly_values. |
| planned_date | string | nullinstalment and forecast. |
| completed_on | string | nullinstalment: the day it was delivered. |
| interval | one of monthly, yearlyrecurring. |
| timing | one of advance, arrearsrecurring: in advance or in arrears. |
| start_date | string | nullrecurring and time_material. |
| end_date | string | null |
| minimum_term_months | integer | null |
| renewal_months | integer | null |
| notice_period | integer | null |
| notice_unit | one of weeks, months | null |
| notice_effective | one of month_end, term_end | null |
| notice_given_on | string | nullRecorded notice; without an end, the earliest end the term allows is set. |
| values_year | integermonthly_values: the year the values belong to. |
| values | objectmonthly_values: cents per month of values_year, e.g. {"2026-03": 120000}. A month left out is empty. |
| reverse_charge | booleanReverse charge (§ 13b UStG): the VAT is owed by us, the buyer, not paid to the supplier. Default for a new line: false. |
Response 200
| line | string |
| contract | object | null |
| contract.id | string |
| contract.title | string |
| contract.status | string |
| contract.company | object |
| contract.company.id | string |
| contract.company.name | string |
| contract.business_unit | string | null |
| contract.cost_center | string | null |
| contract.payment_term_days | integer |
| contract.signed_on | string | null |
| contract.lines[] | object[] |
| contract.lines[].id | string |
| contract.lines[].label | string |
| contract.lines[].kind | string |
| contract.lines[].category | string |
| contract.lines[].vat_rate_pct | number |
| contract.lines[].reverse_charge | boolean |
| contract.lines[].amount_cents | integer | null |
| contract.lines[].planned_date | string | null |
| contract.lines[].completed_on | string | null |
| contract.lines[].interval | string | null |
| contract.lines[].timing | string | null |
| contract.lines[].start_date | string | null |
| contract.lines[].end_date | string | null |
| contract.lines[].minimum_term_months | integer | null |
| contract.lines[].renewal_months | integer | null |
| contract.lines[].notice_period | integer | null |
| contract.lines[].notice_unit | string | null |
| contract.lines[].notice_effective | string | null |
| contract.lines[].notice_given_on | string | null |
| contract.lines[].values | object |
| contract.url | string |
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.