Applies to: Orders API | Catalog API
Learn how to generate catalog items in your test account using a script.
The Sandbox test account token that you configured in your application determines whether you should run this catalog seeding script.
- New Sandbox test account, no seeded data - Run the catalog item script.
- New Sandbox test account, seeded data - Your new Sandbox test account has items for a flower shop.
- If you want flowers and food items on the application menu, run the catalog item script.
- If you want the application menu to show only flowers, don't run the catalog item script.
- New developer account, default test account - Run the catalog item script.
The order-ahead sample application automatically reads your catalog item data (including images and prices) and imports them into the application.
Note
If you created a test account with a seeded dataset, the food items seeded by this sample application are co-mingled with the flower shop items created by the Developer Console seeding script. To avoid this problem, you should create a new Sandbox test account for use with the order-ahead sample. Create it without the seeded data.
To generate some test catalog items:
Run the following command in the root directory of the sample application:
npm run seedOn success, you see a list of successfully generated catalog items.
> NODE_ENV=sandbox node ./bin/script/seed-catalog.js generate Successfully uploaded item: #Salmon with Zucchini Successfully uploaded item: #Fried Chicken Sandwich Successfully uploaded item: #Italian Sandwich Successfully uploaded item: #Autumn Soup Successfully uploaded item: #Oatmeal with Fruit Successfully uploaded item: #Sunny-Side Egg on Toast Successfully uploaded item: #Steak Tacos Successfully uploaded item: #Mediterranean Yogurt Bowl Successfully uploaded item: #Meatballs Successfully uploaded item: #Pancakes with Fruit Successfully uploaded item: #Grilled Steak Successfully uploaded item: #Bacon CheeseburgerGo to localhost:3000 and refresh the page. It should now be populated with test catalog items.