Entitlements API

await fetch("https://api.accend.now/v1/entitlements/check", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ACCEND_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID()
  },
  body: JSON.stringify({ customerId: "cus_123", productId: "prod_123" })
});

Endpoints

  • POST /v1/entitlements/check
  • GET /v1/customers/{customerId}/entitlements

POST /v1/entitlements/check

Scopes: write
{
  "customerId": "cus_abc123",
  "productId": "prod_abc123"
}
Response 200 (allowed)
{
  "data": {
    "allowed": true,
    "reason": "active"
  },
  "error": null,
  "success": true
}
Response 200 (denied)
{
  "data": {
    "allowed": false,
    "reason": "expired"
  },
  "error": null,
  "success": true
}
Reason values:
  • active
  • no_entitlement
  • expired
  • past_due
  • revoked

GET /v1/customers//entitlements

Scopes: read Response 200
{
  "data": {
    "items": [
      {
        "id": "ent_abc123",
        "productId": "prod_abc123",
        "status": "active",
        "source": "subscription",
        "startsAt": "2025-01-15T00:00:00Z",
        "endsAt": "2025-02-15T00:00:00Z"
      }
    ],
    "hasMore": false,
    "nextCursor": null
  },
  "error": null,
  "success": true
}