Spaaza Product Feed Import
Contents
- Introduction
- Feed File Overview
- Spaaza S3 Bucket
- Naming and Uploading Feed Files
- Resynchronising the Feed
- File Contents
Introduction
The Spaaza product feed file set consists of a set of three CSV files uploaded at intervals to an Amazon S3 bucket. This feed enables retailers to maintain current product catalog information, store locations, and inventory levels within the Spaaza platform.
Feed File Overview
The feed consists of the following 3 files in CSV format:
1. Branch file
This file describes physical store branches in a retail chain including branch name, address and retailer-specific branch number. It should also include a head office location. This file always includes all branches in the chain.
2. Product List file
This file provides a list of products/items sold by the retailer and includes information for each product such as product name, brand, season, base price, image URL and identifier codes. This file always includes all products carried by a retailer.
3. Variant and Stock file
This file serves both to list all variants for products/items including sizes, colours and barcodes, as well as allowing the listing of stock in individual branches should a retailer choose to do so. In many cases retailers choose not to use this file to record stock levels, in which case one entry for each barcode found in the retail sales environment is listed. This file is incremental - only changes since the last upload are shown except when resynchronising the feed (see section below).
Spaaza S3 Bucket
Spaaza provides an Amazon AWS identifier and credentials for an S3 bucket to which the feed files can be uploaded on a frequent basis. The feed URL is similar to the following:
s3://feed-spaaza-product-stock-retailername
Naming and Uploading Feed Files
Feed files follow a naming convention which includes a stem specifying the file designator, followed by the valid date and then time of creation. The name, date and time are separated by underscores. The feed file is suffixed with the .csv
extension.
When an upload happens, all three files (branch file, product list file and variant/stock file) must be uploaded in a set using exactly the same date and time of creation in the filename. The Spaaza importer then picks up the files from Amazon S3 and processes them in increasing order of date and time of creation.
The following is an example of correct naming of 3 feed files:
branch_20170914_140236.csv
productlist_20170914_140236.csv
soh_20170914_140236.csv
If files do not contain a valid date or time or the dates and times do not match, the importer will error.
Resynchronising the Feed
Should the feed fall out of synchronisation, this can be corrected by sending a full variant and stock file containing all variants and stock items.
File Contents
Feed files contain correctly formatted CSV content, with a comma separator and a double quotation mark ("
) used as an escape character. The first row in the file contains column headings in upper case. It is possible to validate a CSV file online or with a package such as ‘csvfix’.
This section describes the fields in each file and includes some details of how the files are linked to each other by branch code and product identifier.
As the feed definition is upgraded, new fields are added at end of the field list for each file. This ensures files in the old format can still be used by the importer, but means it’s necessary to pay close attention to the order in which fields are sent, and that related fields may not always appear in consecutive order in the feed files.
Branch file
The branch file contains the following column headings:
"BRANCH NUMBER","BRANCH NAME","BRANCH ADDRESS 1","BRANCH ADDRESS 2","BRANCH ADDRESS 3",
"BRANCH POSTALCODE","BRANCH COUNTRYCODE","LATITUDE","LONGITUDE","GOOGLE PLACE ID",
"PHONE NUMBER","TOWNCITY","REGION","SHUTDOWN"
An example of row in this file looks like this:
"ANY_1027","ACME Retailer Anytown","Mall Unit #14","Anytown Mall","347 Ancient Heroes Avenue",
"1000CA","NL","54.24677","4.25666","ChIJFVeMnoQJxkcRh95gA0gNHuc","+31 20 555 1234",
"Anytown","North Anyregion",0
Sample branch file data:
BRANCH NUMBER | BRANCH NAME | BRANCH ADDRESS 1 | BRANCH ADDRESS 2 | BRANCH ADDRESS 3 | BRANCH POSTALCODE | BRANCH COUNTRYCODE | LATITUDE | LONGITUDE | GOOGLE PLACE ID | PHONE NUMBER | TOWNCITY | REGION | SHUTDOWN |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1027_ANY | ACME Retailer Anytown | Mall unit 14 | Anytown Shopping Centre | 14 Anystreet | 1000 ZX | NL | 54.27401 | 4.90451 | ChIJFVeMnoQJxkcRh95gA0gNHuc | +55 401 327 4985 | Anytown | Northern Anyregion | 0 |
1093_ANY | ACME Retailer Anyville | 29 Anyboulevard | 2000 AC | NL | -33.95067 | 18.376778 | ChIJuUZtdVNmzB0R-7OvUK-IBzE | (020) 331 5555 | Anyville | Southern Anyregion | 0 |
Field descriptions:
Field Name | Description |
---|---|
BRANCH NUMBER | A unique branch code used by the retailer to identify the branch. The same branch code is also used in the Variant and Stock file to identify the branch in which a stock item is held. Whilst most branches are recorded with a number, this field has a string value as retailers occasionally use a string value such as “ANYTOWN_001” |
BRANCH NAME | The name of the branch |
BRANCH ADDRESS 1 | The first address field of the branch – this is usually used for e.g. the unit location of the branch in a shopping mall and maps to the “business_address_1” field in Spaaza API responses |
BRANCH ADDRESS 2 | The first address field of the branch – this is usually used for e.g. the name of a shopping mall or centre, should that be required, and maps to the “business_address_2” field in Spaaza API responses |
BRANCH ADDRESS 3 | The region in which the branch is located – this maps to the “business_address_3” field in Spaaza API responses |
BRANCH POSTALCODE | The postalcode of the branch address |
BRANCH COUNTRYCODE | The ISO-3166-1 alpha 2-letter code for the branch country, e.g. “NL” |
LATITUDE | The WGS-84 latitude of the branch in decimal degrees, e.g. “54.267755” |
LONGITUDE | The WGS-84 longitude of the branch in decimal degrees, e.g. “4.31723” |
GOOGLE PLACE ID | The Google Place ID of the branch, e.g. “ChIJFVeMnoQJxkcRh95gA0gNHuc” |
PHONE NUMBER | The phone number of the branch. This is accepted in string format to allow for symbols commonly found in phone numbers such as “+”, “(“ or “)” |
TOWNCITY | The town in which the branch is located – this maps to the “business_towncity” field in Spaaza API responses |
REGION | The postal region in which the branch is located – this maps to the “business_address_3” field in Spaaza API responses |
SHUTDOWN | A Boolean value (0=false, 1=true) denoting whether a branch has been administratively closed or not. The default value is 0=false if this field is not included. When this field is set to 1 the branch will not be set to deleted in the Spaaza database and analytics will continue to be generated, but the “BRANCH NUMBER” field can now be used by another branch |
Product List File
The product list file contains the following column headings:
"PRODUCT ID","PRODUCT CODE","PRODUCT NAME","PRODUCT DESCRIPTION","SELL INCL","SUPPLIER",
"BRAND","GENDER","RANGE","BARCODE","CREATED DATE","SEASON","DELETED",
"PRODUCT WEBSHOP URL","PRODUCT UNIT","COST_PRICE","CATEGORY"
An example row in the product list file looks like this:
4062,"O-62716","SUPER TANK TOP","BLUE TANK TOP FOR SUMMER WEAR",25.00,
"ACME FASHION DISTRIBUTOR","TANK TOPTASTIC","F","Tops","3123424324322","2016-01-28",
"WINTER 2016",0,"http://www.example.com/tank_top_42.html","Item","17.40",
"Clothing > Tops > Tank Tops"
Sample product list file data:
PRODUCT ID | PRODUCT CODE | PRODUCT NAME | PRODUCT DESCRIPTION | SELL INCL | SUPPLIER | BRAND | GENDER | RANGE | BARCODE | CREATED DATE | SEASON | DELETED | PRODUCT WEBSHOP URL | PRODUCT UNIT | COST PRICE | CATEGORY |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4062 | O-62716 | Super Tank Top | Tank top for summer wear | 25.00 | ACME FASHION DISTRIBUTOR | TANK TOPTASTIC | F | TANK TOPS | 2016-01-28 | WINTER 2016 | 0 | http://www.example.com/tank_top_42.html | Item | 17.40 | Clothing > Tops > Tank Tops | |
4063 | 85296 | Loose Leaf Ceylon Tea | Loose leaf tea from the wilds of the Sri Lankan mountains | 0.04 | ACME TEA DISTRIBUTOR | ACME TEAS | TEAS OF THE WORLD | 4023232300131 | 2017-02-21 | 0 | http://www.example.com/ceylon_loose_leaf_tea.html | g | 0.03 | Loose Leaf Teas |
Download sample product list file
Field descriptions:
Field Name | Description |
---|---|
PRODUCT ID | A product ID designator used by the retailer. This product ID is also used in the Variant and Stock file to identify which product an item in stock is |
PRODUCT CODE | A unique product code used by the retailer to identify the item. The same product code is also used in the Variant and Stock file to identity which product an item in stock is. This field is represented as a string in the feed file although with many retailers a numeric value is used |
PRODUCT NAME | A name or description for the product |
PRODUCT DESCRIPTION | A detailed description for the product |
SELL INCL | The selling price of the product per unit including taxes. The “.” character should be used as a decimal separator and no separator should be used for thousands – e.g. 1501.23 should be used instead of 1,502.23 or 1.501,23 |
SUPPLIER | The company supplying the product |
BRAND | The brand making the product |
GENDER | The intended gender of the buyer or user of the product. “M” and “F” are acceptable for Male and Female |
RANGE | A range or category for the product |
BARCODE | A barcode or barcode stem for the product. Note that individual variants can have separate barcodes in the variant and stock file |
CREATED DATE | The date the item was created or added to the range in the form YYYY-MM-DD |
SEASON | A season of the year for the product |
DELETED | Whether this product is no longer carried by the store. This should be set to “1” to remove the product from the Spaaza product list |
PRODUCT WEBSHOP URL | The URL of the product on the retailer’s web store |
PRODUCT UNIT | The unit in which the product is sold. It is possible for this to be an integer individual item such as “Item” for a sweater or a unit representing a decimal amount, for example “Litre” for a liquid |
COST_PRICE | The cost price of the product before any profit margin is added to make the SELL INCL sale price. This field can be used for simple margin analytics calculations on a per-item but also per-retailer or per-customer segment basis |
CATEGORY | A retailer category string for the product. This can be a single category name or can include a retailer category hierarchy with the names of category levels separated by the character “>”. For example this could be “Woollen Sweaters” or “Clothing > Tops > Sweaters > Woollen Sweaters”. The Spaaza product ingester interprets the hierarchical string and can run analytics on different category levels |
Variant and Stock File
The SOH file contains the following column headings:
"PRODUCT ID","PRODUCT CODE","BNO","BRANCH","SIZE","COLOUR","SOH","SELL INCL",
"BARCODE","IMAGE URL"
An example row in the file looks like this:
4062,"O-62716","1027","ACME Retailer Anytown","9","Blue",5,25.00,"400819001140",
"https://sampleshop.example.com/products/4062/full_image.jpg"
Should the retailer choose not to list stock in all stores, each variant or barcode carried should be listed as “in stock” in a head office branch. Removing stock is done simply by setting the SOH field to 0.
Sample variant and stock file data:
PRODUCT ID | PRODUCT CODE | BNO | BRANCH | SIZE | COLOUR | SOH | SELL INCL | BARCODE | IMAGE URL |
---|---|---|---|---|---|---|---|---|---|
4062 | O-62716 | 1027_ANY | ACME Retailer Anytown | XL | BLUE | 5 | 25.00 | 30569400000012 | https://www.example.com/images/0-62716/hi-res.jpg |
4063 | 85296 | 1093_ANY | ACME Retailer Anyville | 9000 | 0.04 | 400819001150 |
Download sample variant and stock file
Field descriptions:
Field Name | Description |
---|---|
PRODUCT ID | A product ID designator used by the retailer. This product ID is also used in the product file to identify a product |
PRODUCT CODE | A unique product code used by the retailer to identify the variant. The same product code is also used in the product list file |
BNO | Branch number. This is a unique branch code used by the retailer to identify the branch in which a variant is sold. The same branch code is also used in the branch file to identify the branch |
BRANCH | The name of the branch in which the item is sold |
SIZE | The size of the variant. This can be numeric such as “36” or a string such as “Extra Large” |
COLOUR | The colour of the variant |
SOH | The number of stock items of the variant on hand in the particular store. A value of 0 removes the variant when there are no more instances of it in other branches |
SELL INCL | The selling price of the variant including taxes. The “.” character should be used as a decimal separator and no separator should be used for thousands – e.g. 1501.23 should be used instead of 1,502.23 or 1.501,23 |
BARCODE | The barcode of the variant. This can be numeric or a string |
IMAGE URL | The URL of the primary image for the variant |