ForSURE.dataUpload.upload_data_endpoints

baseURL = '/v2/reports'

Base URL for all requests

POST {baseURL}/uploadorders/
async def upload_orders()

Upload the orders in a csv or Excel file format. Make sure you have defined the labels correctly before you upload a file, otherwise this function will return an error.

Parameters
  • live_data: True if live data connection, else False
  • order_lists: List of file uploads containing order data from one or more sources
  • profiles: List of profiles, should be such that each order_list has the corresponding profile here.
  • fileId: List of file IDs to keep track of the exact source of each order.
Returns

Successful response with files
    {
        "status_code": 200
    }
    

Successful response with no files Returns a status code 200 and whether live data is being used.
    {
        "status_code": 200,
        "data":
        {
            "live_data": {true, false}
        }
    }
    

Error response file reading failed Returns the error message per file that was uploaded.
    {
        "status_code": 400,
        "data": [
            {
                "file_id": "file_id",
                "error": "Error Message"
            }
        ]
    }
    

Error response saving orders failed Returns an overview of how many orders failed to upload.
    {
        "status_code": 400,
        "data": [
            {
                "error": "Added {nr_orders_added}/{nr_all_orders}, skipped
                            {nr_orders_failed} with incorrect SKU or Order ID,
                            {nr_orders_failed} with duplicate SKU and Order ID"
            }
        ]
    }
    

POST {baseURL}/uploadreturns/
async def upload_returns()

Upload the returns in a csv or Excel file format. Make sure you have defined the labels correctly before you upload a file, otherwise this function will return an error. Indicating live data is not required here, as even for a live data connection you could have a separate place for the returns.

Parameters
  • return_lists: List of file uploads containing return data from one or more sources
  • profiles: List of profiles, should be such that each order_list has the corresponding profile here.
  • fileId: List of file IDs to keep track of the exact source of each order.
Returns

Successful response with or without files
    {
        "status_code": 200
    }
    

Error response file reading failed Returns the error message per file that was uploaded.
    {
        "status_code": 400,
        "data": [
            {
                "file_id": "file_id",
                "error": "Error Message"
            }
        ]
    }