Zum Inhalt

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

idrequiredstringThe payment's id, from get_incoming_invoice's payments.

Body (JSON)

reasonrequiredstringWhy it is cancelled; stays visible at the payment.

Response 200

idstring
supplierstring | null
supplier_invoice_numberstring | null
invoice_datestring
due_datestring
gross_centsinteger
open_centsinteger
stateone of draft, open, partially_paid, paid, initiated, overdue, cancelled
payments[]object[]
payments[].idstring
payments[].paid_onstring
payments[].amount_centsinteger
payments[].notestring | null
payments[].originone of hand, bank, reversal, cancellation
payments[].bank_transaction_idstring | null
payments[].cancelledobject | null
payments[].cancelled.onstring
payments[].cancelled.bystring
payments[].cancelled.reasonstring
payment_orderobject | null
payment_order.idstring
payment_order.statusstring
payment_order.amount_centsinteger
payment_order.created_onstring
payment_order_effectstring
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.