Inventory changelog information

I’d like to fetch the same information that you can get in Reports > Inventory Changelog but I can’t seem to find any API endpoint that specifically does that. There is a button on the reports page that lets me download the information through CSV format but I’d like to fetch it more programmatically. Has anyone here fetched the same type of info before?

What I essentially want is a fact table that lists the different stock changes and how they change over time, e.g. when something is discarded etc.

Thx

Hey, @hrudas!
Welcome to the developer forum!

Unfortunately, we do not provide this information through our API natively.

You can get similar data on a variant level by using the /stock_histories endpoint. This is undocumented currently, but a request would look like this:

GET:

https://api.veeqo.com/stock_histories?page=1&per_page=10&sellable_id={sellable_id}
Response
[
    {
        "id": 2747806421,
        "increased": true,
        "decreased": false,
        "quantity": 2,
        "stock_level": 423,
        "created_at": "2022-01-18T14:27:40.845Z",
        "action": {
            "name": "purchase_order_received",
            "summary": "Purchase order PO-37 received"
        },
        "stock_entry": {
            "sellable_id": 57991302,
            "warehouse_id": 51011,
            "infinite": false,
            "allocated_stock_level": 0,
            "stock_running_low": false,
            "updated_at": "2022-01-18T14:27:40.782Z",
            "incoming_stock_level": 0,
            "transit_outgoing_stock_level": 0,
            "warehouse": {
                "id": 51011,
                "name": "New Awesome Warehouse",
                "display_position": 4
            },
            "physical_stock_level": 423,
            "available_stock_level": 423,
            "sellable_on_hand_value": 3164.04,
            "transit_incoming_stock_level": 0,
            "location": "G-1"
        },
        "sellable": {
            "id": 57991302,
            "type": "ProductVariant",
            "title": "Dog - Variant 1",
            "sku_code": "DG01",
            "upc_code": "",
            "model_number": "",
            "price": 3.43,
            "cost_price": 7.48,
            "min_reorder_level": 0,
            "quantity_to_reorder": 0,
            "created_by_id": 43826,
            "created_at": "2021-08-19T10:17:08.564Z",
            "updated_at": "2022-01-19T11:14:30.681Z",
            "weight_grams": 10.0,
            "weight_unit": "g",
            "product_title": "Golden Retriever Dog - TEST",
            "full_title": "Golden Retriever Dog - TEST Dog - Variant 1",
            "sellable_title": "Dog - Variant 1",
            "profit": -4.05,
            "margin": -118.08,
            "tax_rate": 20.0,
            "estimated_delivery": null,
            "origin_country": null,
            "hs_tariff_number": null
        },
        "reason": null,
        "notes": null
    },
    {
        "id": 2747806116,
        "increased": true,
        "decreased": false,
        "quantity": 3,
        "stock_level": 421,
        "created_at": "2022-01-18T14:27:24.721Z",
        "action": {
            "name": "purchase_order_received",
            "summary": "Purchase order PO-37 received"
        },
        "stock_entry": {
            "sellable_id": 57991302,
            "warehouse_id": 51011,
            "infinite": false,
            "allocated_stock_level": 0,
            "stock_running_low": false,
            "updated_at": "2022-01-18T14:27:40.782Z",
            "incoming_stock_level": 0,
            "transit_outgoing_stock_level": 0,
            "warehouse": {
                "id": 51011,
                "name": "New Awesome Warehouse",
                "display_position": 4
            },
            "physical_stock_level": 423,
            "available_stock_level": 423,
            "sellable_on_hand_value": 3164.04,
            "transit_incoming_stock_level": 0,
            "location": "G-1"
        },
        "sellable": {
            "id": 57991302,
            "type": "ProductVariant",
            "title": "Dog - Variant 1",
            "sku_code": "DG01",
            "upc_code": "",
            "model_number": "",
            "price": 3.43,
            "cost_price": 7.48,
            "min_reorder_level": 0,
            "quantity_to_reorder": 0,
            "created_by_id": 43826,
            "created_at": "2021-08-19T10:17:08.564Z",
            "updated_at": "2022-01-19T11:14:30.681Z",
            "weight_grams": 10.0,
            "weight_unit": "g",
            "product_title": "Golden Retriever Dog - TEST",
            "full_title": "Golden Retriever Dog - TEST Dog - Variant 1",
            "sellable_title": "Dog - Variant 1",
            "profit": -4.05,
            "margin": -118.08,
            "tax_rate": 20.0,
            "estimated_delivery": null,
            "origin_country": null,
            "hs_tariff_number": null
        },
        "reason": null,
        "notes": null
    },
    {
        "id": 2747804526,
        "increased": true,
        "decreased": false,
        "quantity": 2,
        "stock_level": 418,
        "created_at": "2022-01-18T14:26:44.161Z",
        "action": {
            "name": "purchase_order_received",
            "summary": "Purchase order PO-36 received"
        },
        "stock_entry": {
            "sellable_id": 57991302,
            "warehouse_id": 51011,
            "infinite": false,
            "allocated_stock_level": 0,
            "stock_running_low": false,
            "updated_at": "2022-01-18T14:27:40.782Z",
            "incoming_stock_level": 0,
            "transit_outgoing_stock_level": 0,
            "warehouse": {
                "id": 51011,
                "name": "New Awesome Warehouse",
                "display_position": 4
            },
            "physical_stock_level": 423,
            "available_stock_level": 423,
            "sellable_on_hand_value": 3164.04,
            "transit_incoming_stock_level": 0,
            "location": "G-1"
        },
        "sellable": {
            "id": 57991302,
            "type": "ProductVariant",
            "title": "Dog - Variant 1",
            "sku_code": "DG01",
            "upc_code": "",
            "model_number": "",
            "price": 3.43,
            "cost_price": 7.48,
            "min_reorder_level": 0,
            "quantity_to_reorder": 0,
            "created_by_id": 43826,
            "created_at": "2021-08-19T10:17:08.564Z",
            "updated_at": "2022-01-19T11:14:30.681Z",
            "weight_grams": 10.0,
            "weight_unit": "g",
            "product_title": "Golden Retriever Dog - TEST",
            "full_title": "Golden Retriever Dog - TEST Dog - Variant 1",
            "sellable_title": "Dog - Variant 1",
            "profit": -4.05,
            "margin": -118.08,
            "tax_rate": 20.0,
            "estimated_delivery": null,
            "origin_country": null,
            "hs_tariff_number": null
        },
        "reason": null,
        "notes": null
    },
    {
        "id": 2747803290,
        "increased": true,
        "decreased": false,
        "quantity": 3,
        "stock_level": 416,
        "created_at": "2022-01-18T14:26:14.991Z",
        "action": {
            "name": "purchase_order_received",
            "summary": "Purchase order PO-36 received"
        },
        "stock_entry": {
            "sellable_id": 57991302,
            "warehouse_id": 51011,
            "infinite": false,
            "allocated_stock_level": 0,
            "stock_running_low": false,
            "updated_at": "2022-01-18T14:27:40.782Z",
            "incoming_stock_level": 0,
            "transit_outgoing_stock_level": 0,
            "warehouse": {
                "id": 51011,
                "name": "New Awesome Warehouse",
                "display_position": 4
            },
            "physical_stock_level": 423,
            "available_stock_level": 423,
            "sellable_on_hand_value": 3164.04,
            "transit_incoming_stock_level": 0,
            "location": "G-1"
        },
        "sellable": {
            "id": 57991302,
            "type": "ProductVariant",
            "title": "Dog - Variant 1",
            "sku_code": "DG01",
            "upc_code": "",
            "model_number": "",
            "price": 3.43,
            "cost_price": 7.48,
            "min_reorder_level": 0,
            "quantity_to_reorder": 0,
            "created_by_id": 43826,
            "created_at": "2021-08-19T10:17:08.564Z",
            "updated_at": "2022-01-19T11:14:30.681Z",
            "weight_grams": 10.0,
            "weight_unit": "g",
            "product_title": "Golden Retriever Dog - TEST",
            "full_title": "Golden Retriever Dog - TEST Dog - Variant 1",
            "sellable_title": "Dog - Variant 1",
            "profit": -4.05,
            "margin": -118.08,
            "tax_rate": 20.0,
            "estimated_delivery": null,
            "origin_country": null,
            "hs_tariff_number": null
        },
        "reason": null,
        "notes": null
    },
    {
        "id": 2747800993,
        "increased": true,
        "decreased": false,
        "quantity": 3,
        "stock_level": 413,
        "created_at": "2022-01-18T14:25:16.577Z",
        "action": {
            "name": "purchase_order_received",
            "summary": "Purchase order PO-35 received"
        },
        "stock_entry": {
            "sellable_id": 57991302,
            "warehouse_id": 51011,
            "infinite": false,
            "allocated_stock_level": 0,
            "stock_running_low": false,
            "updated_at": "2022-01-18T14:27:40.782Z",
            "incoming_stock_level": 0,
            "transit_outgoing_stock_level": 0,
            "warehouse": {
                "id": 51011,
                "name": "New Awesome Warehouse",
                "display_position": 4
            },
            "physical_stock_level": 423,
            "available_stock_level": 423,
            "sellable_on_hand_value": 3164.04,
            "transit_incoming_stock_level": 0,
            "location": "G-1"
        },
        "sellable": {
            "id": 57991302,
            "type": "ProductVariant",
            "title": "Dog - Variant 1",
            "sku_code": "DG01",
            "upc_code": "",
            "model_number": "",
            "price": 3.43,
            "cost_price": 7.48,
            "min_reorder_level": 0,
            "quantity_to_reorder": 0,
            "created_by_id": 43826,
            "created_at": "2021-08-19T10:17:08.564Z",
            "updated_at": "2022-01-19T11:14:30.681Z",
            "weight_grams": 10.0,
            "weight_unit": "g",
            "product_title": "Golden Retriever Dog - TEST",
            "full_title": "Golden Retriever Dog - TEST Dog - Variant 1",
            "sellable_title": "Dog - Variant 1",
            "profit": -4.05,
            "margin": -118.08,
            "tax_rate": 20.0,
            "estimated_delivery": null,
            "origin_country": null,
            "hs_tariff_number": null
        },
        "reason": null,
        "notes": null
    },
    {
        "id": 2747785905,
        "increased": true,
        "decreased": false,
        "quantity": 100,
        "stock_level": 410,
        "created_at": "2022-01-18T14:18:34.924Z",
        "action": {
            "name": "purchase_order_received",
            "summary": "Purchase order PO-32 received"
        },
        "stock_entry": {
            "sellable_id": 57991302,
            "warehouse_id": 51011,
            "infinite": false,
            "allocated_stock_level": 0,
            "stock_running_low": false,
            "updated_at": "2022-01-18T14:27:40.782Z",
            "incoming_stock_level": 0,
            "transit_outgoing_stock_level": 0,
            "warehouse": {
                "id": 51011,
                "name": "New Awesome Warehouse",
                "display_position": 4
            },
            "physical_stock_level": 423,
            "available_stock_level": 423,
            "sellable_on_hand_value": 3164.04,
            "transit_incoming_stock_level": 0,
            "location": "G-1"
        },
        "sellable": {
            "id": 57991302,
            "type": "ProductVariant",
            "title": "Dog - Variant 1",
            "sku_code": "DG01",
            "upc_code": "",
            "model_number": "",
            "price": 3.43,
            "cost_price": 7.48,
            "min_reorder_level": 0,
            "quantity_to_reorder": 0,
            "created_by_id": 43826,
            "created_at": "2021-08-19T10:17:08.564Z",
            "updated_at": "2022-01-19T11:14:30.681Z",
            "weight_grams": 10.0,
            "weight_unit": "g",
            "product_title": "Golden Retriever Dog - TEST",
            "full_title": "Golden Retriever Dog - TEST Dog - Variant 1",
            "sellable_title": "Dog - Variant 1",
            "profit": -4.05,
            "margin": -118.08,
            "tax_rate": 20.0,
            "estimated_delivery": null,
            "origin_country": null,
            "hs_tariff_number": null
        },
        "reason": null,
        "notes": null
    },
    {
        "id": 2745115510,
        "increased": false,
        "decreased": true,
        "quantity": 10,
        "stock_level": 310,
        "created_at": "2022-01-17T14:17:09.097Z",
        "action": {
            "name": "order_allocated",
            "summary": "Order <a href=\"/orders/105537895\">#P-105537895</a> allocated"
        },
        "stock_entry": {
            "sellable_id": 57991302,
            "warehouse_id": 51011,
            "infinite": false,
            "allocated_stock_level": 0,
            "stock_running_low": false,
            "updated_at": "2022-01-18T14:27:40.782Z",
            "incoming_stock_level": 0,
            "transit_outgoing_stock_level": 0,
            "warehouse": {
                "id": 51011,
                "name": "New Awesome Warehouse",
                "display_position": 4
            },
            "physical_stock_level": 423,
            "available_stock_level": 423,
            "sellable_on_hand_value": 3164.04,
            "transit_incoming_stock_level": 0,
            "location": "G-1"
        },
        "sellable": {
            "id": 57991302,
            "type": "ProductVariant",
            "title": "Dog - Variant 1",
            "sku_code": "DG01",
            "upc_code": "",
            "model_number": "",
            "price": 3.43,
            "cost_price": 7.48,
            "min_reorder_level": 0,
            "quantity_to_reorder": 0,
            "created_by_id": 43826,
            "created_at": "2021-08-19T10:17:08.564Z",
            "updated_at": "2022-01-19T11:14:30.681Z",
            "weight_grams": 10.0,
            "weight_unit": "g",
            "product_title": "Golden Retriever Dog - TEST",
            "full_title": "Golden Retriever Dog - TEST Dog - Variant 1",
            "sellable_title": "Dog - Variant 1",
            "profit": -4.05,
            "margin": -118.08,
            "tax_rate": 20.0,
            "estimated_delivery": null,
            "origin_country": null,
            "hs_tariff_number": null
        },
        "reason": null,
        "notes": null
    },
    {
        "id": 2745107267,
        "increased": false,
        "decreased": true,
        "quantity": 10,
        "stock_level": 320,
        "created_at": "2022-01-17T14:14:36.072Z",
        "action": {
            "name": "order_allocated",
            "summary": "Order <a href=\"/orders/105537697\">#P-105537697</a> allocated"
        },
        "stock_entry": {
            "sellable_id": 57991302,
            "warehouse_id": 51011,
            "infinite": false,
            "allocated_stock_level": 0,
            "stock_running_low": false,
            "updated_at": "2022-01-18T14:27:40.782Z",
            "incoming_stock_level": 0,
            "transit_outgoing_stock_level": 0,
            "warehouse": {
                "id": 51011,
                "name": "New Awesome Warehouse",
                "display_position": 4
            },
            "physical_stock_level": 423,
            "available_stock_level": 423,
            "sellable_on_hand_value": 3164.04,
            "transit_incoming_stock_level": 0,
            "location": "G-1"
        },
        "sellable": {
            "id": 57991302,
            "type": "ProductVariant",
            "title": "Dog - Variant 1",
            "sku_code": "DG01",
            "upc_code": "",
            "model_number": "",
            "price": 3.43,
            "cost_price": 7.48,
            "min_reorder_level": 0,
            "quantity_to_reorder": 0,
            "created_by_id": 43826,
            "created_at": "2021-08-19T10:17:08.564Z",
            "updated_at": "2022-01-19T11:14:30.681Z",
            "weight_grams": 10.0,
            "weight_unit": "g",
            "product_title": "Golden Retriever Dog - TEST",
            "full_title": "Golden Retriever Dog - TEST Dog - Variant 1",
            "sellable_title": "Dog - Variant 1",
            "profit": -4.05,
            "margin": -118.08,
            "tax_rate": 20.0,
            "estimated_delivery": null,
            "origin_country": null,
            "hs_tariff_number": null
        },
        "reason": null,
        "notes": null
    },
    {
        "id": 2720513572,
        "increased": true,
        "decreased": false,
        "quantity": 10,
        "stock_level": 330,
        "created_at": "2022-01-05T09:57:42.220Z",
        "action": {
            "name": "purchase_order_received",
            "summary": "Purchase order PO-28 received"
        },
        "stock_entry": {
            "sellable_id": 57991302,
            "warehouse_id": 51011,
            "infinite": false,
            "allocated_stock_level": 0,
            "stock_running_low": false,
            "updated_at": "2022-01-18T14:27:40.782Z",
            "incoming_stock_level": 0,
            "transit_outgoing_stock_level": 0,
            "warehouse": {
                "id": 51011,
                "name": "New Awesome Warehouse",
                "display_position": 4
            },
            "physical_stock_level": 423,
            "available_stock_level": 423,
            "sellable_on_hand_value": 3164.04,
            "transit_incoming_stock_level": 0,
            "location": "G-1"
        },
        "sellable": {
            "id": 57991302,
            "type": "ProductVariant",
            "title": "Dog - Variant 1",
            "sku_code": "DG01",
            "upc_code": "",
            "model_number": "",
            "price": 3.43,
            "cost_price": 7.48,
            "min_reorder_level": 0,
            "quantity_to_reorder": 0,
            "created_by_id": 43826,
            "created_at": "2021-08-19T10:17:08.564Z",
            "updated_at": "2022-01-19T11:14:30.681Z",
            "weight_grams": 10.0,
            "weight_unit": "g",
            "product_title": "Golden Retriever Dog - TEST",
            "full_title": "Golden Retriever Dog - TEST Dog - Variant 1",
            "sellable_title": "Dog - Variant 1",
            "profit": -4.05,
            "margin": -118.08,
            "tax_rate": 20.0,
            "estimated_delivery": null,
            "origin_country": null,
            "hs_tariff_number": null
        },
        "reason": null,
        "notes": null
    },
    {
        "id": 2697408651,
        "increased": true,
        "decreased": false,
        "quantity": 110,
        "stock_level": 320,
        "created_at": "2021-12-21T15:39:13.158Z",
        "action": {
            "name": "product_csv_imported",
            "summary": "CSV products import by Kristien Jones"
        },
        "stock_entry": {
            "sellable_id": 57991302,
            "warehouse_id": 51011,
            "infinite": false,
            "allocated_stock_level": 0,
            "stock_running_low": false,
            "updated_at": "2022-01-18T14:27:40.782Z",
            "incoming_stock_level": 0,
            "transit_outgoing_stock_level": 0,
            "warehouse": {
                "id": 51011,
                "name": "New Awesome Warehouse",
                "display_position": 4
            },
            "physical_stock_level": 423,
            "available_stock_level": 423,
            "sellable_on_hand_value": 3164.04,
            "transit_incoming_stock_level": 0,
            "location": "G-1"
        },
        "sellable": {
            "id": 57991302,
            "type": "ProductVariant",
            "title": "Dog - Variant 1",
            "sku_code": "DG01",
            "upc_code": "",
            "model_number": "",
            "price": 3.43,
            "cost_price": 7.48,
            "min_reorder_level": 0,
            "quantity_to_reorder": 0,
            "created_by_id": 43826,
            "created_at": "2021-08-19T10:17:08.564Z",
            "updated_at": "2022-01-19T11:14:30.681Z",
            "weight_grams": 10.0,
            "weight_unit": "g",
            "product_title": "Golden Retriever Dog - TEST",
            "full_title": "Golden Retriever Dog - TEST Dog - Variant 1",
            "sellable_title": "Dog - Variant 1",
            "profit": -4.05,
            "margin": -118.08,
            "tax_rate": 20.0,
            "estimated_delivery": null,
            "origin_country": null,
            "hs_tariff_number": null
        },
        "reason": null,
        "notes": null
    }
]

Each object in the above response will provide the attributes “increased”, “decreased”, “quantity” & “stock_level

From the above attributes, you can determine your products inventory change.

Hope this helps!
Kris.