API reference

Debit notes

Endpoints and input schemas from the console's API registry.

GET /api/debit-notes

List debit notes

Needs the debitNotes.read permission on the API key's role.

No request-body schema is supplied for this operation in the registry.

Documented responses

  • 200 — OK
  • 400 — The body is not valid; `error` says why
  • 401 — No valid API key
  • 403 — The key's role lacks the permission, or the module is off

POST /api/debit-notes

Create a debit note

Needs the debitNotes.write permission on the API key's role.

JSON request schema
{
  "type": "object",
  "properties": {
    "invoiceId": {
      "type": "string",
      "minLength": 1
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "type": "string",
            "maxLength": 10000
          },
          "quantity": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000
          },
          "unitPrice": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          },
          "amount": {
            "type": "number",
            "minimum": 0
          },
          "itemType": {
            "type": "string",
            "enum": [
              "standard",
              "payment",
              "section"
            ]
          },
          "percentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "taxInclusive": {
            "type": "boolean"
          },
          "taxCode": {
            "type": "string",
            "maxLength": 50
          },
          "taxCodeId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "classificationCode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{3}$"
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "unitCode": {
            "type": "string",
            "maxLength": 3
          },
          "taxRate": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "appliedTaxRate": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "taxAmount": {
            "type": "number",
            "minimum": 0
          },
          "discountAmount": {
            "type": "number",
            "minimum": 0
          },
          "notes": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "description",
          "quantity",
          "unitPrice",
          "amount"
        ]
      }
    },
    "subtotal": {
      "type": "number"
    },
    "taxRate": {
      "default": 0,
      "type": "number"
    },
    "taxAmount": {
      "default": 0,
      "type": "number"
    },
    "discount": {
      "default": 0,
      "type": "number"
    },
    "total": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "reason": {
      "type": "string"
    },
    "notes": {
      "type": "string"
    },
    "internalNotes": {
      "type": "string"
    }
  },
  "required": [
    "invoiceId",
    "items",
    "subtotal",
    "total"
  ]
}

Documented responses

  • 200 — OK
  • 201 — Created
  • 400 — The body is not valid; `error` says why
  • 401 — No valid API key
  • 403 — The key's role lacks the permission, or the module is off

GET /api/debit-notes/{id}

Read a debit note

Needs the debitNotes.read permission on the API key's role.

Path parameters

  • id — required path parameter

No request-body schema is supplied for this operation in the registry.

Documented responses

  • 200 — OK
  • 400 — The body is not valid; `error` says why
  • 401 — No valid API key
  • 403 — The key's role lacks the permission, or the module is off
  • 404 — Not found in this company

PATCH /api/debit-notes/{id}

Change a debit note

Needs the debitNotes.write permission on the API key's role.

Path parameters

  • id — required path parameter
JSON request schema
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "type": "string",
            "maxLength": 10000
          },
          "quantity": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000
          },
          "unitPrice": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          },
          "amount": {
            "type": "number",
            "minimum": 0
          },
          "itemType": {
            "type": "string",
            "enum": [
              "standard",
              "payment",
              "section"
            ]
          },
          "percentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "taxInclusive": {
            "type": "boolean"
          },
          "taxCode": {
            "type": "string",
            "maxLength": 50
          },
          "taxCodeId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "classificationCode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{3}$"
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "unitCode": {
            "type": "string",
            "maxLength": 3
          },
          "taxRate": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "appliedTaxRate": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "taxAmount": {
            "type": "number",
            "minimum": 0
          },
          "discountAmount": {
            "type": "number",
            "minimum": 0
          },
          "notes": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "description",
          "quantity",
          "unitPrice",
          "amount"
        ]
      }
    },
    "subtotal": {
      "type": "number"
    },
    "taxRate": {
      "type": "number"
    },
    "taxAmount": {
      "type": "number"
    },
    "discount": {
      "type": "number"
    },
    "total": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "reason": {
      "type": "string"
    },
    "notes": {
      "type": "string"
    },
    "internalNotes": {
      "type": "string"
    }
  }
}

Documented responses

  • 200 — OK
  • 400 — The body is not valid; `error` says why
  • 401 — No valid API key
  • 403 — The key's role lacks the permission, or the module is off
  • 404 — Not found in this company

DELETE /api/debit-notes/{id}

Delete a debit note

Needs the debitNotes.write permission on the API key's role.

Path parameters

  • id — required path parameter

No request-body schema is supplied for this operation in the registry.

Documented responses

  • 200 — OK
  • 400 — The body is not valid; `error` says why
  • 401 — No valid API key
  • 403 — The key's role lacks the permission, or the module is off
  • 404 — Not found in this company

Other policy and state errors may also apply. See API key permissions and limits and the complete OpenAPI document.