> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ordergroove.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ordergroove.com/_mcp/server.

# List entitlements

GET https://restapi.ordergroove.com/entitlements/

Returns a paginated list of entitlements for a merchant's customers, newest first. Only relevant for merchants offering digital products.

Query parameters narrow the results, and combining them returns only entitlements that match all of them. With [Storefront API Scope](/api-reference/authentication#storefront-api-scope) authentication, only the authenticated customer's entitlements are returned and `merchant_user_id` is ignored.

Results are cursor-paginated. To page through them, follow the `next` and `previous` URLs in the response.

Accepts [Application API Scope](/api-reference/authentication#application-api-scope) or [Storefront API Scope](/api-reference/authentication#storefront-api-scope) authentication.

Reference: https://docs.ordergroove.com/reference/entitlements-service-api/entitlements/list

## Request

### Query parameters

- `merchant` (string, required) — Merchant ID. Must match the merchant the credentials belong to. A missing or mismatched value returns `403`.
- `merchant_user_id` (string, optional) — Customer ID. Returns only this customer's entitlements. Ignored with Storefront API Scope, which always returns only the authenticated customer's entitlements.
- `resource_public_id` (string, optional) — Returns only entitlements for this resource ID. Cannot be combined with `resource_public_ids`.
- `resource_public_ids` (string, optional) — Returns only entitlements for any of these resource IDs. Provide a comma-separated list of up to 50 IDs, with no duplicates or empty values. Cannot be combined with `resource_public_id`.
- `external_resource_id` (string, optional) — Returns only entitlements for the resource with this merchant resource ID (the resource's `external_resource_id`). Returns an empty list if no resource matches.
- `resource_name` (string, optional) — Returns only entitlements for resources whose name exactly matches this value, ignoring case and leading or trailing whitespace. Returns an empty list if no resource matches.
- `live` (boolean, optional) — `true` returns only entitlements that are currently live, meaning their `expiration` plus any `grace_period` hasn't passed. `false` returns only entitlements that are no longer live.
- `has_grantees` (boolean, optional) — `true` returns only entitlements with at least one grantee. `false` returns only entitlements with no grantees. Cannot be combined with `grantee_external_ids_exact`.
- `grantee_external_ids_exact` (string, optional) — Returns only entitlements whose grantees are exactly this set of grantee external IDs, in any order. Provide a comma-separated list of up to 50 IDs, with no duplicates or empty values. For example, `grantee_a,grantee_b` matches an entitlement with grantees `grantee_a` and `grantee_b`, but not one with only `grantee_a` or one that also has `grantee_c`. Cannot be combined with `has_grantees`.
- `page_size` (integer, optional, default: 100) — Number of entitlements to return per page, from 1 to 100.
- `cursor` (string, optional) — Position to continue paginating from. Set automatically in the `next` and `previous` URLs; don't construct it yourself.

## Response

### 200

200

- `next` (string, required, nullable) — URL to get the next page of results. `null` if there are no more pages.
- `previous` (string, required, nullable) — URL to get the previous page of results. `null` if there are no previous pages.
- `results` (list of Entitlement, required) — Up to `page_size` entitlements (100 by default), newest first.

## Errors

### 400 Bad Request Error

A query parameter is invalid, or two parameters that can't be combined were both provided.

- `title` (string, required) — Short summary or error code.
- `status` (integer, required) — HTTP status code.
- `detail` (string, optional) — Explanation of what went wrong.

### 403 Forbidden Error

Authentication failed, or `merchant` is missing or doesn't match the merchant the credentials belong to. Authentication failures come from the API gateway as `application/json`; `merchant` errors come from the service as `application/problem+json`.

- `detail` (string, required) — Why authentication failed. Usually `Authentication Failed`; expired or malformed bearer tokens return `Token expired`, `Invalid token`, or `Invalid token issuer`.

### 500 Internal Server Error

The entitlements or their resources could not be retrieved.

- `title` (string, required) — Short summary or error code.
- `status` (integer, required) — HTTP status code.
- `detail` (string, optional) — Explanation of what went wrong.

## Types

### Entitlement

An entitlement granting a customer access to a resource.

- `merchant` (string, required) — Merchant ID.
- `public_id` (string, required) — Entitlement ID.
- `merchant_user_id` (string, required) — Customer ID.
- `initial_activation_date` (string, required, nullable) — Initial activation date (UTC).
- `latest_activation_date` (string, required, nullable) — Latest activation date (UTC).
- `grace_period` (integer, required, nullable) — Grace period, in seconds.
- `live` (boolean, required) — Whether the resource this entitlement grants access to is currently accessible. Accounts for `grace_period`.
- `access_type` (enum, required) — The entitlement's access type.
  - Allowed values: `time_based`
- `expiration` (string, required, nullable) — Entitlement access expiration date (UTC).
- `created` (string, required) — Date the entitlement was created (UTC).
- `last_updated` (string, required) — Date the entitlement was last updated (UTC).
- `grantees` (list of Grantee, required, nullable) — Grantees associated with the entitlement. `null` if there are none.
- `resource` (Resource, optional) — The resource this entitlement grants access to.

### Grantee

- `external_id` (string, required) — The grantee's external ID.
- `name` (string, required) — The grantee's name.
- `created` (string, required) — Date the grantee was created (UTC).
- `updated` (string, required) — Date the grantee was last updated (UTC).

### Resource

- `public_id` (string, required) — Resource ID.
- `merchant` (string, required) — Merchant ID.
- `name` (string, required) — Resource name.
- `external_resource_id` (string, required, nullable) — Merchant resource ID.
- `identified_product_external_id` (string, required, nullable) — External ID of the Ordergroove product this resource is linked to for subscription renewal syncing. Present only when the resource is tied to a meta-entitlement; `null` otherwise.
- `description` (string, required, nullable) — Resource description.
- `image_url` (string, required, nullable) — Resource image URL.
- `created` (string, required) — Date the resource was created (UTC).
- `last_updated` (string, required) — Date the resource was last updated (UTC).

## Examples

**Response**

```json
{
  "next": "https://restapi.ordergroove.com/entitlements/?cursor=NjZmMmExYzRlOGIzZDI3YTljMGY0ZTUxOm5leHQ%3D&merchant=339536244b7c11eb8d37ee71e0f3a639&page_size=100",
  "previous": null,
  "results": [
    {
      "merchant": "339536244b7c11eb8d37ee71e0f3a639",
      "public_id": "4c6dceaa1ddc4361962f9f6b11c0af7a",
      "merchant_user_id": "test_user_id",
      "initial_activation_date": "2024-08-12T20:35:19.04Z",
      "latest_activation_date": "2024-08-12T20:35:19.04Z",
      "grace_period": null,
      "live": false,
      "access_type": "time_based",
      "expiration": "2024-09-12T20:35:19.04Z",
      "created": "2024-08-12T20:35:19.04Z",
      "last_updated": "2024-08-12T20:35:19.04Z",
      "grantees": [
        {
          "external_id": "grantee-001",
          "name": "Alex Rivera",
          "created": "2024-08-12T20:35:19.04Z",
          "updated": "2024-08-12T20:35:19.04Z"
        }
      ],
      "resource": {
        "public_id": "ecb42bee71ff11efb72ef29e3ec3bb34",
        "merchant": "339536244b7c11eb8d37ee71e0f3a639",
        "name": "Piano lesson",
        "external_resource_id": "123456",
        "identified_product_external_id": null,
        "description": null,
        "image_url": "https://example.com/images/piano-lesson.png",
        "created": "2024-08-01T14:02:11.512Z",
        "last_updated": "2024-08-01T14:02:11.512Z"
      }
    }
  ]
}
```

**SDK Code**

```python Result
import requests

url = "https://restapi.ordergroove.com/entitlements/"

querystring = {"external_resource_id":"123456","grantee_external_ids_exact":"grantee_a,grantee_b","merchant":"339536244b7c11eb8d37ee71e0f3a639","merchant_user_id":"23799452926316","resource_name":"Piano lesson","resource_public_id":"ecb42bee71ff11efb72ef29e3ec3bb34","resource_public_ids":"ecb42bee71ff11efb72ef29e3ec3bb34,3fa56741671444bdbcdf7b1554f67bee"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript Result
const url = 'https://restapi.ordergroove.com/entitlements/?external_resource_id=123456&grantee_external_ids_exact=grantee_a%2Cgrantee_b&merchant=339536244b7c11eb8d37ee71e0f3a639&merchant_user_id=23799452926316&resource_name=Piano+lesson&resource_public_id=ecb42bee71ff11efb72ef29e3ec3bb34&resource_public_ids=ecb42bee71ff11efb72ef29e3ec3bb34%2C3fa56741671444bdbcdf7b1554f67bee';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Result
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://restapi.ordergroove.com/entitlements/?external_resource_id=123456&grantee_external_ids_exact=grantee_a%2Cgrantee_b&merchant=339536244b7c11eb8d37ee71e0f3a639&merchant_user_id=23799452926316&resource_name=Piano+lesson&resource_public_id=ecb42bee71ff11efb72ef29e3ec3bb34&resource_public_ids=ecb42bee71ff11efb72ef29e3ec3bb34%2C3fa56741671444bdbcdf7b1554f67bee"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Result
require 'uri'
require 'net/http'

url = URI("https://restapi.ordergroove.com/entitlements/?external_resource_id=123456&grantee_external_ids_exact=grantee_a%2Cgrantee_b&merchant=339536244b7c11eb8d37ee71e0f3a639&merchant_user_id=23799452926316&resource_name=Piano+lesson&resource_public_id=ecb42bee71ff11efb72ef29e3ec3bb34&resource_public_ids=ecb42bee71ff11efb72ef29e3ec3bb34%2C3fa56741671444bdbcdf7b1554f67bee")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java Result
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://restapi.ordergroove.com/entitlements/?external_resource_id=123456&grantee_external_ids_exact=grantee_a%2Cgrantee_b&merchant=339536244b7c11eb8d37ee71e0f3a639&merchant_user_id=23799452926316&resource_name=Piano+lesson&resource_public_id=ecb42bee71ff11efb72ef29e3ec3bb34&resource_public_ids=ecb42bee71ff11efb72ef29e3ec3bb34%2C3fa56741671444bdbcdf7b1554f67bee")
  .asString();
```

```php Result
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://restapi.ordergroove.com/entitlements/?external_resource_id=123456&grantee_external_ids_exact=grantee_a%2Cgrantee_b&merchant=339536244b7c11eb8d37ee71e0f3a639&merchant_user_id=23799452926316&resource_name=Piano+lesson&resource_public_id=ecb42bee71ff11efb72ef29e3ec3bb34&resource_public_ids=ecb42bee71ff11efb72ef29e3ec3bb34%2C3fa56741671444bdbcdf7b1554f67bee');

echo $response->getBody();
```

```csharp Result
using RestSharp;

var client = new RestClient("https://restapi.ordergroove.com/entitlements/?external_resource_id=123456&grantee_external_ids_exact=grantee_a%2Cgrantee_b&merchant=339536244b7c11eb8d37ee71e0f3a639&merchant_user_id=23799452926316&resource_name=Piano+lesson&resource_public_id=ecb42bee71ff11efb72ef29e3ec3bb34&resource_public_ids=ecb42bee71ff11efb72ef29e3ec3bb34%2C3fa56741671444bdbcdf7b1554f67bee");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Result
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://restapi.ordergroove.com/entitlements/?external_resource_id=123456&grantee_external_ids_exact=grantee_a%2Cgrantee_b&merchant=339536244b7c11eb8d37ee71e0f3a639&merchant_user_id=23799452926316&resource_name=Piano+lesson&resource_public_id=ecb42bee71ff11efb72ef29e3ec3bb34&resource_public_ids=ecb42bee71ff11efb72ef29e3ec3bb34%2C3fa56741671444bdbcdf7b1554f67bee")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```