Bulk Uploads
Bulk uploads are a way to create large sets of products in the system via a file upload, often a csv file.
Csv file can define various fields of product and its variants along with property sets.
CSV¶
Headers¶
Field | Data Type | Description | Required |
---|---|---|---|
Product Name | string | Name of the product. Product name can be same across multiple variants. | |
Display Name | string | Name of the product for this particular variant. | |
SKU | string | Unique SKU of this product. | |
Description | string | Description of this product. | |
Tags | string | Tags provide arbitrary grouping for products. Multiple tags can be separated by #; | |
Media Paths | string | Images for this product. Multiple media paths can be separated by #; | |
Category Path | string | Hierarchical category path of this product. Categories can be separated by / | |
Collections | string | Various collections to which this product belongs to. Multiple collections can be separated by #; | |
Price | number | Selling price of the product. Should be in highest denomination value, e.g. INR value for Indian store, USD value for US storefront. | |
List Price | number | List price of the product. Should be in highest denomination value, e.g. INR value for Indian store, USD value for US storefront. | |
Length(mm) | number | Length of the product in mm. | |
Width(mm) | number | Width of the product in mm. | |
Height(mm) | number | Height of the product in mm. | |
Weight(gms) | number | Weight of the product in grams. | |
Active | string | Indicate whether the product is active. Acceptable values are TRUE and FALSE | |
Tax Number | string | Govt. indicated tax number of the product. e.g. HSN/SAC code in India. | |
Tax Rate | string | Govt. indicated tax rate of the product. e.g. 18% GST ind India. |
Apart from the above headers, there could be dynamic headers based on the product variants and their associated property sets.
Variant Headers¶
If a product has multiple variants, csv can be provided with headers that indicate the variant attributes. If the product has variants for colors, sweep size and power consumption, headers could be Variant #; color
, Variant #; sweep size(mm)
and Variant #; power consumption(watts)
Property Sets Headers¶
Property sets are three kinds names tables, lists and media. CSV file can capture those arbitrary data points too.
If the product needs to define a property set table named details
with keys rated speed
, no of blades
and guarantee
and Rated frequency
, the columns can be provided as Property Set Table #; details #; rated speed(m³/min)
, Property Set Table #; details #; no of blades
, Property Set Table #; details #; guarantee(years)
and Property Set Table #; details #; Rated frequency(Hz)
If the product needs to define a property set list named Notable Features
, the column can be named as Property Set List #; Notable Features
and the list items can be separated by #;
.
If the product needs to define a property set media named Gallery
, the column can be named as Property Set Media #; Gallery
and the list items can be separated by #;
. The expected values for this property set will be public url images.
Example CSV¶
Here is an example csv for reference
Product Name | Display Name | SKU | Description | Tags | Media Paths | Category Path | Collections | Price | List Price | Length(mm) | Width(mm) | Height(mm) | Weight(gms) | Active | Tax Number | Tax Rate | Variant #; color | Variant #; sweep size(mm) | Variant #; power consumption(watts) | Property Set Table #; details #; rated speed(m³/min) | Property Set Table #; details #; no of blades | Property Set Table #; details #; guarantee(years) | Property Set Table #; details #; Rated frequency(Hz) | Property Set Table #; additional details #; Rated Voltage (Volts Range) | Property Set Table #; additional details #; Suited Rooms | Property Set List #; Notable Features | Property Set Media #; Gallery |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Yorker | Yorker 1320 mm sweep American Walnut | FHCYOSTAWW52 | 4 blade electroplated fan | Special Finish | https://havells.com/ManualUploadImages/FHCYOSTAWW52-.png | Premium Fans/Havells/Ceiling Fans | Collection3#;Collection4#;Collection5 | 10325 | 10325 | 0 | 0 | 0 | 0 | TRUE | American Walnut | 1320 | 82 | 260 | 4 | 2 | 50 | 220#;240 | Hall#;Conference Room | Feature1 | https://havells.com/ManualUploadImages/FHCYOSTAWW52-.png #; https://havells.com/ManualUploadImages/FHCYOSTAWW52-.png | ||
Yorker | Yorker 1320 mm sweep Wenge | FHCYOSTWNG52 | Electro-phoretic lacquered surface for anti-rusting | Special Finish | https://havells.com/ManualUploadImages/FHCYOSTWNG52.png | Premium Fans/Havells/Ceiling Fans | Collection3#;Collection4#;Collection5 | 10325 | 10325 | 0 | 0 | 0 | 0 | TRUE | Wenge | 1320 | 85 | 255 | 4 | 2 | 50 | 220#;240 | Living Room#;Conference Room | Feature1#;Feature2#;Feature3 | https://havells.com/ManualUploadImages/FHCYOSTWNG52.png #; https://havells.com/ManualUploadImages/FHCYOSTWNG52.png | ||
ZESTER | ZESTER 1200 mm Dusk | FHCZESTDUB48 | Superior Paint Finish | Decorative | https://havells.com/content/dam/havells/consumer/fans/ceiling-fans/decorative/Glaze/FHCZESTDUB48/cover.png | Fans/Havells/Ceiling Fans | Collection1#;Collection2 | 5830 | 5830 | 0 | 0 | 0 | 0 | TRUE | H234 | 18% GST | Dusk | 1200 | 74 | 235 | 3 | 2 | 50 | 220#;240 | Bed Room#;Kitchen | Feature1#;Feature2 | https://havells.com/content/dam/havells/consumer/fans/ceiling-fans/decorative/Glaze/FHCZESTDUB48/cover.png |
ZESTER | ZESTER 1200 mm Pearl White | FHCZESTPWC48 | HPLV motor for superior air delivery even at a low voltage of 180 volt | Decorative | https://havells.com/content/dam/havells/consumer/fans/ceiling-fans/decorative/Glaze/FHCZESTPWC48/cover.png | Fans/Havells/Ceiling Fans | Collection1#;Collection2 | 5830 | 5830 | 0 | 0 | 0 | 0 | TRUE | Pearl White | 1200 | 74 | 235 | 3 | 2 | 50 | 220#;240 | Hall#;Living Room | Feature2#;Feature3 | https://havells.com/content/dam/havells/consumer/fans/ceiling-fans/decorative/Glaze/FHCZESTPWC48/cover.png | ||
ZESTER | ZESTER 1200 mm Slate | FHCZESTSLS48 | Decorative blade trims with 3D design Pattern | Decorative | https://havells.com/content/dam/havells/consumer/fans/ceiling-fans/decorative/Glaze/FHCZESTSLS48/cover.png | Fans/Havells/Ceiling Fans | Collection1#;Collection2 | 5830 | 5830 | 0 | 0 | 0 | 0 | TRUE | Slate | 1200 | 74 | 235 | 3 | 2 | 50 | 220#;240 | Any Room | Feature1#;Feature3 | https://havells.com/content/dam/havells/consumer/fans/ceiling-fans/decorative/Glaze/FHCZESTSLS48/cover.png |
API¶
Bulk Upload Object¶
Below is the json representation of the bulk upload object, followed by a data table
{
"status": "success",
"data": {
"id": "32e03a84-50e5-41d7-83af-03bc804eb871",
"started_at": null,
"ended_at": null,
"progress": null,
"status": "draft",
"output": null,
"created_at": "2023-06-15T10:29:05.828Z",
"updated_at": "2023-06-15T10:29:05.833Z",
"processor_name": "file_content_echo_processor",
"file": {
"id": "a668784f-3fd0-4c3e-8ba0-d0b2ba2cfd9c",
"key": "ejnvr7oe4tfbdwr45yerk3c4dxfg",
"content_type": "text/csv",
"byte_size": 174
}
}
}
All Fields¶
Field | Data Type | Description |
---|---|---|
created_at | string | UTC timestamp at which this record was created. |
ended_at | string | UTC timestamp at which the upload processing has ended. |
file | object | A object that contains details related to the uploaded file. |
id | string | UUID of the record. |
output | object | Output capturing the result of the upload. Changes according to the processor used. A general error message is captured in message field. |
processor_name | string | Name of the file processor to be used. Acceptable values are catalog_csv_upload_processor , product_catalog_stock_csv_upload_processor and bluedart_pincode_csv_upload_processor . |
progress | number | Processing progress, goes from 0 to 100. |
started_at | string | UTC timestamp at which the upload processing has started. |
status | string | status of the file processing. |
updated_at | string | UTC timestamp at which this record was updated. |
Status State Machine¶
status
field represents file processing status of the bulk upload
Possible values: draft
, in_progress
, success
and failure
. Below diagram shows possible transitions on the product status.
graph LR
A[draft] --> |update_progress| B[in_progress];
B --> |succeed| C[success];
B --> |fail| D[failure]
List Bulk Uploads¶
GET
/api/platform/v1/bulk_uploads
The result set is paginated and can be controlled by page
and per_page
query parameters
Query Params
Field | Data Type | Description |
---|---|---|
page | integer | Page number of the result set. Values start from 1. |
per_page | integer | How many items should be present in a given page. |
curl command
Response Body
This api responds with array of bulk upload objects.
Get Bulk Upload¶
GET
/api/platform/v1/bulk_uploads/{id}
The result contains the bulk upload record.
curl command
Response Body
This api responds with bulk upload object.
{
"status": "success",
"data": {
"id": "32e03a84-50e5-41d7-83af-03bc804eb871",
"started_at": null,
"ended_at": null,
"progress": null,
"status": "draft",
"output": null,
"created_at": "2023-06-15T10:29:05.828Z",
"updated_at": "2023-06-15T10:29:05.833Z",
"processor_name": "file_content_echo_processor",
"file": {
"id": "a668784f-3fd0-4c3e-8ba0-d0b2ba2cfd9c",
"key": "ejnvr7oe4tfbdwr45yerk3c4dxfg",
"content_type": "text/csv",
"byte_size": 174
}
}
}
Create Product¶
POST
/api/platform/v1/bulk_uploads
Request Body
processor_name
and file
to upload.
curl command
Response Body
response json data object is product object ```json { "status": "success", "data": { "id": "607d0489-117c-4fdf-90f1-b517725e989a", "started_at": null, "ended_at": null, "progress": null, "status": "draft", "output": null, "extradata": null, "account_id": "f35be8f5-6f75-46be-88ae-e5bdfe545a71", "created_at": "2023-06-28T13:21:35.417Z", "updated_at": "2023-06-28T13:21:35.436Z", "input": null, "processor_name": "catalog_csv_upload_processor", "file": { "id": "c4eae506-2e36-4a68-9463-22c72ec27318", "key": "vcdfmyvi2lnyo171t4l8dsuj8yu8", "content_type": "text/csv", "byte_size": 2969, "url": "https://path-to-file" } }
} ```