ForSURE.orders.orders_endpoint

baseURL = '{domain}/saas/orders'

Base URL for all requests

POST {baseURL}
async def add_orders()

Post a list of orders in the following format using the exact keys to add them to our system. You can define how to handle duplicates (not required),

  • SKIP, which will ignore the duplicates
  • WARN_AND_SKIP, which will ignore them, but will respond with the orders that were skipped (default)
  • RAISE, which will throw an error and not add anything
Parameters
  • orders:

    {
        "orders": [
            {
                "sku": "481769825",
                "title": "Example Product 1",
                "orderid": "FS1234",
                "quantity": 1,
                "date": "2024-01-27T22:16:25.365Z",
                "country": "NL",
                "total_weight": 0,
                "packaging_weight": 0,
                "b2b": false
            },
            {
                "sku": "903419029",
                "title": "Example Product 2",
                "orderid": "FS1235",
                "quantity": 5,
                "date": "2024-01-27T22:17:25.365Z",
                "country": "NL",
                "b2b": true
            }
        ],
        "duplicates": "WARN_AND_SKIP"
    }
    
Returns

Successful response

{
    "status": "success",
    "duplicates": []
}

Successful response without warning If you have set the duplicates flag to ignore, you will receive this:

{
    "status": "success"
}

Successful response with warning If you have orders that have been added before, and the duplicates flag is set to WARN, you will receive this response

{
    "status": "success",
    "duplicates": [
        {
            "title": "Example Product 1",
            "sku": "481769825",
            "quantity": 1,
            "orderid": "FS1234",
            "date": "2024-01-27T22:16:25.365000Z",
            "country": "NL",
            "total_weight": 0.0,
            "packaging_weight": 0.0,
            "b2b": false
        }
    ]
}

Invalid data If you have any relevant entries missing, the API will respond with this payload, directing you to the invalid entry:

{
    "detail": [
        {
            "type": "missing",
            "loc": [
                "body",
                "orders",
                1,
                "title"
            ],
            "msg": "Field required",
            "input": {
                "sku": "903419029",
                "name": "Example Product 2",
                "orderid": "FS1235",
                "amount": 5,
                "date": "2024-01-27T22:17:25.365Z",
                "country": "NL",
                "b2b": true
            },
            "url": "https://errors.pydantic.dev/2.11/v/missing"
        }
    ]
}