Magento2.2.4, php7;

I have multiple stores where I want each one of them to have a different order number's prefix. Is there anyway to realize that?


Edit: I'm trying to avoid using raw queries, any other (safer) way ?


2 Answers 2


You can manage it like below:

Magento 2 database contains a table name 'sales_sequence_profile' which has prefix column and every row contains a meta_id which relates with table 'sales_sequence_meta'.

Table 'sales_sequence_meta' sequence table names according to stores and type(order, invoice, shipment, creditmemo, rma).

  • sequence_order_* contains the last inserted order ids
  • sequence_shipment_* contains the last inserted shipment ids
  • sequence_invoice_* contains the last inserted invoice ids
  • sequence_creditmemo_* contains the last inserted creditmemo ids
  • sequence_rma_item_* contains the last inserted rma item ids

Basically this is just for understanding. You need to update the table 'sales_sequence_profile' and related sequence tables.


You can change this using by changing related store db tables. i.e

if your store id is 1 :

change prefix column value in your sales_sequence_profile table against your meta_id = 1;


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.