Changing Order Increment ID & Prefixes in Magento

Some time Store Admin wants to have different different prefixes for Order#, Invoice#, Credit Memo# and Shipment#. Say you want Order# to start with 1, Invoice# with 2, Credit Memo# with 3 and Shipment# with 4, for this please follow following steps (I’m assuming you’re making this change in a fresh store)

  • Place a test Order, if you’ve not placed any so far, then invoice, ship and create a credit memo for this order.
  • After performing above activities you’ll see four entries in ‘eav_entity_store’ table, one for each
  • To know which entity_type_id represents what please run query “SELECT * FROM `eav_entity_type` WHERE `entity_type_id` IN (4, 18, 24, 28)”. I tested this in Magento and found 4, 18, 24, 28 values in `eav_entity_type`.`entity_type_id` column. In your case these values may be different if you’re using different version. Well, in my case 4 represents ORDER, 18 represents INVOICE, 24 represents SHIPMENT and 28 represents CREDIT MEMO
  • Now after knowing which ‘entity_type_id’ representing what in ‘eav_entity_store’ table you need to edit ‘increment_prefix’ columns value as per your choice. By default values in this column will be 1 for all four records
  • After changing values for ‘increment_prefix’ column, please make sure you change prefix in ‘increment_last_id’ column as well. For example if you see ‘increment_last_id’ as 100000099 for entity Invoice and you have changed Invoice# prefix with 2 then change 100000099 with 200000099
Posted in:

Leave a Reply