Developer Guide
Getting Started with fabric Product Catalog API
fabric Product Catalog API supports CRUD operations related to Product Catalog. This service is designed to provide low latency reads and search functionalities for the storefront. It supports event-driven updates to ensure the data is always up-to-date without manual intervention, efficient cache management for faster data retrieval, and scalability to handle high volumes of traffic.
This guide provides step-by-step instructions to help you get started with fabric Product Catalog API, from initial setup to basic usage.
Target Audience
- Solution Integration (SI) partners responsible for configuring the Product Catalog for e-commerce.
- Third-party developers who set up Product Catalog on behalf of merchants.
- The fabric developers who work with Product Catalog.
Knowledge and Skill Requirements
The target audience should:
- Understand REST APIs, in the context of e-commerce.
- Get familiar with fabric APIs.
- Know the concepts related to Product Catalog.
- Create a strategy to migrate from a third-party product information management system if applicable.
- Understand caching strategies and technologies.
- Have access to development tools capable of interacting with HTTP-based APIs, such as Postman or cURL for testing.
We also recommend you to:
- Maintain a list of attributes that need to be assigned to products and categories.
- Identify the mandatory and optional attributes.
- Develop a strategy for organizing products within a hierarchical tree structure of categories and collections.
- Create a product list consisting of individual items, variants, and bundles of items and variants.
Workflow
The following workflow diagram illustrates the step-by-step interaction process with the Product Catalog API:
The following steps outline the process:
- Create attributes that can be assigned to categories and associated products.
- Map fabric-mandatory attributes with merchant-defined attributes.
- Create categories as the primary organizational structure.
- Assign attributes to categories.
- Create collections to display products on storefronts and support storefront-specific use cases, including promotions.
- Add products, such as individual items, variants, and bundles of items and variants.
Configuring Product Catalog
To configure Product Catalog:
Prerequisites
You must have the following:
- Access and Permissions Setup
- Ensure that you have Admin or Editor role to set up Product Catalog. For more information about the roles and permissions offered through fabric Identity service, see the Role-based Access Control (RBAC) section.
- Click here to understand the roles and permissions supported through Role-based Access Control (RBAC) offered through fabric Identity service.
- Use the V3 version of the Product Catalog API.
- Ensure that you have Admin or Editor role to set up Product Catalog. For more information about the roles and permissions offered through fabric Identity service, see the Role-based Access Control (RBAC) section.
- Authentication and Security Protocols
- Ensure that you have a valid Authorization Token to provide in the header. For additional information, see the Client S2S Authorization token guide.
Procedure
Use this procedure to configure Product Catalog. The API collections for the endpoints are:
- Postman collection for attributes.
- Postman collection for categories.
- Postman collection for products.
- Create attributes using one of the following methods:
- Individually: Create a new attribute using the Create attribute endpoint. By specifying the
target
in the request body as aproduct
orcategory
, you can assign the attribute to a product or a category, respectively. - Bulk Import: Import multiple attributes through bulk import APIs. For more information, see the bulk import guide.
- (Optional) Create attribute groups using the Create attribute groups endpoint and group relevant attributes. The attribute groups can then be assigned to products.
- Individually: Create a new attribute using the Create attribute endpoint. By specifying the
- Map the mandatory fabric attributes, such as
sku
,title
,image
, andactive
status, to the corresponding attribute names provided by the merchant. To create new mapping or update an existing mapping, use the Update attribute endpoint. - Create categories using one of the following methods:
- Individually: Create a new category using the Create category endpoint. A root category is created by default and can’t be modified.
- Import Multiple Categories: Add multiple new categories using the Create multiple categories endpoint. You can add up to 25 categories.
- Bulk Import: Add multiple categories (more than 25) through bulk import APIs. For additional information, refer to the bulk import guide. You can add other category IDs to
categoryIdsIncluded
which automatically includes a categories catalog of items. Similarly, you can exclude categories usingcategoryIdsExcluded
.
- Assign attributes to categories using the Create category and Partially update category endpoint. The attributes of a category automatically cascade to all products associated with that category.
- (Optional) Create collections to display products on storefront using the Create collections endpoint.
- Add products, which may be items, variants, and bundles, using one of the following methods:
-
Add Item: Add items using the following methods:
- Individually: Add a single item using the Add product endpoint and specify the
type
as item. - Add Multiple items: Add multiple items using the Add products endpoint and specify the
type
as item. You can add up to 25 items in a single request. - Bulk Import: Import multiple products through bulk import APIs. For additional information, refer to bulk import guide.
- Individually: Add a single item using the Add product endpoint and specify the
-
Add Variants: For creating variants for a product, you must set the product’s
status
flag toLIVE
. If a product status isDRAFT
, variants are treated as separate products. Add variants using the following methods:- Individually: Add a single variant using the Add product endpoint and specify the
type
as variant. - Add Multiple Variants: Add multiple variants using the Add Products endpoint and specify the
type
as variant. You can add up to 25 variants. - Bulk Import: Import variants using the bulk import APIs. For additional information, refer to the bulk import guide.
Note: To add a variant, itsparentProduct
must be in published or draft status. Initially, thetype
remains asitem
until the parent is published. Once the parent is published, thetype
is updated tovariant
. Additionally, both the parent and its children should belong to the same category and channel.
- Individually: Add a single variant using the Add product endpoint and specify the
-
Add Bundles: Add bundles using the following methods:
- Individually: Add a single bundle using the Add Product endpoint and specify the
type
as bundle. - Add Multiple Products: Add multiple bundles using the Add Products endpoint and specify the type as bundle. You can add up to 25 bundles.
- Bulk Import: Import bundles using the bulk import guide API. When bulk importing attributes, specify their corresponding type and subtype in the template. The following list shows the Attribute types and their corresponding Attribute sub types:
- Serial: None
- Date-Time: None
- Boolean: None
- Number: None
- Text: Small text
- Text: Text area
- Text: HTML
- Options: Single
- Options: Multiple
Note: When creating a bundle, make sure to specify the
bundleProducts
. Ensure the individual items or their variants, which you intend to include in the bundle, already exist in the system. - Individually: Add a single bundle using the Add Product endpoint and specify the
-
Import Product Data Through Bulk Import
The following diagram illustrates the step-by-step process to bulk import attributes, categories, collections, items, variants, and bundles:
Take the following steps to bulk import:
- Download the template based on the
type
, which could be items, variants, bundles, attributes, categories, or collections. A CSV template with header columns is returned in the response. You can add required data in the template and save the file in your local system.
The following code sample provides an example for the template:
Bash
The following code sample provides an example to bulk import attributes:
Bash
- Retrieve the AWS S3 bucket URL used to upload the import file by using the Create file object and get upload location endpoint.
The following code sample provides an example to retrieve the upload URL to import a file:
Bash
- Make a PUT request with the upload URL, returned in the response of the step 2, to upload the updated CSV file from your local system.
- Download one or more previously imported or exported files, including error files, use the Get files available for a merchant endpoint.
The following code sample provides an example:
Bash
- To view the status of previously imported or exported files, use the Get jobs endpoint.
The following code sample provides an example to retrieve the import history:
Bash
Examples
The following examples provide step-by-step instructions to create a category structure, attributes, collections, and products for Lamps.
Use the following table to reference the category, subcategories, and products that will be created by following along.
Category | Sub-Categories | Products |
---|---|---|
Lamps | ||
Ceiling Lamps | ||
Atlas Pendant Ceiling Lamp | ||
Apollo Pendant Ceiling Lamp | ||
Table Lamps | ||
Hudson Table Lamp | ||
Luminary Table Lamp |
In the fabric Product Catalog API Service, both products and categories have attributes. Each product can have multiple attributes associated with it. Because you need to add attributes to both categories and products, the first step in building the Lamps category is to create the attributes needed to fulfill our objective. In this example, lamps need to have a Style
attribute for all the products.
1. Create the Style
Attribute with the Values Modern
, Traditional
, and Rustic
The product-attributes
endpoint is used to create different product and category attributes. In this example, the Style
attribute is created for products. This attribute differentiates lamps based on design aesthetics, such as modern or rustic. In this example the type
is set to OPTIONS
since multiple accepted values are added.
Note that if you set isMandatory
to true
in the request, anything with the Style
attribute requires a value. This means if a product inherits or has the Style
attribute, it must have one of the acceptedValues
outlined in the request below.
Bash
The response includes a product attribute ID for Style
. This ID is required in subsequent API requests for mapping.
2. Create a new Lamps
Category
Use the categories
endpoint to create a new category with the name Lamps
.
Bash
After creating a category successfully, a response with the ID for the new category is returned. Use this ID to set up sub-categories.
3. Create the Ceiling Lamps
and Table Lamps
sub-categories
Use the bulk insert API for categories when you need to create more than one subcategory at a time. You must provide the parentCategoryId
that you previously received in step 2 when making the parent category Lamps
.
Optionally, you can also set isLocalizable
to true
and provide localized names.
Bash
4. Map the Style
attribute
With attribute mapping, you can update existing attributes and add new attributes to a category or product.
In this example, the product attribute ID corresponding to the Style
attribute is added to the Lamps
category, and the isMandatory
flag set to true
. With this setting, all products within the Lamps
category must have a value corresponding to the Style
attribute.
When you add an attribute to a parent category, such as Lamps
, it automatically applies to all its sub-categories. In this example, Ceiling Lamps
and Table Lamps
are children of the Lamps
category, so they inherit the mandatory Style
attribute.
For mapping, use the categories
endpoint and provide the ID corresponding to the Style
attribute that’s returned in the response from the product-attribute
endpoint.
Bash
5. Create products and variants with attributes
This example requires four products with variants, so the products status
is set to LIVE
to create variants and the parentProduct
field is included in the request body. The following code example shows adding the products using the bulk insert API for products
, which includes the mandatory attributes values:
Bash
Create a Sale
category for Modern Style Furniture
and Cyber Monday
- Create the parent collection,
Sale
.
Bash
- Create the sub category
Current Sales
. TheparentCollectionID
is returned from the previous response when creating the parent collectionSale
.
Bash
- Create the
Modern Style Furniture
andCyber Monday
categories.
Bash
Optionally, you can include products in a sale tab by filtering for specific attributes using productAttributeFilters
.
Error Handling
For effective error handling in Product Catalog V3, refer to the API documentation which outlines standard HTTP error codes, such as 400 (Bad Request), 404 (Not Found), and 500 (Internal Server Error).
Next Steps
Once the above steps are completed, you are all set with the basic setup; you may proceed to use all features and capabilities available to you. Refer to the Related Resource for additional information.
Related Resources
For additional information, refer to the following:
- Product Catalog FAQs.
- Sample store to view the given product organization.
- User guide for Product Catalog in Copilot.
- API reference for all operations related to attributes
- API reference for all operations related to categories.
- API reference for all operations related to collections.
- API reference for all operations related to products based on SKU or product ID.
Contact
If you have questions that aren’t answered in the existing documentation, contact fabric support.
Was this page helpful?