> For the complete documentation index, see [llms.txt](https://docs.petje.af/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.petje.af/petje.af-api/reference/membership-rewards.md).

# Membership rewards

## Get membership rewards

<mark style="color:blue;">`GET`</mark> `https://api.petjeaf.com/v1/memberships/:membershipId/rewards`

Scope: `memberships.read`

#### Path Parameters

| Name         | Type   | Description          |
| ------------ | ------ | -------------------- |
| membershipId | string | ID of the membership |

#### Query Parameters

| Name  | Type    | Description                                     |
| ----- | ------- | ----------------------------------------------- |
| limit | integer | The number of rewards to return                 |
| from  | string  | Offset the result after the reward with this ID |

#### Headers

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| Authorization | string | Access token using the `Bearer` method |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
    "count": 3,
    "_embedded": {
        "rewards": [
            {
                "resource": "rewards",
                "id": "i3DMlxfiU7bzqLtYmFUS",
                "name": "Sticker",
                "description": "Schitterende sticker!",
                "active": true,
                "user": {},
                "type": "parcel",
                "_links": {
                    "self": {
                        "href": "https://api.petje.af/memberships/HVogpphHSabylpg2gBYL/rewards/i3DMlxfiU7bzqLtYmFUS",
                        "type": "application/hal+json"
                    },
                    "membership": {
                        "href": "https://api.petje.af/memberships/HVogpphHSabylpg2gBYL",
                        "type": "application/hal+json"
                    }
                }
            },
            ...
        ]
    },
    "_links": {
        "self": {
            "href": "https://api.petje.af/rewards",
            "type": "application/hal+json"
        },
        "next": null
    }
}
```

{% endtab %}
{% endtabs %}

## Get membership reward detail

<mark style="color:blue;">`GET`</mark> `https://api.petje.af/v1/memberships/:membershipId/rewards/:id`

Scope: `memberships.read`

#### Path Parameters

| Name         | Type   | Description                 |
| ------------ | ------ | --------------------------- |
| id           | string | ID of the membership reward |
| membershipId | string | ID of the membership        |

#### Headers

| Name          | Type   | Description                          |
| ------------- | ------ | ------------------------------------ |
| Authorization | string | Access token using the Bearer method |

{% tabs %}
{% tab title="200 " %}

```
{
    "resource": "rewards",
    "id": "i3DMlxfiU7bzqLtYmFUS",
    "name": "Sticker",
    "description": "Schitterende sticker!",
    "active": true,
    "user": {},
    "type": "parcel",
    "_links": {
        "self": {
            "href": "https://api.petje.af/memberships/HVogpphHSabylpg2gBYL/rewards/i3DMlxfiU7bzqLtYmFUS",
            "type": "application/hal+json"
        },
        "membership": {
            "href": "https://api.petje.af/memberships/HVogpphHSabylpg2gBYL",
            "type": "application/hal+json"
        }
    }
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "status": 404,
    "title": "Not Found",
    "detail": "Membership Reward is not found",
    "_links": {
        "documentation": {
            "href": "https://docs.petje.af",
            "type": "text/html"
        }
    }
}

```

{% endtab %}
{% endtabs %}
