We've been working hard recently to improve the developer experience when using the Moltin API to build an online store.
An important part of this is to look at how we can make working with custom data - Flows even easier. We're very excited to talk about some of the updates we're ready to ship!
Better flows functionality on carts & orders
One of the most reported issues with Flows was that the behaviour of Flow Fields on items in carts was unpredictable. We've shored this up so whether you're doing a
POST with any type of
item in your
cart, Flow Fields are attached to the correct objects.
You can also now attach Flow data to
carts & objects more easily. While previously most of our users would add an
item to a
cart, then do a second request to add custom data (Flows), this can now be achieved in a single request, just pass the Flow data with the add to cart request:
This also works when checking a cart out. You can pass any custom data (Flows) that should be attached to the
Improved behaviour when creating/updating an entity with Flow Fields
In some instances when updating a core entity with Flow Fields that have validation rules. It was possible that the core entity would be updated and the flows validation would fail. In this situation, the user would get a
200 response and have no idea their Flow Fields were not updated. We've modified this behavior to return the error response code and validation error message.
When responding to
POST requests that included Flows data, the values from the original client request were attached to the response, rather than the data returned from the Flows service. This meant that there could sometimes be slight differences in how the data was formatted. Coupled with the issue above, it could also mean that it looked like Flow data had been saved when it hadn't been saved because of a validation error.
We've streamlined the process for updating a Flow, meaning all
POST requests for entities that use Flow Fields will see a performance boost.
We've made some changes that will allow us to tweak how Flows requests work even more, so that there is scope to improve performance again in the future.