---
title: "Counts the store's discounts by status."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo merchant API › discount

`GET /v1/stores/{store}/discounts/stats`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `discount:read`

## Path parameters

- `store` (`discountStats.path.store`; string, required) — The store's id.

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/discounts/stats' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/discounts/stats';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/discounts/stats"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Counts the store's discounts by status.

#### Example

```json
{
  "total": 0,
  "by_status": {
    "active": 0,
    "scheduled": 0,
    "off": 0,
    "expired": 0,
    "archived": 0
  },
  "automatic": 0,
  "uses": 0,
  "customers": 0
}
```

- `total` (`discountStats.response.200.total`; number, required)
- `by_status` (`discountStats.response.200.by_status`; object, required)
  - `active` (`discountStats.response.200.by_status.active`; number, required)
  - `scheduled` (`discountStats.response.200.by_status.scheduled`; number, required)
  - `off` (`discountStats.response.200.by_status.off`; number, required)
  - `expired` (`discountStats.response.200.by_status.expired`; number, required)
  - `archived` (`discountStats.response.200.by_status.archived`; number, required)
- `automatic` (`discountStats.response.200.automatic`; number, required)
- `uses` (`discountStats.response.200.uses`; number, required)
- `customers` (`discountStats.response.200.customers`; number, required)

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`discountStats.response.default.type`; string, required)
  - format `uri`
- `title` (`discountStats.response.default.title`; string, required)
- `status` (`discountStats.response.default.status`; integer, required)
- `detail` (`discountStats.response.default.detail`; string, required)
- `code` (`discountStats.response.default.code`; string, optional)
- `context` (`discountStats.response.default.context`; object, optional)
- `reached_core` (`discountStats.response.default.reached_core`; boolean, optional)
- `core_answer` (`discountStats.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/discount-stats/index.md
