Automation MCP Server Blog Pricing

UBL Credit Note API

A UBL credit note uses the same endpoint and the same request as a UBL invoice, POST /v1/create/ubl. Set typeCode to 381 and the API returns a validated credit note.

This page covers what is specific to credit notes. Every other field, the options, code examples and responses are the same as for an invoice: Create UBL API.

Example

Send the request body you send for an invoice, with the type code and a reference to the invoice being credited:

{
  "invoice": {
    "invoiceNumber": "CN-2026-0007",
    "typeCode": "381",
    "precedingInvoiceReferences": [
      { "reference": "INV-2026-0042", "issueDate": "2026-11-14" }
    ],
    ...
  }
}

The top-level object stays invoice, and the seller, buyer and lines are filled in exactly as for an invoice.

For a complete example and integration guide, see the Create UBL endpoint.

Amounts stay positive

Send quantities, prices and amounts as positive values, exactly as on an invoice. The type code 381 already tells the receiving system that the document is a credit, so it books the amounts on the credit side. Totals and the VAT breakdown are calculated from the lines, as for an invoice.

A line that works against the credit, for example a restocking fee deducted from it, gets a negative quantity. The price itself always stays positive.

Reference to the original invoice

precedingInvoiceReferences (BG-3) names the invoice the credit note refers to: its number in reference and, optionally, its date in issueDate. It is optional, and we recommend including it: your customer can match the credit to the invoice without asking. A credit note covering several invoices lists each of them.

Self-billed credit notes

When the buyer issues the document on the seller's behalf, as in self-billing, credit a self-billed invoice (389) with type code 261. Everything else on this page applies unchanged.

Credit notes in UBL

UBL has a separate document for credits. With type code 381 the API returns a <CreditNote> document instead of an <Invoice>, built from the same JSON, with the lines as CreditNoteLine elements. Peppol BIS Billing does not include the self-billed credit note (261), so use 381 on Peppol.

One endpoint for invoices and credit notes

A credit note is an invoice with type code 381. You issue it with the same endpoint, POST /v1/create/ubl, the same request model and the same code you already use for your invoices. The full request model, the options, code examples in several languages and the responses are on the Create UBL endpoint page.