Skip to main content
Skip table of contents

Adding an entitlement to an account

Request

To add an entitlement to an account, send a POST request to:

CODE
https://<host>:<port>/crm-gateway/v1/rmg/v1/entitlements

Headers

  • x-correlation-id  – identifier for logging, to correlate messages across a call flow
  • Authorization – Keycloak access token (see Accessing operator APIs using Keycloak)
  • Content-Type: application/json

Mandatory arguments

All of the following arguments are in the request body:

  • productId – the ID of the product for which the entitlement is being added
  • accountId – the ID of the account for which the entitlement is being added
  • validityType – the entitlement type (ABSOLUTE or RELATIVE)
  • productType – the product type (TRANSACTIONAL, SUBSCRIPTION, FREE, CAPABILITY, or PPV)
  • validFrom – the entitlement validity start date/time in ISO 8601 format
  • expiryDate – the entitlement validity end date/time in ISO 8601 format

Other arguments

  • prohibitDuplicateProductPurchase (in query) – if set to true, duplicate products with overlapping validity dates cannot be purchased, unless the existing entitlement is for a specific device. Default: false.

  • capabilityType (on body) – the type of capability. (Note that this argument is only mandatory when productType is CAPABILITY.)
  • deviceId (in body) – the ID of the device for which the entitlement is being added.

    If device-specific products are enabled:

    • If you specify a device ID, the entitlement applies for the specified device only.
    • If no device ID is specified, the entitlement is added at the account level.

    If device-specific products are not enabled, all entitlements apply at the account level, and the products that they apply to can be consumed on any off the account's devices.

    For details of how to enable or disable device-specific products, see Device specific products.

See the CRM Gateway API documentation for the full list of additional arguments.

Example

A POST request with this payload adds a capability entitlement for Netflix to the specified account:

CODE
{
  "productId": "product1234",
  "accountId": "account1234",
  "validityType": "ABSOLUTE",
  "productType": "CAPABILITY",
  "validFrom": "2022-04-26T11:01:46.082Z",
  "expiryDate": "2023-04-26T11:01:46.082Z",
  "capabilityType": "NETFLIX"
}

Response

A successful request returns an HTTP 201 status.

A bad request returns an HTTP 400 status.

A forbidden request returns an HTTP 403 status.

If the specified tenant does not exist, the request returns an HTTP 404 status.

See the CRM Gateway API documentation for the specific error codes and their meanings.

Example

CODE
{
  "_id": "abc1234"
}

Here, _id is the ID of the newly-created entitlement.

See also

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.