Я подружил Power Query и Ozon!!!!!!
Делаете пустой запрос. В расширенном редакторе вставляете тест ниже. Client-Id"="ХХХХХХХХ" и "Api-Key"="ХХХХХХХХХХХ" меняете на свои.
let
Запрос = let
url = "https://api-seller.ozon.ru/v3/finance/transaction/list" ;,
body = "{""filter"": {
""date"": {
""from"": ""2023-01-01T00:00:00.000Z"",
""to"": ""2023-01-20T00:00:00.000Z""
},
""operation_type"": [],
""posting_number"": """",
""transaction_type"": ""all""
},
""page"": 1,
""page_size"": 1000
}",
Parsed_JSON = Json.Document(body),
BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
Source = Json.Document(Web.Contents(url,[Headers = [#"Content-Type"="application/json",#"Client-Id"="ХХХХХХХХ",#"Api-Key"="ХХХХХХХХХХХ"], Content = Text.ToBinary(body) ] )),
result = Source[result],
items = result[items]
in
Source,
#"Преобразовано в таблицу" = Record.ToTable(Запрос),
#"Развернутый элемент Value" = Table.ExpandRecordColumn(#"Преобразовано в таблицу", "Value", {"operations", "page_count", "row_count"}, {"Value.operations", "Value.page_count", "Value.row_count"}),
#"Развернутый элемент Value.operations" = Table.ExpandListColumn(#"Развернутый элемент Value", "Value.operations"),
#"Развернутый элемент Value.operations1" = Table.ExpandRecordColumn(#"Развернутый элемент Value.operations", "Value.operations", {"operation_id", "operation_type", "operation_date", "operation_type_name", "delivery_charge", "return_delivery_charge", "accruals_for_sale", "sale_commission", "amount", "type", "posting", "items", "services"}, {"Value.operations.operation_id", "Value.operations.operation_type", "Value.operations.operation_date", "Value.operations.operation_type_name", "Value.operations.delivery_charge", "Value.operations.return_delivery_charge", "Value.operations.accruals_for_sale", "Value.operations.sale_commission", "Value.operations.amount", "Value.operations.type", "Value.operations.posting", "Value.operations.items", "Value.operations.services"})
in
#"Развернутый элемент Value.operations1"
Делаете пустой запрос. В расширенном редакторе вставляете тест ниже. Client-Id"="ХХХХХХХХ" и "Api-Key"="ХХХХХХХХХХХ" меняете на свои.
let
Запрос = let
url = "
body = "{""filter"": {
""date"": {
""from"": ""2023-01-01T00:00:00.000Z"",
""to"": ""2023-01-20T00:00:00.000Z""
},
""operation_type"": [],
""posting_number"": """",
""transaction_type"": ""all""
},
""page"": 1,
""page_size"": 1000
}",
Parsed_JSON = Json.Document(body),
BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
Source = Json.Document(Web.Contents(url,[Headers = [#"Content-Type"="application/json",#"Client-Id"="ХХХХХХХХ",#"Api-Key"="ХХХХХХХХХХХ"], Content = Text.ToBinary(body) ] )),
result = Source[result],
items = result[items]
in
Source,
#"Преобразовано в таблицу" = Record.ToTable(Запрос),
#"Развернутый элемент Value" = Table.ExpandRecordColumn(#"Преобразовано в таблицу", "Value", {"operations", "page_count", "row_count"}, {"Value.operations", "Value.page_count", "Value.row_count"}),
#"Развернутый элемент Value.operations" = Table.ExpandListColumn(#"Развернутый элемент Value", "Value.operations"),
#"Развернутый элемент Value.operations1" = Table.ExpandRecordColumn(#"Развернутый элемент Value.operations", "Value.operations", {"operation_id", "operation_type", "operation_date", "operation_type_name", "delivery_charge", "return_delivery_charge", "accruals_for_sale", "sale_commission", "amount", "type", "posting", "items", "services"}, {"Value.operations.operation_id", "Value.operations.operation_type", "Value.operations.operation_date", "Value.operations.operation_type_name", "Value.operations.delivery_charge", "Value.operations.return_delivery_charge", "Value.operations.accruals_for_sale", "Value.operations.sale_commission", "Value.operations.amount", "Value.operations.type", "Value.operations.posting", "Value.operations.items", "Value.operations.services"})
in
#"Развернутый элемент Value.operations1"