> For the complete documentation index, see [llms.txt](https://m-board.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://m-board.gitbook.io/docs/stock-upload-csv.md).

# Stock Upload (CSV)

### Sending the stock file via SFTP

To submit a stock file, the following endpoint is used and the stock file needs to be sent periodically to this endpoint:

`stfp {Merchant ID}@sftp.m-board.io`

{% hint style="info" %}
The **Merchant ID** (Username) and **API Key** (Password) is required to communicate with the stock importer. These credentials can be obtained from [support@michelberger.digital](email:support@michelberger.digital).
{% endhint %}

### Testing the connection

Use the instructions that follow to transfer files from the command line using OpenSSH.

1. On Linux or macOS, open a command terminal.
2. At the prompt, enter the following command: \
   `stfp {Merchant ID}@sftp.michelberger.digital`
3. (Optional) To view the user's home directory, enter the following command at the `sftp` prompt: \
   pwd
4. To upload a file from your file system to the server, use the `put` command. \
   For example, to upload `hello.txt` (assuming that file is in your current directory on your file system), run the following command at the `sftp` prompt: \
   `put hello.txt`<br>

   A message similar to the following appears, indicating that the file transfer is in progress, or complete: \
   `Uploading hello.txt to /my-bucket/home/sftp_user/hello.txt`

   `hello.txt 100% 127 0.1KB/s 00:00`

Detailed instructions how to transfer files using different clients (e.g. WinSCP, Cyberduck or FileZilla) can be found [here](https://docs.aws.amazon.com/transfer/latest/userguide/transfer-file.html).&#x20;

### Format

{% hint style="info" %}
Comma Separated Value (CSV)

* Must use semi-colons (`;`) as field separator
* Only allowed encodings are `UTF-8` and `UTF-16`
* String-formatted fields should be enclosed by double quotes
* **Filename conventions**:
  * Prefix `FULL` for daily full imports \
    e.g. `FULL_store1_2022-07-30T04:55:30.csv`
  * Prefix `DELTA` for hourly delta imports \
    e.g. `DELTA_store1_2022-07-30T17:30:30.csv`
    {% endhint %}

### Stock file columns

<table><thead><tr><th width="287.3333333333333">Column</th><th width="150">Data Type</th><th width="202">Full-Import</th><th width="243">Delta-Import</th><th width="200">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>store</code></td><td>Integer</td><td>Required</td><td>Required</td><td>Store identifier that represents a unique store in your source system.</td><td>501</td></tr><tr><td>ean</td><td>String</td><td>Required</td><td>Required</td><td>EAN of the article. Unique per store in the file, otherwise such articles are dropped and not handled.</td><td>0075678164125</td></tr><tr><td><code>quantity</code></td><td>Integer</td><td>Required</td><td>Required</td><td>Number of articles available at the store.</td><td>12</td></tr><tr><td><code>product_number</code></td><td>String</td><td>Required</td><td>Required</td><td>Unique product number that the client uses to identify a specific product.</td><td>88882572, 18751-060</td></tr><tr><td><code>price</code></td><td>Float</td><td>Required</td><td></td><td>Current selling price of an article, use dot . as a decimal separator, e.g: 10.54.</td><td>131.95</td></tr><tr><td><code>retail_price</code></td><td>Float</td><td>Required</td><td></td><td>Retail price of an article (RRP) is the original price of the article before applying any discount. Use dot . as a decimal separator, e.g: 10.54</td><td>329.95</td></tr><tr><td><code>brand</code></td><td>String</td><td>Required</td><td></td><td>Product brand</td><td>HUGO BOSS</td></tr><tr><td><code>product_group</code></td><td>String</td><td>Required</td><td></td><td>Product category</td><td>Jeans, T-Shirt</td></tr><tr><td><code>article_size</code></td><td>String</td><td>Required</td><td></td><td>Article size</td><td>S, 32</td></tr><tr><td><code>purchase_price</code></td><td>Float</td><td>Required</td><td></td><td>Purchase price </td><td>78.95</td></tr><tr><td><code>article_number</code></td><td>String</td><td>Recommended</td><td></td><td>Article number</td><td>18751</td></tr><tr><td><code>product_name</code></td><td>String</td><td></td><td></td><td>Product name, highly recommended field as this helps stores to identify the product.</td><td>Superstar Track Jacket, Converse Sneaker</td></tr><tr><td><code>article_color</code></td><td>String</td><td></td><td></td><td>Article color</td><td>White</td></tr><tr><td><code>article_color_number</code></td><td>Integer</td><td></td><td></td><td>Article color number</td><td>142</td></tr><tr><td><code>season</code></td><td>String</td><td></td><td></td><td>Article season, highly recommended field as this helps stores to control feed upload by season.</td><td>FS 2021</td></tr><tr><td><code>first_purchase_date</code></td><td>String</td><td></td><td></td><td>First purchase date, highly recommended field as this helps stores to control feed upload by first purchase date.</td><td>2022-07-01</td></tr><tr><td><code>store_article_location</code></td><td>String</td><td></td><td></td><td>The article location helps the store clerks to locate the article <strong>within</strong> the store.</td><td>3rd Floor, 201</td></tr><tr><td><code>picture</code></td><td>String</td><td></td><td></td><td>Default picture URL</td><td><a href="https://api.fashioncloud.co/v2/products/media/images/60b4d44328ebf50011dd3246?token=0c6da146dd36758385a428fac6b6b0c8&#x26;px=200&#x26;minAcceptableSize=200">https://api.fashioncloud.co/v2/products/media/images/60b4d44328ebf50011dd3246?token=0c6da146dd36758385a428fac6b6b0c8&#x26;px=200&#x26;minAcceptableSize=200</a></td></tr><tr><td><code>tag_1-n</code></td><td>String</td><td></td><td></td><td>Article tag, helps stores to control feed upload by tag value</td><td>Promotion, NO_DISCOUNT, SALE</td></tr><tr><td><code>gender</code></td><td>String</td><td></td><td></td><td>Gender</td><td>Allowed values:<br><code>male</code>, <code>female</code> and <code>unisex</code></td></tr><tr><td><code>age_group</code></td><td>String</td><td></td><td></td><td>Age group</td><td>Allowed values:<br><code>adults</code>, <code>teens</code>, <code>kids</code>, <code>babies</code>, <code>newborn</code> or <code>unknown</code></td></tr><tr><td><code>description</code></td><td>String</td><td></td><td></td><td>Product description</td><td>Denim Shorts in schöner Waschung. Elasthananteil für bequemen Sitz</td></tr><tr><td><code>picture_1-n</code></td><td>String</td><td></td><td></td><td>Additional picture URLs</td><td><a href="https://api.fashioncloud.co/v2/products/media/images/60b4d44328ebf50011dd3246?token=0c6da146dd36758385a428fac6b6b0c8&#x26;px=200&#x26;minAcceptableSize=200">https://api.fashioncloud.co/v2/products/media/images/60b4d44328ebf50011dd3246?token=0c6da146dd36758385a428fac6b6b0c8&#x26;px=200&#x26;minAcceptableSize=200</a></td></tr><tr><td><code>material</code></td><td>String</td><td></td><td></td><td>Product material composition</td><td>Obermaterial: 81% Baumwolle, 17% Polyester, 2% Elasthan</td></tr><tr><td><code>care_instructions</code></td><td>String</td><td></td><td></td><td>Product care instructions </td><td>Maschinenwäsche bei 30°C, Schonwaschgang, nicht Trockner geeignet</td></tr><tr><td><code>product_group_number</code></td><td>Integer</td><td></td><td></td><td>Product group number</td><td>23124</td></tr><tr><td><code>erp_inventory_item_id</code></td><td>String</td><td></td><td></td><td>Internal ERP inventory item id</td><td>45213620895960</td></tr><tr><td><code>erp_variant_id</code></td><td>String</td><td></td><td></td><td>Internal ERP variant id</td><td>43118558642392</td></tr><tr><td><code>erp_product_id</code></td><td>String</td><td></td><td></td><td>Internal ERP product id</td><td>7765899346136</td></tr><tr><td><code>company_id</code></td><td>String</td><td></td><td></td><td>Company id (group of stores) item belongs to</td><td>m1</td></tr></tbody></table>

Sample stock file

#### Full-Import&#x20;

```
store;ean;price;retail_price;quantity;product_number;product_name;article_number;article_color;article_size;store_article_location
100;5704498811166;99.95;99.95;10;"TOB21N00G";"Jeans Skinny Fit";"TOB21N00G-K11";"niceville mid";"24x30";"301"
101;4061749183108;169.95;199.95;2;"272762";"ZAIDA TURTLENECK - Strickpullover - nou...";"4060606039817";"Blue";"M";"1st floor"
```

**Delta-Import**

```
store;ean;quantity;product_number
100;5704498811166;10;"TOB21N00G"
101;4061749183108;2;"272762"
```
