• Log in
  • Contact Sales
  • Evaluate

Get in touch  

Concepts • Flows

How Flows work

Last updated: 26 Jun 2019

One of the great features of Moltin is the ability to extend existing core resources and the flexibility to create your own, custom. With Flows, you are able to create various types of fields, including strings, booleans, dates, integers and relationships with other custom flows.

The Moltin API aims to provide predictable, easy to use, RESTful endpoints that can power any ecommerce project. With Flows, you are able to apply Moltin to almost any use case.

Flows taxonomy

When we talk about Flows, we need to talk about Fields and Entries that are an integral part of them. A Flow describes a collection of Fields, whereas 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 (for example, a single product). Entries for core Flows (existing resources) are managed automatically for you.

So to put simply, Flows are like tables in a database. Fields are like columns whereas Entries are like database records.

There are two scenarios for using Flows:

  • Extending an existing resource (e.g. products, orders, etc.).
  • Adding a new resource (e.g. blog, wish list, customer review, etc.).

Extend an existing resource

The most common usage of the Flows API is to extend existing resources like products, customers and orders. These are called core Flows and are handled by Moltin differently to non-core Flows - see: Custom Data in the API Reference for details and the full list of core Flows.

If you wish to store extra fields per product, such as manufactured_date for customers or a string field to store a colour hexadecimal for the product for use on the UI, you'll want to extend the products resource.

Create a new resource

With the power of Flows, you can create new resources to power product reviews, wish lists, blog articles, staff profile pages, and many more. These are typically referred to as custom Flows.

Further reading

The guides listed below show examples of how to use Flows to extend and create resources.

1. Extending Existing resources:

2. Creating new resources: 

Here's some developer content we have on our Moltin blog regarding Flows:

Explore More Concepts

01 Jul 2019

How to calculate cart and order totals

There are two methods that may be used to calculate cart and order totals. The method used depends on the calculation_method setting. The default is currently the simple method and this will continue...

Read More
author
James Carter
in Orders | Carts
18 Jun 2019

How promotions work

Promotions allow you to provide discounts to customers. By defining a Promotion and a code, you put in place the facility to offer discounts to customers applied directly to their shopping carts.

Read More
author
George FitzGibbons
in Carts | Promotions
06 Jun 2019

When to use a custom cart

Custom carts allow you to process an order for any type of item you wish to sell. The item does not need to exists in Moltin, which means custom cart items can be used for all sort of use cases.

Read More
author
George FitzGibbons
in Carts