Get products in demand report

Get products in demand report

get

Retrieve a paginated list of product variants with demand metrics based on customer intents. Returns aggregated data showing total intents, pending intents, and last requested date for each variant. Results can be filtered by date range and sorted by different metrics.

Authorizations
X-Auth-TokenstringRequired
Query parameters
start_datestring · dateOptional

Filter by start date (YYYY-MM-DD). Filters based on last_requested_at field.

end_datestring · dateOptional

Filter by end date (YYYY-MM-DD). Filters based on last_requested_at field.

sort_bystring · enumOptional

Sort results by pending intents, total intents, or last requested date

Default: pendingPossible values:
directionstring · enumOptional

Sort direction (ascending or descending)

Default: descPossible values:
pageintegerOptional

Page number for pagination

Default: 1
per_pageinteger · max: 500Optional

Number of items per page (maximum 500)

Default: 25
intent_typestringOptional

Filter by intent type (used when loading product data)

Header parameters
X-Auth-TokenstringRequired

API key for authentication

Responses
200

A paginated list of product variants with demand metrics

application/json
get
/intents/products_in_demand
GET /api/v1/external/intents/products_in_demand HTTP/1.1
Host: app.stoqapp.com
X-Auth-Token: text
Accept: */*
{
  "product_variants_in_demand": [
    {
      "shopify_variant_id": 123456789,
      "shopify_product_id": 987654321,
      "shopify_inventory_item_id": 555666777,
      "total": 45,
      "pending": 23,
      "last_requested_at": "2024-01-15T10:30:00Z",
      "product_data": {
        "id": 987654321,
        "title": "Sample Product",
        "vendor": "Sample Vendor",
        "variants": [
          {
            "id": 123456789,
            "title": "Medium / Red",
            "sku": "SAMPLE-M-RED"
          }
        ]
      },
      "variant_data": {
        "id": 123456789,
        "title": "Medium / Red",
        "sku": "SAMPLE-M-RED"
      }
    }
  ],
  "page": 1,
  "per_page": 25,
  "has_next_page": false,
  "has_prev_page": false
}

Last updated