Generate Test Catalog Items

Applies to: Orders API | Catalog API

Learn how to generate catalog items in your test account using a script.

Link to section

Overview

If you don't already have catalog items in your test account, you can run a script to generate some test catalog items. The order-ahead sample application automatically reads your catalog item data (including images and prices) and imports them into the application.

Link to section

Catalog items

To generate some test catalog items:

  1. Run the following command in the root directory of the sample application:

    npm run seed

    On 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 Cheeseburger
  2. Go to localhost:3000 and refresh your application. It should now be populated with test catalog items.

    A graphic showing the populated test catalog items.