ForSURE.categorylist.categorylist_endpoints

baseURL = '/categorylist'

Base URL for all requests

POST {baseURL}?profile={ID}
async def upload_categories()

Upload a new category list using the labels defined before.

Parameters
  • profile: int containing the profile ID
  • category_list: Csv or Excel file containing the product details.
Returns

Successful response JSON containing the filename and the internal upload ID of that file required for further use.
{"category": "products.csv", "id": 671213}
    

Error response JSON containing the details of the error
{"detail":"Failed to upload categorylist: Files of type {file_extension}
    are not supported yet, please use one of .xlsx, .xls, .csv"}
    

GET {baseURL}/getdetails
async def get_uploadcategories()

Get the products from a category list.

Returns

Successful response JSON containing the dictionary entry with details per product.
{
        "2": {
            "Title": "USB Maus",
            "Variant SKU": "63915698",
            "Product Net Weight (g)": "1000",
            "Batt Weight (g)": "0",
            "Width (cm)": "20",
            "Height (cm)": "1",
            "Length (cm)": "50",
            "Electro": "1",
            "Batteries": null,
            "Type of Batteries": null,
            "Plastic": "50",
            "Paper/Carton": "274",
            "BE": "6.1",
            "LU": "6.4",
            "NE": "6",
            "DE": "6",
            "IE": "6",
            "Battery Category": null
        }
    

GET {baseURL}/idcol
async def get_categoriesID()

Get the SKU column from a category list.

Returns

Successful response Text containing the column name of the sku column
"Variant SKU"
    

POST {baseURL}/edit
async def edit_categorylist()

Update a product of the category list.

Parameters
  • row: Row number of the product that changed
  • col: Column title of the entry that changed
  • new_value: New value of cell
  • old_value: Old value of cell, used to validate and to check data type.
Returns

True if successful, else False

POST {baseURL}/update
async def update_categorylist()

Updates the category list using the new data json.

Parameters
  • new_data: JSON containing the new data in this format
    [
        {
            "Title": "USB Maus",
            "Variant SKU": "63915698",
            "Product Net Weight (g)": "1000",
            "Batt Weight (g)": "0",
            "Width (cm)": "20",
            "Height (cm)": "1",
            "Length (cm)": "50",
            "Electro": "1",
            "Batteries": null,
            "Type of Batteries": null,
            "Plastic": "50",
            "Paper/Carton": "274",
            "BE": "6.1",
            "LU": "6.4",
            "NE": "6",
            "DE": "6",
            "IE": "6",
            "Battery Category": null
        },
    ]
    
Returns

True if successful, else False

GET {baseURL}/delete
async def delete_categorylist()

Deletes the category list with the given upload ID.

Returns

True if successful, else False