> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://docs.bloy.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Points Redemptions

### List all points redemptions
Retrieve all "ways to redeem" (redemption configurations) for the shop, including a `redeemable` flag indicating whether the given customer has enough points to redeem each one.

`GET` `/rest-api/v1/pointsRedemptions`

**Query parameters**
| Name | Type | Description |
| ---- |
| `customerIdentifier` | string | Shopify customer ID or email (required) |
| `page` | int | Page number (required) |
| `pageSize` | int | Number of results per page (required, max 250) |

**Example request**
```
curl --request GET \
     --url 'https://api.bloy.io/rest-api/v1/pointsRedemptions?customerIdentifier=customer@example.com&page=1&pageSize=20' \
     --header 'Authorization: Bearer YourApiKeyGoesHere'

```

**Example response**
```
{
  "success": true,
  "message": "OK",
  "pointsRedemptions": [
    {
      "_id": "664f1a2b3c4d5e6f7a8b9c30",
      "redeemable": true,
      "status": true,
      "name": "$5 Off",
      "type": "amount",
      "discountPrefix": "BLOY",
      "exchangeType": "variable",
      "rewardValue": 100,
      "discountValue": 5,
      "purchaseType": "one_time",
      "applyProductOption": "all",
      "applyProducts": [],
      "applyCollections": [],
      "applyVariants": [],
      "minimumRequirementType": "none",
      "combinations": [],
      "expireDateType": "none",
      "sortIndex": 0,
      "createdAt": "2025-12-01T03:00:00.000Z",
      "updatedAt": "2025-12-01T03:00:00.000Z"
    },
    {
      "_id": "664f1a2b3c4d5e6f7a8b9c31",
      "redeemable": false,
      "status": true,
      "name": "Free shipping",
      "type": "shipping",
      "discountPrefix": "BLOY",
      "rewardValue": 300,
      "discountValue": 0,
      "purchaseType": "one_time",
      "applyProductOption": "all",
      "applyProducts": [],
      "applyCollections": [],
      "applyVariants": [],
      "minimumRequirementType": "none",
      "combinations": [],
      "expireDateType": "none",
      "sortIndex": 1,
      "createdAt": "2025-12-01T03:00:00.000Z",
      "updatedAt": "2025-12-01T03:00:00.000Z"
    }
  ]
}
```
---
### Redeem a reward for points
Redeem a reward using a customer's points and generate the corresponding discount code.

`POST /rest-api/v1/pointsRedemptions`

**Body**
| Name | Type | Description |
| ---- |
| `customerIdentifier` | string | Shopify customer ID or email (required) |
| `pointsAmount` | int | Number of points to redeem (> 0, required) |
| `rewardId` | string | The reward `_id` obtained from `GET /rest-api/v1/pointsRedemptions` (required) |
| `variantId` | string | Product variant ID (only used for `free_product` rewards) |
| `currencyActive` | string | Currency code applied to the discount (optional) |

**Example request**
```
curl --request POST \
     --url https://api.bloy.io/rest-api/v1/pointsRedemptions \
     --header 'Authorization: Bearer YourApiKeyGoesHere' \
     --header 'Content-Type: application/json' \
     --data '{
       "customerIdentifier": "customer@example.com",
       "pointsAmount": 100,
       "rewardId": "664f1a2b3c4d5e6f7a8b9c30"
     }'

```
**Example response**
```
{
  "success": true,
  "message": "OK",
  "discountCode": "BLOY-AB12CD34"
}

```
