Skip to main content

Invoices

Saleor version required: 3.10Repository: GitHub

Introduction

The Invoices app allows you to generate simple PDF invoice files for every order in your store.

Features

Generates a PDF file when an invoice is requested (in the Dashboard or with an API). Then attaches it to the order.

The invoice shop address can be inherited from the Shop settings or configured manually per channel.

Assumptions & limitations

  • The PDF template is fixed and can't be changed by the user.
  • The PDF template is in English only.

Permissions

The App requires MANAGE_ORDERS permission to be able to:

  • Receive the INVOICE_REQUESTED webhook
  • Read order data to generate the invoice
  • Attach the invoice to the order

The staff user configuring the App must have MANAGE_APPS and MANAGE_ORDERS permissions.

Application flow

The App reacts on a single webhook, and it ends its flow once a PDF file is attached to the order.

See the detailed flow below:

Configuration

The app allows to configure a shop address per each channel separately.

If the channel is not configured, the app will fetch the Shop address from settings and use it.

Testing

To verify if the app works:

  1. Ensure the "Invoices" legacy plugin is disabled; otherwise, duplicated invoices can be generated.
  2. Ensure the App is installed and enabled.
  3. Optionally configure the custom address. If the custom address is not configured, fill Shop address in the Dashboard settings.
  4. Find any order in the Dashboard, find the "Invoices" section, and click the "Generate" button.
  5. Wait a couple of seconds and refresh the dashboard.
  6. The invoice should be attached to the order in the "Invoices" section.

Troubleshooting

  • During development with Saleor running locally, there are file uploading issues; see this issue.

Check Github issues to see up to date list of known issues or to report a new one.

Development

Visit the development guide to learn more about App Store app development.

Env variables

Apart from common env variables, the Invoice app accepts the following:

  • TEMP_PDF_STORAGE_DIR= - a temp directory where the PDF files will be stored. In Vercel, set /tmp. Add it to .gitignore

Differences between the plugin and the app

  • The invoice name is different. The plugin uses the invoice creation date; the app uses the order creation date.
  • The invoice template is different. The app additionally displays the Seller (shop) address. The shipping is displayed as a line item.