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

# Purchase validation

> Validate customer purchases

We offer an easy way for developers to validate and load purchases.

Get all the purchases of your products

```bash cURL
GET /api.sidedish.dev/purchases
-H X-Sidedish-API-Key=sidedish account token of the merchant of the product
-H X-Sidedish-Store-Id= specific store id
```

<ParamField path="productId" type="string">
  The `id` of the product. Limit results to specific product.
</ParamField>

<ParamField path="userId" type="string">
  The `id` of the user. Limit results to specific user.
</ParamField>

<ParamField path="type" type="string">
  The type of purchase. Limit results to specific type \[one-time, subscription]
</ParamField>

<ParamField path="active" type="boolean">
  Limit results to active subscriptions or unconsumed products
</ParamField>

In order to check if a user has bought the service you query this with a specific product and user. Then filter results for an active purchase.

```json
{
    "purchases":  [
        {
            "id": "5f8d0f0a-d8a0-4f5e-a2d7-e2e0e8e9e8e7",
            "active": true,
            "type": "subscription",
            "productId": "5f8d0f0a-d8a0-4f5e-a2d7-e2e0e8e9e8e7",
            "userId": "5f8d0f0a-d8a0-4f5e-a2d7-e2e0e8e9e8e7",
        }
    ]
}
```
