Zum Hauptinhalt springen
POST
/
subscription-items
/
{subscriptionItemId}
/
entitlements
cURL
curl -X POST \
 /subscription-items/{subscriptionItemId}/entitlements \
 --header "Content-Type: application/json" \
 --header "Authorization: Bearer <token>" \
 --data '{
    "feature": "https:\/\/example.com\/",
    "value": "",
    "validFrom": "",
    "validUntil": ""
}'
{
  "id": "<string>",
  "subscriptionItem": {
    "id": "01F9ZQZJZJQZJZJZJZJZJZJZJZ",
    "name": "Fitness M",
    "description": "Everything included",
    "furtherInformation": "Additional agreements: The contract includes a free drink flatrate.",
    "status": "active",
    "subscriptionId": "<string>"
  },
  "feature": {
    "id": "feature-1",
    "name": "number of users",
    "description": "This feature allows you to manage the number of users in your account.",
    "status": "active",
    "type": "switch",
    "config": [
      {
        "value": "<string>",
        "label": "<string>"
      }
    ],
    "unit": "<string>"
  },
  "value": "true",
  "validFrom": "2023-11-07T05:31:56Z",
  "validUntil": "2023-11-07T05:31:56Z",
  "active": true,
  "status": "active"
}

Autorisierungen

Authorization
string
header
erforderlich

Value for the Authorization header parameter.

Pfadparameter

subscriptionItemId
string
erforderlich

Entitlement identifier

Body

The new Entitlement resource

feature
string<iri-reference> | null
erforderlich

The feature which should be assigned. Must be in "active" state.

Beispiel:

"https://example.com/"

value
string | null
erforderlich

The value of the feature

validFrom
string<date-time> | null

The date from which the feature is valid

validUntil
string<date-time> | null

The date until which the feature is valid

Antwort

Entitlement resource created

Get all entitlements of a subscription

id
string
subscriptionItem
object
feature
object
value
string

The value of the entitlement. Can be a boolean (switch), a string (custom), a number (quantity) or a custom number (range).

Beispiel:

"true"

validFrom
string<date-time> | null

The date from which the entitlement is valid

validUntil
string<date-time> | null

The date until which the entitlement is valid

active
boolean

Whether the entitlement is currently active (computed based on validity dates and enabled state)

status
enum<string>

The status of the entitlement. Computed based on validity dates and enabled state.

Possible values:

  • active: Entitlement is enabled and currently within its validity period
  • pending: Entitlement is enabled but validFrom is in the future
  • disabled: Entitlement is manually disabled
  • expired: Entitlement validUntil date has passed
Verfügbare Optionen:
active,
pending,
disabled,
expired
Beispiel:

"active"