Skip to main content

Web Table Directly Excel Using Power Query Tool

BaseUrl = before api url

Token = Bearer token

RequestBody = if any filter sending data then put else ignore it. leave it blank ([])

RelativePath = put api url

let
    BaseUrl = "http://localhost:4000",
    Token = "107ff27c8271439296635a9d09e8e21ff1710f88c08b404e9ae151c3a316f2f1beb8c25a36ce4d589c3b842ba973a02b"token",
    CookieValue = "cookies_value",

    RequestBody = [
        store_id = null,
        from_date = "2026-2025-07-17T00:00:00",
        to_date = "2026-08-21T00:07-16T00:00:00",
        receipt_type = null,
        receipt_number_ids = null,
        vendor_ids = null,
        bill_number = null,
        complimentary = "include",
        item_type = 0,
        capital_goods = "include",
        purchase_type = null,
        group_by = null,
        product_id = null,
        product_group_id = null,
        show_summary = "exclude",
        summary_type = {"item_group"}
    ],

    Response = Web.Contents(
        BaseUrl,
        [
            RelativePath = "api/inv/Reports/ReceiptReport"ReceiptReport?", // api url
            Headers = [
                Authorization = "Bearer " & Token,
                Cookie = CookieValue,
                #"Content-Type" = "application/json",
                Accept = "application/json"
            ],
            Content = Json.FromValue(RequestBody)
        ]
    ),

        JsonResponse = Json.Document(Response),

    Result = JsonResponse
in
    Result