curatedapi

Peppol BIS Billing 3.0 creator (UBL)

Send the invoice as JSON, get back a Peppol BIS Billing 3.0 UBL file that passes OpenPeppol's official rules.

What it does

Builds a Peppol BIS Billing 3.0 invoice or credit note in UBL 2.1 from plain JSON, works out every total the way EN 16931 defines it, and runs the EN 16931 and Peppol BIS rules on the file before returning it. Sending it over the Peppol network is not included: hand the file to your Peppol access point.

  • Peppol needs both parties' electronic addresses with an EAS scheme (an email address is not accepted), and a buyer reference or an order reference.
  • Sending over the Peppol network needs a certified access point; this API creates the file only.

The totals are worked out once, the way EN 16931 defines them: each line's net amount, the VAT for each rate and category, and the amount due. The answer gives them next to the file, so your app can compare them with its own. A file that breaks an official rule is never returned: the call fails with INVOICE_NOT_VALID, names each rule and the field to look at, and is not billed.

The invoice is not stored, logged or cached. It is held in memory for the length of the call.

Rules every file is checked with

A check shows whether the invoice passes the official rule sets listed, at the versions listed. It is not legal or tax advice, and passing does not promise that a tax authority or buyer will accept the invoice. See the terms.

Use it from your code

POST /v1/create/einvoice/peppol-bisVersion 1
curl https://api.curatedapi.com/v1/create/einvoice/peppol-bis \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "invoice": {"number": "Snippet1", "issue_date": "2017-11-13", "due_date": "2017-12-01", "currency": "EUR", "buyer_reference": "0150abc", "seller": {"name": "SupplierOfficialName Ltd", "trading_name": "SupplierTradingName Ltd.", "id": "99887766", "address": {"line1": "Main street 1", "line2": "Postbox 123", "city": "London", "postcode": "GB 123 EW", "country": "GB"}, "vat_id": "GB1232434", "registration_id": "GB983294", "electronic_address": {"id": "9482348239847239874", "scheme": "0088"}}, "buyer": {"name": "Buyer Official Name", "trading_name": "BuyerTradingName AS", "id": {"id": "FR23342", "scheme": "0002"}, "address": {"line1": "Hovedgatan 32", "line2": "Po box 878", "city": "Stockholm", "postcode": "456 34", "country": "SE"}, "vat_id": "SE4598375937", "registration_id": {"id": "39937423947", "scheme": "0183"}, "electronic_address": {"id": "FR23342", "scheme": "0002"}, "contact": {"name": "Lisa Johnson", "phone": "23434234", "email": "[email protected]"}}, "delivery_date": "2017-11-01", "delivery": {"name": "Delivery party Name", "location_id": {"id": "9483759475923478", "scheme": "0088"}, "address": {"line1": "Delivery street 2", "line2": "Building 56", "city": "Stockholm", "postcode": "21234", "country": "SE"}}, "payment": {"method": "credit_transfer", "iban": "GB33BUKB20201555555555", "bic": "BUKBGB22", "account_name": "AccountName", "reference": "Snippet1", "terms": "Payment within 10 days, 2% discount"}, "charges": [{"amount": 25, "reason": "Insurance", "vat_category": "S", "vat_rate": 25}], "lines": [{"id": "1", "name": "item name", "description": "Description of item", "quantity": 7, "unit": "DAY", "unit_price": 400, "vat_category": "S", "vat_rate": 25, "order_line_reference": "123", "standard_item_id": {"id": "21382183120983", "scheme": "0088"}}, {"id": "2", "name": "item name 2", "description": "Description 2", "quantity": -3, "unit": "DAY", "unit_price": 500, "vat_category": "S", "vat_rate": 25, "order_line_reference": "123", "standard_item_id": {"id": "21382183120983", "scheme": "0088"}}]}
  }'
200 OKPeppol BIS base example rebuilt from JSON, files shortened
{
  "creator": "einvoice/peppol-bis@1",
  "result": {
    "valid": true,
    "format": "Peppol BIS Billing 3.0 (UBL 2.1)",
    "specification_id": "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0",
    "filename": "Snippet1.xml",
    "totals": {
      "currency": "EUR",
      "line_total": "1300.00",
      "allowance_total": "0.00",
      "charge_total": "25.00",
      "total_without_vat": "1325.00",
      "vat_total": "331.25",
      "total_with_vat": "1656.25",
      "prepaid_amount": "0.00",
      "rounding_amount": "0.00",
      "amount_due": "1656.25",
      "vat_breakdown": [
        {
          "category": "S",
          "rate": "25",
          "taxable_amount": "1325.00",
          "vat_amount": "331.25"
        }
      ],
      "lines": [
        {
          "id": "1",
          "net_amount": "2800.00"
        },
        {
          "id": "2",
          "net_amount": "-1500.00"
        }
      ]
    },
    "check": {
      "scenario": "Peppol BIS Billing 3.0 (UBL Invoice)",
      "document_type": "UBL Invoice",
      "specification_id": "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0",
      "errors": 0,
      "warnings": 0,
      "notices": 0,
      "error_rules": [],
      "checks": [
        {
          "check": "XML syntax",
          "passed": true
        },
        {
          "check": "UBL 2.1 Invoice schema",
          "passed": true
        },
        {
          "check": "EN 16931 rules (Peppol BIS 3.0.22 copy)",
          "passed": true
        },
        {
          "check": "Peppol BIS Billing 3.0.22 rules",
          "passed": true
        }
      ],
      "messages": [],
      "messages_truncated": false
    },
    "xml": "<?xml version='1.0' encoding='UTF-8'?>\n<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:sche… (7,516 characters in all)"
  },
  "rules": [
    {
      "name": "OpenPeppol BIS Billing 3.0 Schematron (compiled with SchXslt 1.10.1)",
      "version": "3.0.22",
      "url": "https://github.com/OpenPEPPOL/peppol-bis-invoice-3/releases/tag/3.0.22"
    }
  ]
}

MCP tool create_einvoice_peppol_bis at https://mcp.curatedapi.com. Every input field, the results and the errors in the API reference.

Other e-invoice APIs

Send e-invoices from your app without writing XRechnung yourself

For invoicing apps, shop plugins and ERPs whose customers must send e-invoices: post the invoice as JSON and store or send the file that comes back. Each file has passed the official rules before you get it.

Free for up to 100 invoices created a month. 2,000 invoices created a month cost $9.00 on the Starter plan.