Ingram Document
Ingram Document
File logic
· Ideal Case - One full daily with all full delta files
StockV2 Full
StockV2 Delta
· Second Option - Part One and Part Two full files once weekly with daily delta files or One full
weekly with once daily delta files
· Download the first Full file one time only and all sequential Delta files.
· Only show titles that are currently available to sell (or in stock)
· Show titles that are temporarily out of stock (OS) and can be backordered in the La Vergne
DC.
· Show titles that can be pre-ordered or that have not yet published / released (NYP / NYR).
Position 1 - GTN - 0 – means books – need to check what else we are getting
39to45 + 46to52 + 53to59 + 60to66 + 67to73 + 74to80 + 81+87 ----- We need to add and save it
as total Qty on hand.
88to94 --- they have mentioned as for future use, so ideally it should be 000000, can we verify. If
it is 000000, then we can add it in above logic so that when they add new warehouse we don’t
have to change the logic for On Hand Qty.
166to168 - Discount level
Other titles could be sold as Short, Long or Net. These would break out as follows:
Net = No Discount
Short – Less than REG – Example 30, 25, 20, 15, 10
Long – Larger than REG – Example 50, 55, 60
179to180 – Publisher status code - See reference file, inventory\prodstat.txt for complete list of
values.
TP,"Temporarily out of stock because publisher cannot supply" ----- We don’t need this
181to188 – Y is important for us and we should consider this only, if it is N, 39to87 respective
warehouse qty should be considered 0. Ideally it would be zero if it is N.
206to213 - return date ---- Date = "00010101" – the title is NOT Returnable. Date = "99991231"
– a Return Date has not been set.
219 – Backorder only indicator - Consider Y, 1 & 2
220 - Media Mail indicator - this is imp field and help us in calculating shipping cost
R Hardcover - also called cloth, retail trade, or trade --- Book Category
T Calendars, blank books, and other book-like sideline items - --- Book Category
M Gifts, Cards, and other non-book sideline items - need to save this in separate table as this is
for GM.
U Other Spring Arbor - - need to save this in a separate table as this is for GM. Need to check if
position one has 0 in all or some other value also.
239to244 - need to make sure it is not 000000, if it is needed to insert but send notification so
that we can add weight.
256to259 – Need to check if there are blank or 00000 values. This 4 digit code are assigned to
the publisher name, check file ibspubnum.txt. We need to save the publisher name using the
code.
"D","Only available in the United States." ---- We will consider this only
for domestic marketplaces
The Inventory Country Exclusion file we need to take from FTP. File
Location \inventory File Name ctry_excl_titles.txt Availability • Download
from FTP server • Monday by 1:00am CST • Updated weekly • Reference File
country.txt Details on Page 15. Need to take one file and see how they are
handling EAN which has multiple country exclusion. We will need these
details to make a decision.
272-273----
10,"Not yet available","Not yet available" ---- Not imp, no need to save
20,"Available","Available from Ingram (form of availability unspecified)" --- Very imp, need to
take this only
21,"In stock","Available from Ingram as a stocked item" ---- Very imp, need to take this only
22,"To order","Available from Ingram as a non-stocked item, for special order" --- not imp, we
can ignore this
31,"Out of stock","Stocked item - temporarily out of stock" --- we should save it so that as soon
as it is instock it goes live
40,"Not available","Not available from Ingram (reason unspecified)" ---- no need to consdier
Inventory Estimated Time of Arrival (ETA) File This file provides an estimate time of arrival
(ETA) for titles that are temporarily out of stock and On-Order with the publisher. Ingram uses a
historical publisher fulfillment performance to calculate the ETA for each of the Ingram
Distribution Centers (DC). File Location \inventory File Name [email protected] ----- We dont need
to read this file as once they are live or available it will automatically reflect in Delta files.
Inventory International Price File This file supplies Ingram customers with the publisher supplied
price for International currencies. Ingram currently captures the Suggested Retail (SRP) and the
Publisher Supplied Price in United States and Canadian dollars. Please see the StockV2 file for
the U.S. Suggested Retail Price and the U.S. Publisher Supplied Price. File Location \inventory
File Name [email protected] --- We dont need this.
Inventory Removal File This file provides a list of titles that are no longer stocked by Ingram.
This file would be used if you miss delta Stockv2 files and are unable to process the full stock
file to refresh your system. Then you would use the list to remove item from your system just as
you would the Stockv2 file. Items in this file will have a Product Availability code of “40” – “Not
Available from Ingram” in positions 272-273. There are 4 files options, depending on the time
frame you would like to process the file: • 2 days • 15 days • 30 days • 180 days File Location
\inventory --- we should run this file every 15 days.
Proposition 65 Warnings File This file provides a list of product warnings provided by the
publisher to meet the State of California’s Proposition 65 warnings that are required by law to be
displayed on websites/in store to California Customers. Proposition 65 requires businesses to
provide warnings to Californians about significant exposures to chemicals that cause cancer,
birth defects or other reproductive harm. These chemicals can be in the products that
Californians purchase, in their homes or workplaces, or that are released into the environment.
File Locations \inventory \Inventory_Reference_Files File Name Prop65_Warnings.txt --- This is
a very imp file, we need to take this and mark EAN where this is applicable and save the
narrative, this we will use while listing.
Publisher Sales Rights These files provide a Sales Rights by Country, Territory, or Rest of World
provided by the publisher where products can be sold. There are 3 files to determine Sales
Rights with 3 translation code files, specifications for each are listed below. You will want to
check for the Country and Territory Sales Rights Restriction or Inclusion by knowing the Sale
Right Type Code and also reviewing the Rest of World (ROW) file. File Locations
\inventory\SalesRights File Name SalesRights_Country.txt SalesRights_ROW.txt
SalesRights_Territory.txt Country_ONIX.txt (translation file) SalesRightsTypeCd.txt (translation
file) Territory_ONIX.txt (translation file)
Goal
Build a scalable, maintainable, extendable service to capture price and quantity updates from
vendors. The goal is to keep the inventory as fresh as possible keeping in mind various
engineering challenges. In this case, we need to ingest price and quantity data from Ingram.
High-level requirements
1. Capture price and quantity updates from Ingram.
2. Update the information in your own database and market places.
3. Provide a real-time view of the ingestion pipeline.
Step 1
We want to capture the data provided by Ingram’s FTP server.
Under the ideal case, we are mainly interested in 2 files:
Data File File Name File Type Avg Size
StockV2 Full: This is the "master" file, which contains all active Ingram titles that are available
to sell and is generated six times per day.
StockV2 Delta: This Delta file contains all incremental updates for titles where select fields
have changed, and a record has been added or deleted since the previous file was created.
This file is created by comparing the current and previous master files (StockV2 Full). A unique
file name is used for each new file.
With the ideal case, we would ingest StockV2 Full once and all StockV2 Delta files daily.
Step 2
Post download of the files, we need to filter the data from the files keeping in mind various
business requirements.
Level 1 Filters
Following are the Filters we need to apply to the StockV2 files.
Transformations
15 – 28 14 UPC Remove 2
zero’s from
prefix
In Step 2, we have level 1 filters defined. Level 1 filters are applied such that the filtered titles fit
our business across marketplaces. Additional filters will be defined below as per the
requirements for each geographic location. Examples of level 2 filters:
- The Inventory Country Exclusion file
- Proposition 65 Warnings File
- Publisher Sales Rights
In Step 2, we also have transformation defined. Transformations are done to help us prepare
the title data in the right format for listing on various marketplaces or as per the requirements of
downstream vendors.
Step 3
Post filtering and transformations, we need to convert the listings in the output format required
by AOB and ADP
ADP
2 – 14 13 EAN
29–38 10 ISBN-10
Restrictions
Narration
AOB
2 – 14 13 EAN
29–38 10 ISBN-10
List Flag
Project Plan
Pending Tasks
Task Assigned To
Future tasks
Convert Product Type Ingram code in ADP. Please See comments by [email protected]
Understanding updating existing items in ADP.
Proposed solutions
Option 1: Use CloudWatch with AWS Lambda to trigger the download of files on a specific
schedule
Advantages:
1. Serverless: We don’t really need to worry about managing compute resources.
2. Monitoring is easier.
3. Separation of tasks with CloudWatch events rule.
Disadvantages:
1. Uses AWS native technologies so migrating to a different cloud provider would mean a
few changes.
Option 2: Use an EC2 instance to download files from Ingram SFTP to Amazon S3
Advantages:
1. Code will be cloud vendor agnostic.
Disadvantages:
1. Maintenance, monitoring burden on developers to make sure the solution is fault
tolerent.
Proposed solutions
Option 1: Use a relation DB with Amazon Aurora or Amazon RDS to store the helper files and
AWS lambda that is triggered whenever new files are available in S3 buckets.
Advantages:
1. Using RDS with MySQL would mean we use existing technology in our tech stack.
2. Easy to replicate in a data warehouse.
3. Query syntax is known and can be used to run ad-hoc queries for analytical purposes.
Disadvantages:
1. If the data size increases RDS can turn out to be expensive.
2. RDS is optimized for storage over reads and writes.
Option 2: Use DynamoDB as it is optimized for high volume and throughput
Advantages:
1. DynamoDB is perfect for high throughput applications.
2. DynamoDB is optimized for reads and writes.
3. Cost effective compared to Relational DB.
Disadvantages:
1. Doesn’t support complex joins.
Proposed solutions
Option 1: Use AWS Step functions
With AWS step functions, we define a main orchestrator step function that is responsible for
splitting the file into multiple smaller files and store them in S3. These smaller files are handled
by other chunk step functions which are responsible for filtering, transforming and enriching the
stock records and store the file in S3. After smaller chunks are processed, the main orchestrator
would then be responsible for merging the smaller files and storing the data in S3.
Steps
1. S3 event notification trigger the lambda function once the stock files are available.
2. Lambda function triggers the main step function.
3. Main step function splits the large file into smaller files.
4. For each smaller file trigger the chunk step function.
5. In the chunk step function
a. Transform each record and write into S3.
b. If record transformation fails, write into Dynamo DB.
6. Merge the processed chunk files in the main step function.
7. Store monitoring info from the main step function in the Dynamo DB.
Option 2: Use Amazon Kinesis
With Amazon Kinesis, we make the process of ingesting ingram stock items in streaming
fashion. What this means is that in the future, if we have a stream of real time events that come
in with latest stock inventory, this solution would work pretty well compared to the complete
batch solution above.
Steps
1. Trigger a Lambda function as soon as the stock file is available in S3.
2. This lambda function would split the stock file into multiple smaller files.
3. The smaller files are then read enriched by a lambda function.
4. The enriched written to Amazon Kinesis Data Streams.
5. All this while, any monitoring updates and errors are written into Dynamo DB.
Stock_v2 file
gtin_prefix char(1)
upc char(14)
isbn_10 char(10)
price DECIMAL(7,2)
discount_level char(3)
publisher_status_code char(2)
on_sale_date date
returnable_indicator char(1)
return_date date
backorder_only_indicator char(1)
media_mail_indicator char(1)
product_type char(1)
imprintable_indicator char(1)
indexable_indicator char(1)
weight decimal(6,2)
restricted_code char(1)
product_availablity_code char(2)
ingram_title_code char(9)
upc_t char(12)
price_after_discount_t decimal(7,2)
ingram_publisher_name varchar(100)