Magento database: Invoice items database table?

Magento database: Invoice items database table?

July 14, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento database: Invoice items database table?

Magento Database: Locating Invoice Item Data

The Magento e-commerce platform stores extensive data about your online store’s operations in its robust MySQL database. One common question from developers is where to find invoice item data within this complex structure.

Understanding the Core Magento Tables

Magento uses a combination of tables to manage order and invoice data. Let me walk you through the key tables:

  • sales_flat_order: This table stores basic information about each order, such as order ID, status, and customer details.
  • sales_flat_order_item: This is where individual items in an order are stored. Each row represents one product ordered by a customer. It includes columns like item_id, order_id, parent_id (for bundled products), and item-specific details such as price, quantity, and tax.

The Invoice Entities

When it comes to invoices, Magento uses entity tables:

  • sales_order_entity: This table stores the main invoice data. It contains columns like entity_id (order ID), attribute_set_id, increment_id (invoice ID), and others.
  • sales_order_entity_decimal and sales_order_entity_int: These support tables store decimal or integer attributes of the invoices, respectively.

Locating the Invoice Items

Now, onto your specific question: where are the invoice items stored?

Magento actually uses a single table for both order items and invoice items - sales_flat_invoice_item. The difference lies in the invoice_id field. If this field is populated with an invoice ID, then the row represents an invoice item rather than an order item.

Let’s look at an example:

SELECT * FROM sales_flat_invoice_item WHERE invoice_id = 10;

This query will return all items associated with Invoice ID #10. You’ll find columns like item_id, order_id, parent_id (for bundled products), and item-specific details such as price, quantity, and tax.

When sales_flat_invoice_item is Empty

If your sales_flat_invoice_item table appears empty, it might be due to one of two reasons:

  1. You haven’t created any invoices yet.
  2. There’s an issue with the invoice creation process in your Magento installation or extension.

I recommend checking if there are entries in the sales_order_entity table and ensure the increment_id field matches an actual invoice ID in your system.

Conclusion

In summary, to find invoice items in the Magento database, focus on the sales_flat_invoice_item table. When querying this table, use the invoice_id filter to distinguish between order items and invoice items.

If you’re facing issues with empty tables or incorrect data, I suggest checking your Magento installation for any conflicts or missing updates. Don’t hesitate to reach out to our support team at Laravel Company if you need expert assistance in debugging these database issues.

Remember, the key lies in understanding how Magento maps its business logic to its tables, and with this knowledge, you can navigate the data structure effectively.

Catalog Database Orders Customers

Our network