Learn the basics of the Square Catalog API by creating a simple product catalog for a cafe that serves coffee in small and large sizes, with skim or whole milk.
To build this catalog, you call the UpsertCatalogObject endpoint to create the following catalog objects to represent the for-sale item (Coffee
). You include two variations (Small Coffee
and Large Coffee
) of the sale item, a CatalogTax object as taxes applied to the coffee item, and two optional modifications (with Skim Milk
and Whole Milk
).
- A CatalogItem object named
Coffee
for coffee drinks. - Two CatalogItemVariation objects named
Small
andLarge
for the coffee drink size variations. - A CatalogTax object for the sales tax applied when a payment is made on the coffee drink order.
- Two CatalogModifier objects for the two milk choices.
- A CatalogModifierList object to hold the two CatalogModifier objects to apply the milk choices to the coffee item.
The following steps are generally applicable to creating catalog objects of other types, except for uploading an image object. For information about how to upload an image to a catalog and attach it to an item, item variation, or category, see Work with Images.