Skip to main content
POST
/
v1
/
entitlements
/
get
get customer entitlements
curl --request POST \
  --url https://api.unprice.dev/v1/entitlements/get \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerId": "cus_1H7KQFLr7RepUyQBKdnvY",
  "projectId": "prj_1H7KQFLr7RepUyQBKdnvY"
}
'
[
  {
    "id": "<string>",
    "projectId": "<string>",
    "createdAtM": 123,
    "updatedAtM": 123,
    "customerId": "<string>",
    "featurePlanVersionId": "<string>",
    "subscriptionId": "<string>",
    "subscriptionPhaseId": "<string>",
    "subscriptionItemId": "<string>",
    "effectiveAt": 123,
    "expiresAt": 123,
    "overageStrategy": "none",
    "metadata": {},
    "featurePlanVersion": {
      "id": "<string>",
      "projectId": "<string>",
      "createdAtM": 123,
      "updatedAtM": 123,
      "planVersionId": "<string>",
      "type": "feature",
      "featureId": "<string>",
      "featureType": "flat",
      "unitOfMeasure": "<string>",
      "config": {
        "price": {
          "dinero": {
            "amount": 123,
            "currency": {
              "code": "<string>",
              "base": 123,
              "exponent": 123
            },
            "scale": 123
          },
          "displayAmount": "<string>"
        },
        "tiers": [
          {
            "unitPrice": {
              "dinero": {
                "amount": 123,
                "currency": {
                  "code": "<string>",
                  "base": 123,
                  "exponent": 123
                },
                "scale": 123
              },
              "displayAmount": "<string>"
            },
            "flatPrice": {
              "dinero": {
                "amount": 123,
                "currency": {
                  "code": "<string>",
                  "base": 123,
                  "exponent": 123
                },
                "scale": 123
              },
              "displayAmount": "<string>"
            },
            "firstUnit": 2,
            "lastUnit": 2,
            "label": "<string>"
          }
        ],
        "usageMode": "tier",
        "tierMode": "volume",
        "units": 2
      },
      "billingConfig": {
        "name": "<string>",
        "billingInterval": "month",
        "billingIntervalCount": 30,
        "billingAnchor": 16,
        "planType": "recurring"
      },
      "metadata": {
        "realtime": false,
        "notifyUsageThreshold": 95,
        "overageStrategy": "none",
        "blockCustomer": false,
        "hidden": false
      },
      "order": 123,
      "feature": {
        "id": "<string>",
        "projectId": "<string>",
        "createdAtM": 123,
        "updatedAtM": 123,
        "slug": "<string>",
        "code": 123,
        "unitOfMeasure": "<string>",
        "title": "<string>",
        "description": "<string>",
        "meterConfig": {
          "eventId": "<string>",
          "eventSlug": "<string>",
          "aggregationMethod": "sum",
          "aggregationField": "<string>",
          "filters": {},
          "groupBy": [
            "<string>"
          ],
          "windowSize": "MINUTE"
        }
      },
      "resetConfig": {
        "name": "<string>",
        "resetInterval": "month",
        "resetIntervalCount": 30,
        "resetAnchor": 16,
        "planType": "recurring"
      },
      "defaultQuantity": 1,
      "limit": 123,
      "meterConfig": {
        "eventId": "<string>",
        "eventSlug": "<string>",
        "aggregationMethod": "sum",
        "aggregationField": "<string>",
        "filters": {},
        "groupBy": [
          "<string>"
        ],
        "windowSize": "MINUTE"
      }
    },
    "grants": [
      {
        "id": "<string>",
        "projectId": "<string>",
        "createdAtM": 123,
        "updatedAtM": 123,
        "customerEntitlementId": "<string>",
        "type": "subscription",
        "priority": 123,
        "allowanceUnits": 1,
        "effectiveAt": 123,
        "expiresAt": 123,
        "metadata": {}
      }
    ],
    "subscriptionPhase": {
      "creditLinePolicy": "capped"
    }
  }
]

Documentation Index

Fetch the complete documentation index at: https://docs.unprice.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Body of the request

customerId
string
required

The customer ID

Example:

"cus_1H7KQFLr7RepUyQBKdnvY"

projectId
string

The project ID

Example:

"prj_1H7KQFLr7RepUyQBKdnvY"

Response

The result of the get customer entitlements

id
string
required
Maximum string length: 36
projectId
string
required
Maximum string length: 36
createdAtM
number
required
updatedAtM
number
required
customerId
string
required
Maximum string length: 36
featurePlanVersionId
string
required
Maximum string length: 36
subscriptionId
string | null
required
Maximum string length: 36
subscriptionPhaseId
string | null
required
Maximum string length: 36
subscriptionItemId
string | null
required
Maximum string length: 36
effectiveAt
number
required
expiresAt
number | null
required
overageStrategy
enum<string>
required
Available options:
none,
last-call,
always
metadata
object
required
featurePlanVersion
object
required
grants
object[]
subscriptionPhase
object