Skip to main content
GET
/
v1
/
entitlements
/
{entitlementId}
Get Entitlement
curl --request GET \
  --url https://api.paygentic.io/v1/entitlements/{entitlementId} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.paygentic.io/v1/entitlements/{entitlementId}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.paygentic.io/v1/entitlements/{entitlementId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paygentic.io/v1/entitlements/{entitlementId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api.paygentic.io/v1/entitlements/{entitlementId}"

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

req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.paygentic.io/v1/entitlements/{entitlementId}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.paygentic.io/v1/entitlements/{entitlementId}")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "object": "entitlement",
  "id": "ent_a7b8c9d0e1f2g3h4",
  "customerId": "cus_x1y2z3a4b5c6d7e8",
  "featureId": "feat_p1q2r3s4t5u6v7w8",
  "featureKey": "sso_enabled",
  "featureType": "boolean",
  "productId": "prod_m5n6o7p8q9r0s1t2",
  "subscriptionId": "sub_m1n2o3p4q5r6s7t8",
  "status": "active",
  "hasAccess": true,
  "activeFrom": "2024-01-01T00:00:00Z",
  "activeTo": null,
  "config": null,
  "metadata": {}
}

Authorizations

Authorization
string
header
required

API key authentication

Path Parameters

entitlementId
string
required

The unique identifier of the entitlement

Pattern: ^ent_[a-zA-Z0-9]+$

Query Parameters

at
string<date-time>

Evaluate balance and access at this point in time (RFC 3339 datetime with any UTC offset, e.g. 2024-01-15T10:30:00Z or 2024-01-15T15:30:00+05:30). Defaults to current time.

Response

Successfully retrieved the entitlement.

A specific entitlement. The response shape varies by featureType.

object
enum<string>
default:entitlement
required
Available options:
entitlement
id
string
required

Unique identifier for the entitlement.

Pattern: ^ent_[a-zA-Z0-9]+$
customerId
string
required

Unique identifier for a customer

Pattern: ^cus_[a-zA-Z0-9]+$
featureId
string
required

The feature this entitlement grants access to.

Pattern: ^feat_[a-zA-Z0-9]+$
featureKey
string
required

The unique key identifying the feature.

featureType
enum<string>
required

The type of feature.

Available options:
boolean
productId
string
required

Unique identifier for a product

Pattern: ^prod_[a-zA-Z0-9]+$
subscriptionId
string | null
required

The subscription this entitlement is associated with, if any.

status
enum<string>
required

Current status of the entitlement.

Available options:
active,
canceled,
expired
activeFrom
string<date-time>
required

When the entitlement becomes active.

activeTo
string<date-time> | null
required

When the entitlement expires. Null means no expiration.

hasAccess
boolean
required

Whether the customer currently has active access to this entitlement.

metadata
object
required

Additional metadata for the entitlement.

config
object | null
required

Always null for boolean entitlements. Surfaced on every entitlement so clients can read config without first switching on featureType.