After following this guide a user will be able to create a new Inventory Feed
The output from this feed can be used to supply inventory availability data to any system
Additional steps will outline optional configuration that can be applied to Inventory Feeds
Steps
Fluent Commerce
Assumptions
This guide assumes the destination S3 bucket has already been created.
Important Callout on Destination S3 Bucket!
Region RestrictionThe destination S3 bucket for your feed must be located in the same AWS Region as the Fluent-managed source bucket. Pointing a feed to a destination S3 bucket in a different Region will result in an exception (`IllegalLocationConstraintException`)Available Options:
Cross-Region Access: Keep your feed files in the source Region and configure your jobs (e.g., Lambda, Glue) so they can be read directly from that location.
Self-Managed Replication: Set up S3 Cross-Region Replication (CRR) to automatically copy new objects from the source Region bucket to a bucket in your desired Region.
It is not necessary to recreate destination S3 buckets when activating or deactivating inventory feeds. The same destination S3 bucket can be used for multiple inventory feeds, making it crucial not to delete the S3 bucket on the destination side unless absolutely required.
Required Steps
A few steps must occur in a specific order to create and enable an Inventory Feed. The feed will not be enabled if steps are skipped or not completed correctly.
Create and configure Inventory Feed
Inventory Feeds are currently created via API. The GraphQL API mutation to do this is createInventoryFeed. See GraphQL API schema for details of the required data for that mutation. When successful, the creation event will respond with a value to add as an S3 Bucket Policy. This value will allow the data to be replicated into your target bucket.
Initial Status
Inventory Feeds will always be set to the status “CREATED” after step one. Once activated with the correct S3 bucket policies applied the feed can be set to “ACTIVE”.
Required Data
Field
Description
Type
ref
Unique reference for the Inventory Feed
String
source
Target source and filters to apply when generating data for Inventory Feed
InventorySourceInput
destination
Target AWS S3 bucket destination for Inventory Feed
InventoryDestinationInput
InventorySourceInput
The `source` field consists of:
type (InventoryDataType!): The type of inventory data. You can choose from:
`INVENTORY_CATALOGUE`
`INVENTORY_POSITION`
`VIRTUAL_CATALOGUE`
`VIRTUAL_POSITION`
filters ([InventoryDataFilterInput]): Optional filters to apply to the inventory data. Each filter consists of:
name (InventoryFilterName!): The name of the filter. You can choose from:
`REF`
`TYPE`
`STATUS`
`CATALOGUE_REF`
operator (InventoryOperator!): The operator for the filter. You can choose from:
`IN`
`NOT_IN`
`EQUAL_TO`
`NOT_EQUAL_TO`
value (Json!): The value to filter by. This can be a single value or an array of values.
How Filters Work
When setting up filters, you first select an inventory data type and then optionally set filters based on that data type. Filters are combined using "AND" conditions, meaning all conditions must be met. Within each filter, "IN" and "NOT IN" operators can handle multiple values with an "OR" condition.
Examples
INVENTORY_POSITION Example
If you select `INVENTORY_POSITION` as the inventory data type and apply the following filters:
STATUS EQUAL_TO "ACTIVE"
CATALOGUE_REF IN ["DEFAULT:1", "DEFAULT:67"]
This setup means:
Fetch all inventory positions where the status is equal to "ACTIVE"
AND the catalogue reference is either "DEFAULT:1" or "DEFAULT:67"
VIRTUAL_POSITION Example
If you select `VIRTUAL_POSITION` as the inventory data type and apply the following filters:
STATUS EQUAL_TO "AT_RISK"
CATALOGUE_REF IN ["BASE:1", "AGGREGATE:1"]
This setup means:
Fetch all virtual positions where the status is equal to "AT_RISK"
AND the catalogue reference is either "BASE:1" or "AGGREGATE:1"
You can add the new security policy to your target S3 bucket by following this guide from AWS: Adding a bucket policy by using the Amazon S3 console - Amazon Simple Storage Service.Once this new policy has been applied, the data produced from the Inventory Feed will be replicated into the target S3 bucket as soon as there is a new piece of data produced by the Inventory feed.
After correctly creating the Inventory Feed and configuring the bucket policy on the target S3 bucket, you can update the Inventory Feed to “ACTIVE”. From this point, the Inventory Feed will begin running on the schedule as defined against the entity.
Validation
When setting a feed to “ACTIVE” we validate everything is set correctly. If this update fails see How to Troubleshoot Inventory Feeds