Flows
Flows in Commerce
There are two scenarios for using flows:
- Extend an existing resource, such as customers and orders.
- Create a new resource, such as a blog, wishlist, or customer review.
Extend an existing resource
The most common usage of the Flows API is to extend existing resources, such as customers
and orders
. These types of resources are called core flows and are handled differently than non-core flows. See Core and non-core flows.
For example, you can extend the customer
resource to store custom data, such as a user_profile
field for customers. Or you might want to add an age
field to store a customer's age.
Extending a resource applies only to core flows. When creating a new flow, make sure the slug
matches that of a core resource listed in the following table.
Flow slug | Description | Availability Level |
---|---|---|
accounts | Extend the account object. | Store |
account-members | Extend the account-members object. | Store |
account-memberships | Extend the account-membership object. | Store |
addresses | Extend the address object. | Store |
authentication-realms | Extend the authentication-realms object. | Store |
carts | Extend the carts object. | Organization/Store |
cart_items | Extend the cart_item object. | Organization/Store |
customers | Extend the customer object. Note: Please use Account Management for all new frontend experiences. | n/a |
oidc-profiles | Extend the oidc-profiles object. | Store |
order_items | Extend the order_item object. | Organization/Store |
orders | Extend the order object. | Organization/Store |
password-profiles | Extend the password-profiles object. | Store |
products | Extend the product object. | Store |
promotions | Extend the promotion . | Store |
user-authentication-info | Extend the user-authentication-info object. | Store |
user-authentication-oidc-profile-info | Extend the user-authentication-oidc-profile-info object. | Store |
user-authentication-password-profile-info | Extend the user-authentication-password-profile-info object. | Store |
catalogs | Extend the catalog object. It will not extend the catalog-release object. | Store |
Create a new resource
You can create new resources to support product reviews, wish lists, blog articles, staff profile pages, and many more. These non-core flows are referred to as custom flows. See Core and non-core flows.
Custom APIs are the next generation of Non-Core Flows. Flows are not going anywhere, but Custom APIs offer enhanced capabilities. We recommend using Custom APIs for any of your new use cases.
Core and non-core flows
The following table describes the differences between core and non-core flows:
Core Flows | Non-core Flows |
---|---|
Extend an existing resource. | Create a new resource. |
Entries managed automatically by Commerce. | Create and manage entries manually. |
Requests are sent to the fields endpoint. | Requests are sent to the entries endpoint. |
You cannot delete core flows after creating them with the API or Commerce Manager.
Flows taxonomy
Fields and entries are an integral part of flows. A flow describes a collection of fields. A field represents a single field of data. An entry is a specific instance of a flow, and is associated with a specific instance of an entity, such as a single customer. Entries for core flows (existing resources) are managed automatically for you.
In database terms, you can think of flows as tables, fields as columns, and entries as database records.
Templates in Product Experience Manager
Templates allow you to attach a specific set of attributes to your products.
- You can use templates to define characteristics of your products.
- You can use templates for Search Engine Optimization (SEO).
Template Taxonomy
Attributes and entries are integral to templates. A template describes a collection of attributes. An attribute represents a single characteristic, like color. An entry is a specific instance of an attribute, for example, blue, and is associated with a specific product.
A template is exactly the same as a flow except it has a different naming convention. The name of a template is in the format products(slug) where slug is the slug of a template.
Associating templates with products
Once you have created your template, and associated the temp with a product in Product Experience Manager, it becomes a template.
For example, if you create a template with a slug of SizeGuide
then the template name is products(SizeGuide). You can then associate this template to all clothing products in your store and the slug is included in all the responses that contain products.
You can create product templates for both organization and store. In addition, stores can use organization templates for store-level products.
For more information about adding attributes, see Fields.
📄️ Get all Flows
- For Commerce, this endpoint retrieves a list of flows.
📄️ Create a Flow
- For Commerce, this endpoint creates a flow.
📄️ Get a Flow
- For Commerce, this endpoint retrieves a flow.
📄️ Delete a Flow
- For Commerce, this endpoint deletes a flow. We recommend that you remove all the fields assigned to a flow before deleting a flow.
📄️ Update a Flow
- For Commerce, this endpoint updates a flow.