WbAnalytics icon

WbAnalytics

n8n node to interact with WB API

Overview

This node interacts with a sales funnel analytics API to post detailed reports about product items (referred to as "Nm" or articles) within a specified period. It is designed for users who want to analyze sales performance, inventory status, and customer interactions with products on a marketplace platform.

Typical use cases include:

  • Generating detailed sales reports filtered by brands, product IDs, tags, or article numbers.
  • Sorting report data by various metrics such as order sums, number of orders, average price, stock quantities, and returns.
  • Paginating through large datasets to retrieve manageable chunks of report data.
  • Adjusting the report's time zone and period to match business needs.

For example, a user might want to get a report of all products from certain brands sold between June 2023 and March 2024, sorted by total order value in ascending order, to identify best-performing items.

Properties

Name Meaning
Brand Names List of brand names to filter the report by. Example: ["Some"].
Object I Ds List of item IDs to include in the report. Example: [358].
Tag I Ds List of tag IDs to filter items by specific labels. Example: [123].
Nm I Ds List of article numbers (WB articles) to filter the report. Example: [1234567].
Timezone Time zone for the report timestamps. Defaults to "Europe/Moscow" if not specified.
Period Required. JSON object specifying the start (begin) and end (end) datetime strings for the report period. Example: { "begin": "2023-06-01 20:05:32", "end": "2024-03-01 20:05:32" }.
Order By JSON object defining sorting parameters with two fields: field and mode. If omitted, defaults to sorting by "openCard" field in descending order. Supported fields include:
- openCard (product page views)
- addToCart
- orders
- avgRubPrice
- ordersSumRub
- stockMpQty
- stockWbQty
- cancelSumRub
- cancelCount
- buyoutCount
- buyoutSumRub
Modes are typically "asc" or "desc". Example: { "field": "ordersSumRub", "mode": "asc" }.
Page Required. Number indicating which page of results to retrieve. Default is 1.

Output

The node outputs JSON data containing detailed report information about the requested products and their sales funnel metrics. The structure includes aggregated statistics such as order counts, sums, stock levels, cancellations, and buyouts, aligned with the filters and sorting applied.

No binary data output is indicated.

Dependencies

  • Requires an API key credential for authentication with the external sales analytics service.
  • The node uses a base URL configured from a bundled Swagger/OpenAPI specification.
  • Proper configuration of the API credentials in n8n is necessary for successful requests.

Troubleshooting

  • Invalid or missing API credentials: Ensure that the API key or authentication token is correctly set up in n8n credentials.
  • Incorrect JSON formatting in properties: Since several inputs expect JSON arrays or objects, invalid JSON syntax will cause errors. Validate JSON input before running.
  • Date/time format issues: The period property requires date-time strings in a specific format (YYYY-MM-DD HH:mm:ss). Incorrect formats may lead to request failures.
  • Pagination errors: Requesting pages beyond available data may return empty results; verify the total number of pages if supported.
  • Sorting field or mode errors: Using unsupported fields or modes in the orderBy property may cause the API to reject the request.

Links and References

  • No direct external links provided in the source code.
  • Users should refer to the external sales analytics API documentation for detailed descriptions of report fields and sorting options.

Discussion