> ## Documentation Index
> Fetch the complete documentation index at: https://devzone.nayax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Revenue Per Machine: Integration Guide

> A step-by-step guide to retrieving revenue data broken down per machine, per day, and per month using the Widgets Dashboard API.

The Widgets Dashboard API lets you retrieve revenue data broken down per machine, per day, and per month. For filter and field reference, see [Widget Filters Reference](/docs/manage-data-operations/lynx-api/reports/widget-filters).

All requests require a valid access token in the `Authorization` header. See [Security & Token](/docs/manage-data-operations/lynx-api/security) to learn how to retrieve and use yours.

## Discover widget IDs

Call the list-widgets endpoint to see all available widgets and their IDs:

```bash theme={null}
curl -X GET "https://<host>/operational/v1/dashboard/widgets?screenTypeId=1" \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"
```

From the response, identify the `widgetTypeId` values for revenue-related widgets (look for names containing "Revenue", "Sales", or similar).

## Revenue per machine per day

Use the `groupBy: day` filter with a date range to retrieve daily revenue totals:

```bash theme={null}
curl -X POST "https://<host>/operational/v1/dashboard/get-widget-data" \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "screenTypeId": 1,
    "widgetTypeId": 193,
    "entityId": <operatorId>,
    "filters": [
      { "name": "startDate", "value": "2025-01-01", "type": "Date" },
      { "name": "endDate",   "value": "2025-01-31", "type": "Date" },
      { "name": "groupBy",   "value": "day",        "type": "string" }
    ]
  }'
```

## Revenue per machine per month

Switch `groupBy` to `month` and widen the date range to retrieve monthly revenue totals:

```bash theme={null}
curl -X POST "https://<host>/operational/v1/dashboard/get-widget-data" \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "screenTypeId": 1,
    "widgetTypeId": 193,
    "entityId": <operatorId>,
    "filters": [
      { "name": "startDate", "value": "2025-01-01", "type": "Date" },
      { "name": "endDate",   "value": "2025-12-31", "type": "Date" },
      { "name": "groupBy",   "value": "month",      "type": "string" }
    ]
  }'
```

## Revenue for a specific machine

Pass the machine ID via `entityId` (if the widget is machine-scoped) or via the `MachineId` filter:

```bash theme={null}
curl -X POST "https://<host>/operational/v1/dashboard/get-widget-data" \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "screenTypeId": 1,
    "widgetTypeId": 193,
    "entityId": null,
    "filters": [
      { "name": "startDate", "value": "2025-01-01", "type": "Date"   },
      { "name": "endDate",   "value": "2025-12-31", "type": "Date"   },
      { "name": "MachineId", "value": "<machineId>","type": "int"    },
      { "name": "groupBy",   "value": "day",        "type": "string" }
    ]
  }'
```

<Note>
  The exact filter names and `groupBy` values supported by a widget depend on its stored procedure in Cortex Reports. If a filter name is not recognized, it is silently ignored. Test with and without each filter and compare responses.
</Note>
