Products for Partners
Uploading products via Zoomailer
A list of products can be uploaded to the storefront using a CSV file. Then, you can attach that file to an e-mail and send to the address you were provided.
ℹ️ For this to work, the customer must be created using the Big Storage NG (BSNG) APIs and include the `cms` configuration. Only e-mails from addresses in the `recipients` field are accepted. "cms": {
"recipients": [
"[email protected]",
"[email protected]"
],
"subjectKeywords": [
"products",
"clients",
"prices"
],
"type": "EXTERNAL",
"_id": "6124382ced3376000813da68",
"sourceBucket": "source-s3-bucket"
}
CSV format
The following list contains the available fields. The required fields must be present in the CSV file.
category: String (required)
description: String (required)
imageURL: String[] (required)
isActive: Boolean (required)
name: String (required)
sku: String (required)
attributes: String[]
categories: String[]
_{custom_field_name}: String
deactivationDate: Date
divisionsByUnit: Integer
packageType: String
priority: Integer
size: String
tags: String[]
unitDivision: String
unitsPerPackage: Integer
Brackets ([]
) indicate that the fields expects a list of values. The values should be separated with a pipe (|
). For example, categoryA | categoryB
is a valid value for categories
.
Custom fields are accepted and you can pass any number of them. Their names should start with an underscore (_
). For example, _customFieldA
is valid custom field name whereas customFieldA
is not and will be ignored.
Here's an example of a full CSV file content:
name | sku | category | categories | description | tags | size | imageURL | priority | packageType | unitsPerPackage | unitDivision | divisionsByUnit | isActive | deactivationDate | _customFieldA | _customFieldB | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Coca-Cola 350 ml | 859102877 | Soft Drink | Beverages | Coke 350 ml, aluminum can | Soda | Beverages | 2XL | http://images.com/coke.png | 1 | Pack | 12 | unit | 1 | TRUE | 9/18/2021 | 1 | 12 |
Here's the raw CSV of that table
name;sku;category;categories;description;tags;size;imageURL;priority;packageType;unitsPerPackage;unitDivision;divisionsByUnit;isActive;deactivationDate;_customFieldA;_customFieldB
Coca-Cola 350 ml;859102877;Soft Drinks;Beverages;Coke 350 ml, aluminum can;Soda | Beverages;2XL;http://images.com/coke.png;1;Pack;12;unit;1;TRUE;9/18/2021;1;12
E-mail format
Now that you have your CSV file, you can attach it to an e-mail and send it to the service that will load them into your storefront. There are some rules that this service requires, let's check them out.
The first rule is that your CSV file name should include products
or productos
in it. For example, products_18012022.csv
**and productos_012022.csv
are both accepted. However, prod_012022.csv
**will be ignored.
The second rule is that the e-mail subject must also include either products
or productos
. For example, products jan/2022
is acceptable but jan/2022
is not, regardless of the CSV file name.
If both rules are okay, then the service will start processing your file.
After the file is processed, you get an e-mail saying the file processing has finished and the service will start to add your products to the storefront. After the service finishes inserting them, you'll be able to see the products in your storefront.
ℹ️ File's been processed is not the same as the products' been inserted. They're different processes. The service will start inserting the products after the file has been processed (parsed).To get an e-mail once the file has been processed, we need to enable it via BLUE_STEEL_EMAIL_RESP_SEND
(ref.:https://bitbucket.org/yalochat/zoomailer/)
{
"success": true,
"message": "20 product(s) have been processed successfully!",
"traceId": "fc13ba42-43c3-4045-9d4d-1a2cf10976d1"
}
When such error happens, the customer will not get any e-mail but you can configure BLUE_STEEL_EMAIL_SUPPORT
with a list of e-mails to send errors to. Then it's up to the recipients to forward those errors to the customer/partner.
It does seem that we have a limit for the number of files sent by e-mail. I haven't had the chance to test this but I checked Zoomailer's code and there's a specific check for that (see https://bitbucket.org/yalochat/zoomailer/src/55a1d255ffabf6433afbba7996bb69f40db2f809/pkg/tireless/polling.go?at=master#polling.go-204,206,237)
Adán Muguiro, from the Delivery Success team, was not sure about the limit but said that customers usually send just one file per e-mail.
ℹ️ I performed a few tests in staging and faced timeouts when trying to upload a file directly to the [Headless Data Load lambda function](https://console.aws.amazon.com/lambda/home?region=us-east-1#/functions/headless-data-load-headless-data-load-staging) with a lot of products. The maximum I could successfully upload was around 930 products (about 200KB), and it took 25 seconds to respond. With 1000 products (about 310 KB), there was a time-out. **However, the lambda continued to do its job in the background, even though the API Gateway has timed-out. It finished after 31 seconds.**According to Adán Muguiro, from the Delivery Success team, in production customers are able to process files longer than that. This is because Zoomailer uses another lambda function to upload the data, the Ecommerce Upload Files Service, so it goes through a different process.
Updated over 1 year ago