Digital Sovereignty for everyone

REST API & Admin Interface

REST endpoint

GET /wp-json/lh-woocommerce-pdf-invoicing/v1/invoice/{order_id} generates and streams a PDF invoice for the specified order.

Authentication: Standard WordPress REST API authentication — cookie+nonce (?_wpnonce=...), application passwords, or any other WP REST auth method.

Permission:

  • Users with install_plugins capability (admins) may download any order’s invoice.
  • Logged-in customers may download invoices for their own orders only.
  • Unauthenticated requests are rejected with HTTP 401.

Response: Binary PDF (Content-Type: application/pdf) with Content-Disposition: attachment.

HTTP Status Reason
401 Not logged in
403 Logged in but order belongs to a different customer
404 Order ID not found

Admin interface

PDF Invoice metabox

A PDF Invoice metabox appears in the side column of every WooCommerce order edit screen, containing a Download PDF Invoice button that links directly to the REST endpoint with a wp_rest nonce. Requires the install_plugins capability.

Order actions dropdown

A Download PDF Invoice entry is available in the WooCommerce order actions dropdown. Selecting it and clicking Update redirects the admin to the REST download URL. Requires the install_plugins capability.

My Account orders screen

A Download Invoice button appears alongside the standard order action buttons on the customer’s My Account → Orders screen, visible to the order’s own customer only.

Constants

Constant Description
LH_WOOCOMMERCE_PDF_INVOICING_VERSION Current plugin version string
LH_WOOCOMMERCE_PDF_INVOICING_FILE Absolute path to the main plugin file
LH_WOOCOMMERCE_PDF_INVOICING_DIR Absolute path to the plugin directory (trailing slash)

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.