How to make a app that can order online things like amazon?

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.

image
This will generate a code between 2000 and 9000 randomly and you can assign this code to the company in your spreadsheet.