# DiscountChanges

> Page through a discount code's change history and provider sync state. Read access, discounts toolset, MCP tool get_discount_changes.

**Access:** [Read](https://developer.missin.co.uk/get-started/authentication.md#access-levels)

## Variables

| Variable | Type | Required | Accepts | Description |
|---|---|---|---|---|
| `after` | `Cursor` | no | Opaque cursor from `pageInfo.endCursor` |  |
| `filter` | `DiscountChangeFilter` | no | Input object, below |  |
| `first` | `Int` | no | 32-bit integer. Default `50` |  |
| `id` | `UUID!` | yes |  |  |

## Input types

A filter lists its fields by the type they take, and none of them is required.

### DiscountChangeFilter

- `[DiscountChangeFilter!]`: `and`, `or`
- `Boolean`: `connectionByConnectionIdExists`, `discountCodeByDiscountCodeIdExists`, `discountPlacementByDiscountPlacementIdExists`
- [UUIDFilter](https://developer.missin.co.uk/reference/input-types.md#uuidfilter): `connectionId`, `discountCodeId`, `discountPlacementId`, `rowId`
- [DatetimeFilter](https://developer.missin.co.uk/reference/input-types.md#datetimefilter): `createdAt`
- `DiscountChangeFilter`: `not`
- [StringFilter](https://developer.missin.co.uk/reference/input-types.md#stringfilter): `payloadHash`

## Call it

```bash curl
curl https://api.missin.co.uk/graphql/v1 \
  -H "Authorization: Bearer $MISSIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"operationName":"DiscountChanges","variables":{"id":"00000000-0000-0000-0000-000000000000"},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"561e07f8854f69f5efae95e6ed8f7b9ca1f68bb427bcee9239a589f50e175e73"}}}'
```

## Document

```graphql
query DiscountChanges($after: Cursor, $filter: DiscountChangeFilter, $first: Int = 50, $id: UUID!) { __typename discountCodeByRowId(rowId: $id) { __typename discountChangesByDiscountCodeId( first: $first after: $after orderBy: CREATED_AT_DESC filter: $filter ) { __typename nodes { __typename actorAuth0Id after approvedAt approvedByAuth0Id attempts baseVersion before connectionId createdAt diff direction discountPlacementByDiscountPlacementId { __typename connectionByConnectionId { __typename displayName id } id } discountPlacementId error externalEventId id operation rowId source status } pageInfo { __typename endCursor hasNextPage } totalCount } id rowId } }
```

Source: https://developer.missin.co.uk/reference/discounts/discount-changes
