# Get key figures for a period (/api-reference/sales/getSalesSummary)

## GET https://api.ajour.dk/v1/sales/summary

The same key figures as the cards on the Ajour dashboard. Add `compare=previousYear` to also get last year's figures for the same weekdays, aligned the same way as the dashboard. The period can be at most 366 days. Requires scope `sales:read`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `from` | query | string (date) | yes | First day of the period, as a local date in Europe/Copenhagen. |
| `to` | query | string (date) | yes | Last day of the period, included. Local date in Europe/Copenhagen. |
| `locationId` | query | array of integer (int32) | no | Only these locations. Repeat the parameter for more than one. Must be locations the key can see. Leave out for all of them. |
| `productGroupId` | query | string | no | Only this product group (POS number). |
| `productId` | query | array of string | no | Only these products (POS numbers). Repeat the parameter for more than one. |
| `orderType` | query | array of `pos`, `online`, `invoice` | no | Only these order types. Repeat the parameter for more than one. |
| `salesperson` | query | string | no | Only this salesperson, by name as on the register. |
| `vat` | query | `include`, `exclude` | no | Show money amounts including or excluding VAT. |
| `metrics` | query | array of `totalTurnover`, `posTurnover`, `onlineTurnover`, `transactions`, `averageTransaction`, `discount`, `returns`, `contributionMargin`, `contributionMarginPercent` | no | Only return these figures. Repeat the parameter for more than one. Leave out to get all. |
| `compare` | query | `previousYear` | no | Add last year's figures for the same weekdays. |

### Responses

- `200`: OK
- `400`: A parameter has the wrong format, or an unknown value.
- `401`: The API key is missing, wrong or revoked.
- `403`: The key is valid but does not have the scope this call needs, or the company is not active.
- `404`: The item does not exist, or it is a location the key cannot see.
- `422`: The parameters have the right format but are not allowed together.
- `429`: Too many requests for this key. Wait for `Retry-After` seconds.

Example `200` response:

```json
{
  "period": {
    "from": "2026-11-01",
    "to": "2026-11-21"
  },
  "currency": "DKK",
  "vat": "include",
  "metrics": {
    "totalTurnover": 486210.5,
    "posTurnover": 451900,
    "onlineTurnover": 34310.5,
    "transactions": 6120,
    "averageTransaction": 79.45,
    "discount": 8120,
    "returns": 1340,
    "contributionMargin": 301455.2,
    "contributionMarginPercent": 62
  },
  "previousYear": {
    "period": {
      "from": "2025-11-02",
      "to": "2025-11-22"
    },
    "metrics": {
      "totalTurnover": 441870,
      "posTurnover": 410020,
      "onlineTurnover": 31850,
      "transactions": 5893,
      "averageTransaction": 74.98,
      "discount": 7710,
      "returns": 1205,
      "contributionMargin": 272190.4,
      "contributionMarginPercent": 61.6
    }
  }
}
```