# GENERATED FILE - DO NOT EDIT openapi: 3.1.0 info: title: Flows Service Introduction version: '1.0' description: | With flows, you can: - in Commerce, define custom data fields for the resources that you use in your store or organization, such as adding more fields to the `customer` resource. You can also create new resources, such as a wishlist resource to support wishlists in your store. With flows, you can apply Composable Commerce to almost any use case. See [**Flows in Commerce Manager**](#flows-in-commerce). - in Product Experience Manager, attach a specific set of attributes for your products. In Product Experience Manager, flows are called templates. See [**Templates in Product Experience Manager**](#templates-in-product-experience-manager). You can create flows/templates at both organization and store level. :::caution Custom names and values prefixed with $ are not supported. ::: ### Flows in Commerce You can define custom data fields for the resources that you use in your store or organization, such as adding more fields to the `customer` resource. You can also create new resources, such as a `wishlist` resource to support wishlists in your store. With flows, you can apply Composable Commerce to almost any use case. :::caution - In an organization, not all resources are available. See [**Extend a resource**](https://elasticpath.dev/guides/Custom%20Data/extend-any-resource) for a list of organization resources that can be extended. - If you store any sensitive Personal Identifiable Information (PII) or non-public data on your site, ensure that you do not use this data in flows to avoid potential access to the data. For more information, see [**Permissions**](/docs/authentication/Tokens/permissions). ::: ### 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 product, for example, a product specification. For example, a *Book* template might contain attributes, such as *ISBN*, *Author*, *Number of pages*, *Year Published*, or *Condition (New/Used)*. - You can use templates for Search Engine Optimization (SEO). When you assign template attributes such as, *care instructions* or *fabric*, to a shirt and a shopper searches for a specific item, attributes help stores to return the products that match the search criteria. For example, when a shopper searches for a large blue shirt, all shirts that are large and blue are returned in the search result. servers: - url: https://euwest.api.elasticpath.com description: EU West Production Server - url: https://useast.api.elasticpath.com description: US East Production Server security: - bearerAuth: [] tags: - name: Flows description: | ### 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**](#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`](/docs/api/accounts/account-management-introduction) object. | Store | | `account-members` | Extend the [`account-members`](/docs/api/accounts/account-members) object. | Store | | `account-memberships` | Extend the [`account-membership`](/docs/api/accounts/account-membership) object. | Store | | `addresses` | Extend the [`address`](/docs/api/addresses/account-addresses) object. | Store | | `authentication-realms` | Extend the [`authentication-realms`](/docs/authentication/single-sign-on/authentication-realm-api/authentication-realm-api-overview) object. | Store | | `carts` | Extend the [`carts`](/docs/api/carts/carts-checkout-orders-introduction) object. | Organization/Store | | `cart_items` | Extend the [`cart_item`](/docs/api/carts/cart-items) object. | Organization/Store | | `customers` | Extend the [`customer`](/docs/customer-management/customer-management-api/customer-management-api-overview) object. **Note**: Please use Account Management for all new frontend experiences. | n/a | | `oidc-profiles` | Extend the [`oidc-profiles`](/docs/authentication/single-sign-on/openid-connect-profiles-api/openid-connect-profiles-api-overview) object. | Store | | `order_items` | Extend the [`order_item`](https://elasticpath.dev/docs/commerce-cloud/orders/orders-api/orders-api-overview#the-order-object) object. | Organization/Store | | `orders` | Extend the [`order`](/docs/api/carts/orders) object. | Organization/Store | | `password-profiles` | Extend the [`password-profiles`](/docs/authentication/single-sign-on/password-profiles-api/overview) object. | Store | | `products` | Extend the [`product`](/docs/api/pxm/products/products) object. | Store | | `promotions` | Extend the [`promotion`](/docs/api/promotions/promotions-standard-introduction). | Store | | `user-authentication-info` | Extend the [`user-authentication-info`](/docs/authentication/single-sign-on/user-authentication-info-api/overview) object. | Store | | `user-authentication-oidc-profile-info` | Extend the [`user-authentication-oidc-profile-info`](/docs/authentication/single-sign-on/user-authentication-openid-connect-profile-api/openid-connect-profile-overview) object. | Store | | `user-authentication-password-profile-info` | Extend the [`user-authentication-password-profile-info`](/docs/authentication/single-sign-on/user-authentication-password-profiles-api/password-profile-overview) object. | Store | | `catalogs` | Extend the [`catalog`](/docs/api/pxm/catalog/catalogs) object. It will not extend the [`catalog-release`](/docs/api/pxm/catalog/releases) 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**](#core-and-non-core-flows). :::note [Custom APIs](/docs/api/commerce-extensions/custom-ap-is#custom-apis-vs-non-core-flows) 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. | :::caution 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**](/docs/api/flows/create-an-entry-relationship) 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**](/docs/api/flows/create-an-entry-relationship) 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**](/docs/api/flows/fields). - name: Fields description: | With fields, you can: - in Commerce, use a field in your flows to represent single field of data (for example a `Product Rating`) to be applied to an entity - in Product Experience Manager, use an attribute in your template to attach a characteristic like `color` to a product. A field/attribute represents a single piece of data. All fields/attrbutes have a `field_type` (`string`, `integer`, `boolean`, `date` or `relationship`), a default value, and an optional set of validation rules. :::caution - Custom names and values prefixed with `$` are not supported. - There is a hard limit of 100 fields per flow. ::: #### Field/Attribute Validation Rules When creating a field/attribute, you can add validation to the values that are stored. The validation you use depends on the `field_type` of the field/attribute. Each validation rule is expressed as a validation rule object. #### `string` / `enum` Must be one of a predefined collection of strings. If you leave the field blank or enter an incorrect value then an `Invalid Value` error is displayed. | Attribute | Type | Description | | :--- | :--- | :--- | | `type` | `string` | `enum` | | `options` | `array[string]` | An array of valid string values. | ##### `string` / `email` Must be a valid email address. | Attribute | Type | Description | | :--- | :--- | :--- | | `type` | `string` | `email` | ##### `string` / `slug` Can contain only letters, numbers, hyphens and underscores. | Attribute | Type | Description | | :--- | :--- | :--- | | `type` | `string` | `slug` | ##### `integer` / `between` Must be between the two provided values. | Attribute | Type | Description | | :--- | :--- | :--- | | `type` | `string` | `enum` | | `options` | `object` | An object containing `from` and `to` integers. | ##### `integer` / `enum` Must be one of a predefined collection of integers. | Attribute | Type | Description | | :--- | :--- | :--- | | `type` | `string` | `enum` | | `options` | `array[integer]` | An array of valid integer values. | ##### `float` / `between` Must be between the two provided values. | Attribute | Type | Description | | :--- | :--- | :--- | | `type` | `string` | `enum` | | `options` | `object` | An object containing `from` and `to` floats. | ##### `float` / `enum` Must be one of a predefined collection of floats. | Attribute | Type | Description | | :--- | :--- | :--- | | `type` | `string` | `enum` | | `options` | `array[float]` | An array of valid float values. | #### `date` / `enum` Must be one of a predefined collection of dates. | Attribute | Type | Description | | :--- | :--- | :--- | | `type` | `string` | `enum` | | `options` | `array[string]` | An array of valid date values as strings \(`YYYY-MM-DD HH:MM:SS` - time is optional\). | ##### `relationship` / `one-to-many` Allows multiple relationships to be created. | Attribute | Type | Description | | :--- | :--- | :--- | | `type` | `string` | `one-to-many` | | `to` | `string` | The entity type you are making relationships with in singular form (for example, `product`). | ##### `relationship` / `one-to-one` Allows only a single relationships to be created on an entry. | Attribute | Type | Description | | :--- | :--- | :--- | | `type` | `string` | `one-to-one` | | `to` | `string` | The entity type you are making relationships with in singular form (for example, `customer`). | - name: Entries description: | ### Entries in Commerce Entries hold the pieces of data collected within the fields. If your flow has more than one field related to it, you see multiple field slugs. ### Entries in Product Experience Manager Entries hold the pieces of data collected within the attributes. If your template has more than one attribute related to it, you see multiple attribute slugs. - name: Entry Relationships description: | ### Entry Relationships in Commerce When you create a field that uses `relationship` as a `field_type`, you update your entry values using the `Entry Relationship` endpoints. ### Entry Relationships in Product Experience Manager Once you have created your templates, you must associate them with your products using the `Entry Relationship` endpoints. paths: /v2/flows: get: tags: - Flows summary: Get all Flows description: | - For Commerce, this endpoint retrieves a list of flows. - For Product Experience Manager, this endpoint retrieves a list of templates. operationId: getAllFlows responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/Flows' examples: default: value: data: - id: 6d320b42-237d-4474-8452-d49f884d4ae1 type: flow name: Products-1 slug: products-1 description: Extends the default product object enabled: true links: self: https://useast.api.elasticpath.com/v2/flows/6d320b42-237d-4474-8452-d49f884d4ae1 relationships: {} meta: owner: organization timestamps: created_at: '2018-05-10T18:04:26.623Z' updated_at: '2018-05-10T18:04:26.623Z' '400': $ref: '#/components/responses/ValidationError' '500': $ref: '#/components/responses/InternalServerError' post: tags: - Flows summary: Create a Flow description: | - For Commerce, this endpoint creates a flow. - For Product Experience Manager, this endpoint creates a template. :::caution Custom names and values prefixed with $ are not supported. ::: operationId: createAFlow requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/FlowsRequest' - examples: - data: description: Extends the default product object enabled: true name: Products slug: products type: flow contentMediaType: application/json examples: default: value: data: description: Extends the default product object enabled: true name: Products slug: products type: flow required: true responses: '201': description: '' content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/Flows' examples: default: value: data: id: 6d320b42-237d-4474-8452-d49f884d4ae1 type: flow name: Products-1 slug: products-1 description: Extends the default product object enabled: true links: self: https://useast.api.elasticpath.com/v2/flows/6d320b42-237d-4474-8452-d49f884d4ae1 relationships: {} meta: owner: organization timestamps: created_at: '2018-05-10T18:04:26.623Z' updated_at: '2018-05-10T18:04:26.623Z' '422': $ref: '#/components/responses/ValidationError' '500': $ref: '#/components/responses/InternalServerError' /v2/flows/{flowID}: get: tags: - Flows summary: Get a Flow description: | - For Commerce, this endpoint retrieves a flow. - For Product Experience Manager, this endpoint retrieves a template. operationId: getAFlow parameters: - name: flowID description: The unique identifier of the flow/template you want to retrieve. in: path required: true style: simple schema: $ref: '#/components/schemas/UUID' responses: '200': description: '' content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/Flows' examples: default: value: data: id: 38ba1451-efa4-4361-9ca6-3fb646490f37 type: flow name: extraFieldRenamed slug: products description: Extends the default product object enabled: true links: self: https://useast.api.elasticpath.com/v2/flows/38ba1451-efa4-4361-9ca6-3fb646490f37 relationships: {} meta: owner: organization timestamps: created_at: '2018-05-10T01:41:36.009Z' updated_at: '2018-05-10T15:27:26.241Z' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' delete: tags: - Flows summary: Delete a Flow description: | - For Commerce, this endpoint deletes a flow. We recommend that you remove all the fields assigned to a flow before deleting a flow. - For Product Experience Manager, this endpoint deletes a template. We recommend that you remove all the attributes assigned to a template before deleting a template. operationId: deleteAFlow parameters: - name: flowID description: The unique identifier of the flow/template you want to delete. in: path required: true style: simple schema: $ref: '#/components/schemas/UUID' responses: '204': description: No Content '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' put: tags: - Flows summary: Update a Flow description: | - For Commerce, this endpoint updates a flow. - For Product Experience Manager, this endpoint updates a template. Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the flow/template is not updated. operationId: updateAFlow parameters: - name: flowID description: The unique identifier of the flow/template you want to update. in: path required: true style: simple schema: $ref: '#/components/schemas/UUID' requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/FlowsUpdateRequest' contentMediaType: application/json examples: default: value: data: id: 25617d3e-14a6-434c-bfab-3fda87517aaf description: Extends the default product object enabled: true name: Products slug: products type: flow required: true responses: '200': description: '' content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/Flows' examples: default: value: data: id: 6d320b42-237d-4474-8452-d49f884d4ae1 type: flow name: extraFieldRenamed slug: products-1 description: Extends the default product object enabled: true links: self: https://useast.api.elasticpath.com/v2/flows/6d320b42-237d-4474-8452-d49f884d4ae1 relationships: {} meta: owner: store timestamps: created_at: '2018-05-10T18:04:26.623Z' updated_at: '2018-05-10T18:11:47.469Z' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' /v2/fields: get: tags: - Fields summary: Get all Fields description: | - For Commerce, this endpoint retrieves all fields in a flow. - For Product Experience Manager, this endpoint retrieves all attributes in a template. operationId: getAllFields responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/Field' examples: default: value: data: - id: e88d03d3-d46e-40d0-8302-25e6b5b1bd33 type: field field_type: boolean slug: on_sale name: On Sale? description: Is this on sale? required: false default: null enabled: true order: null omit_null: false validation_rules: [] links: self: https://useast.api.elasticpath.com/v2/flows/9d69c6cf-aaee-4dc6-8908-d2bd053446a2/fields/e88d03d3-d46e-40d0-8302-25e6b5b1bd33 relationships: flow: data: id: 9d69c6cf-aaee-4dc6-8908-d2bd053446a2 type: flow meta: owner: organization timestamps: created_at: '2018-08-23T10:28:43.609Z' updated_at: '2018-08-23T10:28:43.609Z' '400': $ref: '#/components/responses/ValidationError' '500': $ref: '#/components/responses/InternalServerError' post: tags: - Fields summary: Create a Field description: | - For Commerce, this endpoint creates a field. - For Product Experience Manager, this endpoint creates an attribute. operationId: createAField requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/FieldRequest' contentMediaType: application/json examples: default: value: data: default: 4 description: Average rating as given by our users enabled: true field_type: integer name: Product Rating order: 1 relationships: flow: data: id: '{{flowID}}' type: flow required: false slug: product-rating type: field validation_rules: - options: from: 1 to: 5 type: between required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/Field' examples: default: value: data: type: field name: Product Rating slug: product-rating field_type: integer validation_rules: - type: between options: from: 1 to: 5 description: Average rating as given by our users required: false default: 0 enabled: true order: 1 omit_null: false relationships: flow: data: type: flow id: e4145c27-aba1-46af-81a3-58f5e1cf7f15 '422': $ref: '#/components/responses/ValidationError' '500': $ref: '#/components/responses/InternalServerError' /v2/fields/{flowFieldID}: get: tags: - Fields summary: Get a Field description: | - For Commerce, this endpoint retrieves a field. - For Product Experience Manager, this endpoint retrieves an attribute. operationId: getAField parameters: - name: flowFieldID description: The unique identifier of the flow/template whose field/attribute you want to retrieve. in: path required: true style: simple schema: $ref: '#/components/schemas/UUID' responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/Field' examples: default: value: data: id: 102b2087-d56a-45e7-bf1c-e9517716abb3 type: field field_type: integer slug: product-rating name: Product Rating description: Average rating as given by our users required: false default: null enabled: true validation_rules: - type: between options: from: 1 to: 5 order: 1 omit_null: false links: self: https://useast.api.elasticpath.com/v2/flows/6d320b42-237d-4474-8452-d49f884d4ae1/fields/102b2087-d56a-45e7-bf1c-e9517716abb3 relationships: flow: data: id: 6d320b42-237d-4474-8452-d49f884d4ae1 type: flow meta: owner: organization timestamps: created_at: '2018-05-10T18:19:11.559Z' updated_at: '2018-05-10T18:19:11.559Z' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' put: tags: - Fields summary: Update a Field description: | - For Commerce, this endpoint updates a field. - For Product Experience Manager, this endpoint updates an attribute. Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the field/attribute is not updated. operationId: updateAField parameters: - name: flowFieldID description: The unique identifier for the flow/template to which the field/attribute you want to update belongs. in: path required: true style: simple schema: $ref: '#/components/schemas/UUID' requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/FieldUpdateRequest' contentMediaType: application/json examples: default: value: data: default: 1 description: Average rating as given by our users field_type: integer id: '{{flowFieldID}}' name: Product Rating required: true slug: product-rating type: field required: true responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/Field' examples: default: value: data: id: 102b2087-d56a-45e7-bf1c-e9517716abb3 type: field field_type: integer slug: start-of-life name: start-of-life description: day the iphone will work required: true default: '2018-01-01' enabled: true validation_rules: - type: between options: from: 1 to: 5 order: 1 omit_null: false links: self: https://useast.api.elasticpath.com/v2/flows/6d320b42-237d-4474-8452-d49f884d4ae1/fields/102b2087-d56a-45e7-bf1c-e9517716abb3 relationships: flow: data: id: 6d320b42-237d-4474-8452-d49f884d4ae1 type: flow meta: owner: organization timestamps: created_at: '2018-05-10T18:19:11.559Z' updated_at: '2018-05-10T18:36:01.208Z' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/ValidationError' '500': $ref: '#/components/responses/InternalServerError' delete: tags: - Fields summary: Delete a Field description: | - For Commerce, this endpoint deletes a field. - For Product Experience Manager, this endpoint deletes an attribute. operationId: deleteAField parameters: - name: flowFieldID description: The unique identifier of the field/attribute that you want to delete. in: path required: true style: simple schema: type: string responses: '204': description: No Content '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' /v2/flows/{flowSlug}/entries: get: tags: - Entries summary: Get all Entries description: | - For Commerce, this endpoint retrieves all entries for a flow. - For Product Experience Manager, this endpoint retrieves all entries for a template. operationId: getAllEntries parameters: - name: flowSlug in: path required: true description: The slug for the flow/template you want to create an entry for. style: simple schema: type: string - $ref: '#/components/parameters/page-limit' - $ref: '#/components/parameters/page-offset' responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/Entry' examples: default: value: data: - id: ce1f0b19-23c3-487b-aa2a-552b77abdf0c type: entry brand-image: https://files-eu.epusercontent.com/e8c53cb0-120d-4ea5-8941-ce74dec06038/61118f21-14a2-466c-a84b-c30b1f900cf9.png meta: owner: organization timestamps: created_at: '2018-06-05T20:58:25.596Z' updated_at: '2018-06-05T20:58:25.596Z' links: self: https://useast.api.elasticpath.com/v2/flows/brands/entries/ce1f0b19-23c3-487b-aa2a-552b77abdf0c - id: a5fcf6bc-233f-44d7-a3b0-0961eed3df9d type: entry brand-image: some image for brand x meta: owner: organization timestamps: created_at: '2018-06-06T14:48:59.006Z' updated_at: '2018-06-06T14:48:59.006Z' links: self: https://useast.api.elasticpath.com/v2/flows/brands/entries/a5fcf6bc-233f-44d7-a3b0-0961eed3df9d '400': $ref: '#/components/responses/ValidationError' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/ValidationError' '500': $ref: '#/components/responses/InternalServerError' post: tags: - Entries summary: Create an Entry description: | - For Commerce, this endpoint creates an entry for a flow. - For Product Experience Manager, this endpoint creates an entry for a template. operationId: createAnEntry parameters: - name: flowSlug in: path required: true description: The slug for the flow/template you want to create an entry for. style: simple schema: type: string requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/FlowsEntriesRequest' contentMediaType: application/json examples: default: value: data: FIELD_SLUG: a value type: entry required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/Entry' examples: default: value: data: id: 10fe2aca-09fb-42fe-a1d4-081134320641 type: entry meta: owner: organization timestamps: created_at: '2021-10-26T17:10:56.329Z' updated_at: '2021-10-26T17:10:56.329Z' links: self: https://epcc-integration.global.ssl.fastly.net/v2/flows/products/entries/10fe2aca-09fb-42fe-a1d4-081134320641 '400': $ref: '#/components/responses/ValidationError' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/ValidationError' '500': $ref: '#/components/responses/InternalServerError' /v2/flows/{flowSlug}/entries/{flowEntryID}: get: tags: - Entries summary: Get an Entry description: | - For Commerce, this endpoint retrieves an entry from a flow. - For Product Experience Manager, this endpoint retrieves an entry from a template. operationId: getAnEntry parameters: - name: flowSlug in: path required: true description: The slug for the flow/template. style: simple schema: type: string - name: flowEntryID in: path required: true description: The ID of the entry. style: simple schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/Entry' examples: default: value: data: id: 4abb8316-d0a2-4c91-bf29-4d19ba932227 type: entry meta: owner: organization timestamps: created_at: '2018-05-10T15:28:59.192Z' updated_at: '2018-05-10T15:28:59.192Z' links: self: https://useast.api.elasticpath.com/v2/flows/products/entries/4abb8316-d0a2-4c91-bf29-4d19ba932227 '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' delete: tags: - Entries summary: Delete an Entry description: | - For Commerce, this endpoint deletes an entry from a flow. - For Product Experience Manager, this endpoint deletes an entry from a template. operationId: deleteAnEntry parameters: - name: flowSlug in: path required: true description: The slug for the flow/template. style: simple schema: type: string - name: flowEntryID in: path required: true description: The ID of the entry. style: simple schema: type: string responses: '204': description: No Content '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' put: tags: - Entries summary: Update an Entry description: | - For Commerce, this endpoint updates an entry for a flow. - For Product Experience Manager, this endpoint updates an entry for a template. operationId: updateAnEntry parameters: - name: flowSlug in: path required: true description: The slug for the flow/template. style: simple schema: type: string - name: flowEntryID in: path required: true description: The ID of the entry. style: simple schema: type: string requestBody: description: '' content: application/json: schema: allOf: - $ref: '#/components/schemas/FlowsEntriesUpdateRequest' contentMediaType: application/json examples: default: value: data: FIELD1_SLUG: value1 FIELD2_SLUG: value2 id: '{{entryID}}' type: entry required: true responses: '200': description: OK headers: {} content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/Entry' examples: default: value: data: id: 03224af8-da41-4761-99fb-a125fa81ed99 type: entry brand-image: a new image meta: owner: organization timestamps: created_at: '2018-06-06T14:42:39.312Z' updated_at: '2018-06-06T14:42:39.312Z' links: self: https://useast.api.elasticpath.com/v2/flows/brands/entries/03224af8-da41-4761-99fb-a125fa81ed99 '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/ValidationError' '500': $ref: '#/components/responses/InternalServerError' deprecated: false /v2/flows/{flowSlug}/entries/{flowEntryID}/relationships/{flowFieldSlug}: post: tags: - Entry Relationships summary: Create an Entry Relationship description: | - In Commerce, create an entry relationship to one or more resources. If any relationships already exist, the ones made in the request are added to them. - In Product Experience Manager, create an entry relationship with the product to which you want to associate the template. operationId: createAnEntryRelationship parameters: - name: flowSlug in: path required: true description: The slug of the flow/template that the entry belongs to. style: simple schema: type: string - name: flowFieldSlug in: path required: true description: The slug of the field/attribute that the relationship belongs to. style: simple schema: type: string - name: flowEntryID in: path required: true description: The ID of the entry you are requesting. style: simple schema: type: string requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/FlowsEntriesRelationshipsFieldSlugRequest' contentMediaType: application/json examples: default: value: data: - id: '{RESOURCE_ID}' type: '{RESOURCE_TYPE}' - id: '{RESOURCE_ID}' type: '{RESOURCE_TYPE}' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/Relationships' examples: default: value: data: - type: brand id: 0d28e5b6-f615-4e1c-b038-275cfde97927 '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/ValidationError' '500': $ref: '#/components/responses/InternalServerError' put: tags: - Entry Relationships summary: Update an Entry Relationship description: | - In Commerce, updates an entry relationship to one or more resources. If any relationships already exist, the ones made in the request are added to them. - In Product Experience Manager, updates an entry relationship with the product to which you want to associate the template. operationId: updateAnEntryRelationship parameters: - name: flowSlug in: path required: true description: The slug of the flow/template that the entry belongs to. style: simple schema: type: string - name: flowFieldSlug in: path required: true description: The slug of the field/attribute that the relationship belongs to. style: simple schema: type: string - name: flowEntryID in: path required: true description: The ID of the entry you are requesting. style: simple schema: type: string requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/FlowsEntriesRelationshipsFieldSlugRequest' contentMediaType: application/json examples: default: value: data: - id: '{RESOURCE_ID}' type: '{RESOURCE_TYPE}' - id: '{RESOURCE_ID}' type: '{RESOURCE_TYPE}' required: true responses: '201': description: Created content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/Relationships' examples: default: value: data: - type: brand id: 0d28e5b6-f615-4e1c-b038-275cfde97927 '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/ValidationError' '500': $ref: '#/components/responses/InternalServerError' delete: tags: - Entry Relationships summary: Delete an Entry Relationship description: | - In Commerce, deletes an entry relationship to one or more resources. - In Product Experience Manager, deletes an entry relationship with the product to which you want to associate the template. operationId: deleteAnEntryRelationship parameters: - name: flowSlug in: path required: true description: The slug of the flow/template that the entry belongs to. style: simple schema: type: string - name: flowFieldSlug in: path required: true description: The slug of the field/attribute that the relationship belongs to. style: simple schema: type: string - name: flowEntryID in: path required: true description: The ID of the entry you are requesting. style: simple schema: type: string responses: '204': description: No Content '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' /v2/flows/{flowSlug}/fields: get: tags: - Fields summary: Get all Fields by Flow description: Get all Fields by Flow operationId: getAllFieldsByFlow parameters: - name: flowSlug in: path required: true description: The slug of the flow the entry belongs to. style: simple schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/Field' examples: default: value: data: - id: 23d26fd2-d2e2-4c72-b4b4-3ef7a31bc47f type: field field_type: string slug: background_color name: background colors description: background color for the product required: false default: '#ffffff' enabled: true validation_rules: [] order: null omit_null: false links: self: https://useast.api.elasticpath.com/v2/flows/248c7776-bd9f-4075-8980-461b02ed3757/fields/23d26fd2-d2e2-4c72-b4b4-3ef7a31bc47f relationships: flow: data: id: 248c7776-bd9f-4075-8980-461b02ed3757 type: flow meta: owner: organization timestamps: created_at: '2017-06-26T12:55:33.560Z' updated_at: '2017-12-19T12:31:24.570Z' - id: 5f4be5bd-0c83-417a-b744-7d8c49636ab1 type: field field_type: string slug: background_image name: Background Image description: The background image for the category required: false default: null enabled: true validation_rules: [] order: null omit_null: false links: self: https://useast.api.elasticpath.com/v2/flows/248c7776-bd9f-4075-8980-461b02ed3757/fields/5f4be5bd-0c83-417a-b744-7d8c49636ab1 relationships: flow: data: id: 248c7776-bd9f-4075-8980-461b02ed3757 type: flow meta: owner: organization timestamps: created_at: '2018-03-29T10:33:24.056Z' updated_at: '2018-03-29T10:33:24.056Z' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' components: securitySchemes: bearerAuth: type: http scheme: bearer parameters: page-offset: name: page[offset] description: | The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used. in: query style: form explode: true schema: type: string examples: - '0' page-limit: name: page[limit] description: | The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [**page length**](/docs/commerce-cloud/global-project-settings/settings-overview#page-length) store setting is used. in: query style: form explode: true schema: type: string examples: - '10' schemas: FlowsRequest: title: FlowsRequest type: object properties: data: type: object properties: description: type: string description: A brief description of a flow/template outlining details such as purpose, usage instructions and so on. examples: - A flow to extend the `customer` resource. - A SizeGuide template for the clothing that we sell. enabled: type: boolean examples: - true name: type: string description: The name of a flow/template. examples: - Products slug: type: string description: A unique slug identifier for a flow/template. examples: - products type: type: string description: Represents the type of object being returned. examples: - flow Flows: title: Flows type: object properties: id: $ref: '#/components/schemas/UUID' type: type: string description: A unique identifier for a flow/template. example: flow name: type: string description: The name of a flow/template. example: Products slug: type: string description: A unique identifier of a flow/template. example: products description: type: string description: A short description for a flow/template. example: Extends the default product object enabled: type: boolean example: true links: $ref: '#/components/schemas/FlowsLinks' relationships: $ref: '#/components/schemas/FlowsRelationships' meta: $ref: '#/components/schemas/Meta' Entry: title: Entry type: object properties: id: $ref: '#/components/schemas/UUID' type: type: string description: Represents the type of object being returned. example: entry links: $ref: '#/components/schemas/FlowsLinks' meta: $ref: '#/components/schemas/Meta' additionalProperties: type: string description: There can be a `:fieldSlug` attribute for each field/attribute attached to a flow/template. The type depends on the field type. Relationships: title: Relationships type: object properties: id: $ref: '#/components/schemas/UUID' type: type: string description: Represents the type of object being returned. example: brand FieldRequest: title: FieldRequest type: object properties: data: type: object properties: default: type: number description: Specifies a default value for a field/attribute if no value is provided and the field/attribute is required. examples: - 0 description: type: string description: A description for a field/attribute. examples: - Average rating as given by our users enabled: type: boolean examples: - true field_type: type: string description: | This field is immutable and cannot be updated. You can have the following field types: - `string` - `integer` - `boolean` - `float` - `date` - `relationship` examples: - integer name: type: string description: The name of a field/attribute. examples: - Product Rating order: type: number description: Denotes the order in which a field/attribute is returned relative to the rest of flow fields/template attributes. examples: - 1 relationships: $ref: '#/components/schemas/FieldRelationships' required: type: boolean description: | `true` if required on input, `false` if not. Always `false` if the `field_type` `relationship`. examples: - false slug: type: string description: A unique identifier of a field/attribute. examples: - product-rating type: type: string description: Represents the type of object being returned. examples: - field validation_rules: type: array items: $ref: '#/components/schemas/FieldValidationRules' description: An array of validation rule objects. See [**Field Validation Rules**](#fieldattribute-validation-rules). examples: - options: from: 1 to: 5 type: between FieldUpdateRequest: title: FieldUpdateRequest type: object properties: data: type: object properties: default: type: number description: A default value if none is supplied and the field/attribute is required. examples: - 1 description: type: string description: A description for a field/attribute. examples: - Average rating as given by our users field_type: type: string description: | This field is immutable and cannot be updated. The type of field: - `string` - `integer` - `boolean` - `float` - `date` - `relationship` examples: - integer id: $ref: '#/components/schemas/UUID' name: type: string description: The name of a field/attribute. examples: - Product Rating required: type: boolean description: | `true` if required on input, `false` if not. Always `false` if the `field_type` is `relationship`. examples: - true slug: type: string description: A unique identifier of a field/attribute. examples: - product-rating type: type: string description: Represents the object being returned. examples: - field Field: title: Field type: object properties: id: $ref: '#/components/schemas/UUID' type: type: string description: Represents the type of object being returned. examples: - field field_type: type: string description: | This field is immutable and cannot be updated. You can have the following field types: - `string` - `integer` - `boolean` - `float` - `date` - `relationship` examples: - integer slug: type: string description: A short description for a field/attribute. examples: - product-rating name: type: string description: The name of a field/attribute. examples: - Product Rating description: type: string description: A short description of a field/attribute. examples: - Average rating as given by our users required: type: boolean description: | `true` if required on input, `false` if not. Always `false` if the `field_type` is a relationship. examples: - true default: type: - number - string - 'null' description: A default value if none is supplied and a field/attribute is not required. examples: - 1 enabled: type: boolean examples: - true order: type: - number - 'null' description: Denotes the order in which this field is returned relative to the rest of the flow/template fields/attributes. examples: - 1 omit_null: type: boolean description: Hide this field/attribute from responses if the value is `null`. examples: - true validation_rules: type: array items: $ref: '#/components/schemas/FieldValidationRules' meta: $ref: '#/components/schemas/Meta' links: $ref: '#/components/schemas/FieldLinks' relationships: $ref: '#/components/schemas/FieldRelationships' FieldValidationRules: type: object description: An array of validation rule objects. See [Field/attribute Validation Rules](#fieldattribute-validation-rules). properties: type: type: string description: The validation you use depends on the `field_type` of the field/attribute. Each validation rule is expressed as a validation rule object. example: enum enum: - enum - email - slug - between - one-to-many - one-to-one options: anyOf: - type: array description: An array of valid string values. items: type: string - type: object description: An object containing `from` and `to` integers. properties: from: type: - integer - string example: 1 to: type: - integer - string example: 5 to: type: string example: customer Meta: type: object properties: owner: type: string description: The resource owner, either `organization` or `store`. example: enum enum: - store - organization timestamps: type: object properties: created_at: type: string description: The date and time a resource is created. example: '2023-10-11T13:02:25.293Z' updated_at: type: string description: The date and time a resource is updated. example: '2023-10-11T13:02:25.293Z' FieldRelationships: type: object description: Relationships are established between different flow/template entities. For example, a field/attribute is related to a flow/template, as the field/attribute is attached to the flow/template. properties: flow: type: object properties: data: type: object properties: id: $ref: '#/components/schemas/UUID' type: type: string description: Represents the type of object being returned. example: flow FlowsRelationships: type: object description: Relationships are established between different flows/templates entities. For example, a field and an entry are related to a flow as both are attached to it. properties: fields: type: object properties: data: $ref: '#/components/schemas/Relationships' FieldLinks: type: object description: | Links allow you to move between requests. Single entities use a `self` parameter with a link to that specific resource. Listing pages use the following: | Property | Description | | --- | --- | | `current` | Always the current page | | `first` | Always the first page | | `last` | `null` if there is only one page. | | `prev` | `null` if you are on the first page. | | `next` | `null` if there is only one page. | properties: self: type: string example: https://euwest.api.elasticpath.com/v2/flows/3cf3ad3f-b12c-4a08-a6ab-05e6aab0122c/fields/c1c788d1-f1c7-4b90-938f-f158f3353c66 FlowsLinks: type: object description: | Links allow you to move between requests. Single entities use a `self` parameter with a link to that specific resource. Listing pages use the following: | Property | Description | | --- | --- | | `current` | Always the current page | | `first` | Always the first page | | `last` | `null` if there is only one page. | | `prev` | `null` if you are on the first page. | | `next` | `null` if there is only one page. | properties: self: type: string example: https://euwest.api.elasticpath.com/v2/flows/d2a9b22a-b4b0-456b-bbc7-d8723aaffa84 FlowsUpdateRequest: title: FlowsUpdateRequest type: object properties: data: type: object properties: description: type: string description: A brief description of a flow/template outlining details such as purpose, usage instructions, and so on. examples: - Extends the default product object enabled: type: boolean examples: - true name: type: string description: The name of a flow/template. examples: - Products id: $ref: '#/components/schemas/UUID' slug: type: string description: A unique slug identifier for a flow/template. examples: - products type: type: string description: Represents the type of object being returned. examples: - flow FlowsEntriesRequest: title: FlowsEntriesRequest type: object properties: data: type: object description: Specifies the type of the resource object. properties: FIELD_SLUG: type: string description: Where **FIELD_SLUG** is the slug for each field/attribute on this flow/template along with the corresponding value. You must provide a field slug and a value for the entry. You can have multiple field slugs if they are related to the flow/template. examples: - a value type: type: string description: Represents the type of object being returned. examples: - entry FlowsEntriesRelationshipsFieldSlugRequest: title: FlowsEntriesRelationshipsFieldSlugRequest type: object properties: data: type: array description: The data to be stored. items: type: object properties: id: $ref: '#/components/schemas/UUID' type: type: string description: The resource type of the object. examples: - customer FlowsEntriesUpdateRequest: title: FlowsEntriesUpdateRequest type: object properties: data: type: object properties: FIELD1_SLUG: type: string description: The field slug for each field/attribute in a flow/template and the corresponding value for the entry. You can have multiple field slugs if they are related to the flow/template. examples: - value1 FIELD2_SLUG: type: string description: The field slug for each field/attribute in a flow/template and the corresponding value for the entry. You can have multiple field slugs if they are related to the flow/template. examples: - value2 id: $ref: '#/components/schemas/UUID' type: type: string description: Represents the type of the resource object. examples: - entry ErrorResponse: required: - errors properties: errors: type: array items: $ref: '#/components/schemas/Error' Error: required: - status - title properties: status: type: integer format: int description: The HTTP response code of the error. example: 500 title: type: string description: A brief summary of the error. example: Internal server error detail: type: string description: Optional additional detail about the error. example: An internal error has occurred. request_id: type: string description: Internal request ID. example: 00000000-0000-0000-0000-000000000000 meta: type: object description: Additional supporting meta data for the error. example: missing_ids: - e7d50bd5-1833-43c0-9848-f9d325b08be8 UUID: type: string description: A unique identifier for a resource. format: uuid example: 00000000-0000-0000-0000-000000000000 responses: InternalServerError: description: Internal server error. There was a system failure in the platform. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: internal-server-error: value: errors: - status: 500 title: Internal Server Error detail: There was an internal server error, you can report with your request id. request_id: 635da56d-75a1-43cd-b696-7ab119756b3a ValidationError: description: Bad request. The request failed validation. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: missing-name: value: errors: - title: Validation Error status: 400 detail: 'data.attributes.name: "name" is required' NotFound: description: Bad request. Not Found. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: internal-server-error: value: errors: - title: Not Found status: 404