Click Fraud Protection
PHP related blog, freelancer to hire!

Magento invoices mysql table located

If you’re looking where Magento stores its invoices, first step was to locate table sales_order_invoice, but such table doesn’t exists.

Good starting point is always a Magento API, which shows you a little bit how to digg for information.

I’ve located api.xml file responsible for invoices API and then found Model which does all magic.


Check method

public function items($filters = null) – to get all invoices


public function info($invoiceIncrementId)  – how to read invoice details

Next very important thing – Entities – this will tell you how all elements are structured and where located in mysql table


For example:

'invoice' => array(
'entity_model'      => 'sales/order_invoice',
'table'             =>'sales/order_entity',

Invoices are store in sales_order_entity ( try SELECT * FROM sales_order_entity WHERE entity_type_id = 16)

Invoices items

'invoice_item' => array(
'entity_model'      => 'sales/order_invoice_item',
'attributes' => array(
'parent_id'     => array(

That should be enough to see what’s going on

Leave a Reply