Customer Invoices

Import a customer e-invoice

Changed on

Import a customer invoice from an e-invoice file. The file must be a Factur-X PDF, a standalone UBL XML invoice, or a standalone CII XML invoice. Optionally provide invoice_options to pre-fill customer and line-level data. Invoice line e_invoice_line_id must match Factur-X BT-126 (LineID) or the UBL/CII line identifier.

⚠️ UBL and CII XML support is in alpha. A 201 response confirms the file was accepted and parsed, but invoices imported via standalone UBL or CII XML have two known limitations:

  • The uploaded file is not displayed in the app — no document preview is generated yet for these formats.
  • The invoice is not recognized as an electronic invoice within Pennylane.

Factur-X PDF remains the recommended format for production use.

ℹ️ This endpoint requires the following scope: customer_invoices:all

post/api/external/v2/customer_invoices/e_invoices/imports

Request

  • Base URL
    https://app.pennylane.com
  • URL
    https://app.pennylane.com/api/external/v2/customer_invoices/e_invoices/imports
  • Auth
    OAuth 2
    Authorization code: https://app.pennylane.com/oauth/authorize
    Token URL: https://app.pennylane.com/oauth/oauth/token scopes: customer_invoices:all

Headers

X-Company-Idstring
Example:12345

Numeric ID of the company to act on. Required when authenticating with a firm token. Ignored when the token is already bound to a company.

Request body multipart/form-data

filestring binary required

The customer invoice file to be imported. Must be a Factur-X PDF, a UBL XML invoice, or a CII XML invoice.

send_to_paboolean

If true, the invoice will be automatically sent to the PA after parsing. The send is optimistic: it happens without waiting for schematron validation. If the invoice is invalid, the PA may reject it later (visible via e_invoicing.status).

Example request

{
  "invoice_options": {
    "customer_id": 12,
    "invoice_lines": [
      {
        "ledger_account_id": 123,
        "product_id": 456
      }
    ]
  },
  "override_invoice_lines": [
    {
      "currency_amount": "50.00",
      "currency_tax": "10.00",
      "vat_rate": "FR_200",
      "ledger_account_id": 706,
      "quantity": 1,
      "raw_currency_unit_price": "50.00",
      "product_id": 42
    }
  ]
}

Response

Customer e-invoice imported successfully

idinteger required
urlstring required

The URL of the imported customer e-invoice. This can be used to access the document later.

Example response

{
  "id": 42
}

Changes

    • info

      added the new optional header request parameter X-Company-Id

    • info

      added the new optional request property

    • info

      added the new optional request property