Zum Inhalt

Reference

Payments

POST/api/v1/payments/{id}/cancelCancel payment

Cancels a payment recorded by hand on an invoice, e.g. one typed wrong, with a reason: a counter-entry is booked, the payment stays listed as cancelled and no longer counts as paid. The payment ids are in get_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 invoices

Path

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

Body (JSON)

reasonrequiredstringWhy it is cancelled; stays visible at the payment.

Response 200

idstring
numberstring | null
kindstring
statusone of draft, issuing, issued, cancelled
paymentone of unsent, open, partially_paid, paid, overdue, cancelled | null
invoice_datestring | null
companystring
orderstring | null
business_unitstring | null
customer_referencestring | null
lines[]object[]
lines[].idstring
lines[].positioninteger
lines[].sourcestring
lines[].namestring
lines[].descriptionstring | null
lines[].period_fromstring | null
lines[].period_tostring | null
lines[].quantitystring
lines[].unitstring
lines[].unit_price_centsinteger
lines[].net_centsinteger
totalsobject
totals.net_centsinteger
totals.vat_centsinteger
totals.gross_centsinteger
payments[]object[]
payments[].idstring
payments[].paid_onstring | null
payments[].amount_centsinteger
payments[].notestring | null
payments[].originone of hand, bank, reversal, cancellation
payments[].bank_transaction_idstring | null
payments[].cancelledobject | null
payments[].cancelled.onstring | null
payments[].cancelled.bystring
payments[].cancelled.reasonstring
urlstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "number": {
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "issuing",
        "issued",
        "cancelled"
      ]
    },
    "payment": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "unsent",
            "open",
            "partially_paid",
            "paid",
            "overdue",
            "cancelled"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "invoice_date": {
      "type": [
        "string",
        "null"
      ]
    },
    "company": {
      "type": "string"
    },
    "order": {
      "type": [
        "string",
        "null"
      ]
    },
    "business_unit": {
      "type": [
        "string",
        "null"
      ]
    },
    "customer_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "source": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_from": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_to": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "unit_price_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "net_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "position",
          "source",
          "name",
          "description",
          "period_from",
          "period_to",
          "quantity",
          "unit",
          "unit_price_cents",
          "net_cents"
        ],
        "additionalProperties": false
      }
    },
    "totals": {
      "type": "object",
      "properties": {
        "net_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "vat_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "gross_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "net_cents",
        "vat_cents",
        "gross_cents"
      ],
      "additionalProperties": false
    },
    "payments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "paid_on": {
            "type": [
              "string",
              "null"
            ]
          },
          "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",
                      "null"
                    ]
                  },
                  "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
      }
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "number",
    "kind",
    "status",
    "payment",
    "invoice_date",
    "company",
    "order",
    "business_unit",
    "customer_reference",
    "lines",
    "totals",
    "payments",
    "url"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.