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

# Get Rewards

> This endpoint returns a user's rewards.

<Note>
  Please review proper request headers [here](/consumer/usage/headers).
</Note>

### Parameters

<ParamField query="states" type="array[string]">
  Only rewards in these states will be returned. Valid options are:
  (`available`, `active`, `used`). The default is to return all rewards in these
  3 states. Use array bracket notation: `states[]=available`. For multiple
  states: `states[]=available&states[]=active`.

  | State       | Description                                |
  | ----------- | ------------------------------------------ |
  | `available` | This reward is `available` to use          |
  | `active`    | The user has activated this reward for use |
  | `used`      | The reward has been used                   |
</ParamField>

<ParamField query="merchant_id" type="string">
  Only return features for this merchant if you have access to multiple
  merchants
</ParamField>

<ParamField query="user_id" type="string">
  Only return rewards for this user. Note: the bearer token will be used to
  determine which user's rewards are being requested when the request is made by
  a logged in user.
</ParamField>

<Snippet file="pagination/params.mdx" />

### Response

<Snippet file="entities/reward.mdx" />

<Snippet file="pagination/response.mdx" />

<RequestExample>
  ```bash Get Rewards theme={null}
  curl "https://api.thanxsandbox.com/rewards?states[]=available" \
    -X GET \
    -H "Content-Type: application/json"  \
    -H "Accept-Version: v4.0" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer ${token}" \
    -H "X-ClientId: ${client_id}" 
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "rewards": [
      {
        "id": "222441e34626",
        "olo_uid": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn",
        "user_id": "werofsdf",
        "merchant_id": "weroif",
        "campaign_id": "85133c3c1258",
        "state": "available",
        "earn": {
          "type": "intro"
        },
        "redeem": {
          "type": "manual",
          "text": "$10 off",
          "detail": "Long description",
          "window": 60,
          "venue": "all"
        },
        "coupon_code": {
          "code": null,
          "type": null,
          "display": null
        },
        "fine_print": "Can't be used for alcohol purchases",
        "instructions": "Example staff instructions",
        "available_at": "2019-12-25T19:00:00Z",
        "activated_at": "2020-01-01T20:00:00Z",
        "retire_at": null,
        "used_at": null,
        "images": {
          "index": {
            "small": "https://...png",
            "large": "https://...png"
          },
          "detail": {
            "small": "https://...png",
            "large": "https://...png"
          },
          "advertising": {
            "small": "https://...png",
            "large": "https://...png"
          }
        },
        "uses_dynamic_coupon_codes": false
      }
    ]

  ```
</ResponseExample>
