Reference
Incoming payments
POST/api/v1/incoming-payments/{id}/cancelCancel incoming payment
Cancels a payment recorded by hand on an incoming invoice, e.g. one typed wrong or a transfer that did not go out, with a reason: a counter-entry is booked, the payment stays listed as cancelled and no longer counts as paid. The SEPA payment order the payment executed is initiated again, or withdrawn when a newer one is initiated meanwhile (payment_order_effect: reopened, withdrawn or none). The payment ids are in get_incoming_invoice. A payment from a bank transaction, or one coupled to a bank transaction, is undone on the transaction instead and is refused here.scope finance:write
Path
| idrequired | stringThe payment's id, from get_incoming_invoice's payments. |
Body (JSON)
| reasonrequired | stringWhy it is cancelled; stays visible at the payment. |
Response 200
| id | string |
| supplier | string | null |
| supplier_invoice_number | string | null |
| invoice_date | string |
| due_date | string |
| gross_cents | integer |
| open_cents | integer |
| state | one of draft, open, partially_paid, paid, initiated, overdue, cancelled |
| payments[] | object[] |
| payments[].id | string |
| payments[].paid_on | string |
| payments[].amount_cents | integer |
| payments[].note | string | null |
| payments[].origin | one of hand, bank, reversal, cancellation |
| payments[].bank_transaction_id | string | null |
| payments[].cancelled | object | null |
| payments[].cancelled.on | string |
| payments[].cancelled.by | string |
| payments[].cancelled.reason | string |
| payment_order | object | null |
| payment_order.id | string |
| payment_order.status | string |
| payment_order.amount_cents | integer |
| payment_order.created_on | string |
| payment_order_effect | string |
Schema
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"supplier": {
"type": [
"string",
"null"
]
},
"supplier_invoice_number": {
"type": [
"string",
"null"
]
},
"invoice_date": {
"type": "string"
},
"due_date": {
"type": "string"
},
"gross_cents": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"open_cents": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"state": {
"type": "string",
"enum": [
"draft",
"open",
"partially_paid",
"paid",
"initiated",
"overdue",
"cancelled"
]
},
"payments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"paid_on": {
"type": "string"
},
"amount_cents": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"note": {
"type": [
"string",
"null"
]
},
"origin": {
"type": "string",
"enum": [
"hand",
"bank",
"reversal",
"cancellation"
]
},
"bank_transaction_id": {
"type": [
"string",
"null"
]
},
"cancelled": {
"anyOf": [
{
"type": "object",
"properties": {
"on": {
"type": "string"
},
"by": {
"type": "string"
},
"reason": {
"type": "string"
}
},
"required": [
"on",
"by",
"reason"
],
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"paid_on",
"amount_cents",
"note",
"origin",
"bank_transaction_id",
"cancelled"
],
"additionalProperties": false
}
},
"payment_order": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"status": {
"type": "string",
"const": "initiated"
},
"amount_cents": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"created_on": {
"type": "string"
}
},
"required": [
"id",
"status",
"amount_cents",
"created_on"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"payment_order_effect": {
"type": "string"
}
},
"required": [
"id",
"supplier",
"supplier_invoice_number",
"invoice_date",
"due_date",
"gross_cents",
"open_cents",
"state",
"payments",
"payment_order",
"payment_order_effect"
],
"additionalProperties": false
}Refusals are problems with a code — see Errors.