When you add a new company or a new shop in your app, assign a random code to it, then use this code for any order made by the customers.
This will generate a code between 2000 and 9000 randomly and you can assign this code to the company in your spreadsheet.