Commerce

Create an entitlement definition

Creates a catalog entitlement definition on a plan. The definition associates a product feature with the plan. Include featureNumber or feature_number. Numbered features can include quantity or limitValue. Enum features can include values.

A catalog entitlement definition is not a runtime entitlement grant. Runtime grants are created by the Z-EMS grant API when a subscription is created or a manual grant is issued.

post/commerce/plans/{id}/entitlements

Request

  • Base URL: https://rest.test.zuora.com
  • URL: https://rest.test.zuora.com/commerce/plans/{id}/entitlements
  • Auth: HTTP bearer

Path parameters

idstring required

Unique identifier of the plan.

Headers

Idempotency-Keystring

Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.

With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.

Accept-Encodingstring

Include the Accept-Encoding: gzip header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.

If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a Content-Encoding header with the compression algorithm so that your client can decompress it.

Content-Encodingstring

Include the Content-Encoding: gzip header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.

Zuora-Entity-Idsstring

An entity ID. If you have Zuora Multi-entity enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you should not set this header.

Zuora-Org-Idsstring

Comma separated IDs. If you have <a href="https://docs.zuora.com/en/zuora-platform/organization-and-entity-management/multi-org/overview-of-multi-org" target="_blank">Zuora Multi-Org</a> enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header.

The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. This header is important in Multi-Org (MO) setups because it defines the organization context under which the API should operate—mainly used for read access or data visibility filtering. If the header is not set, the operation is performed in scope of the user's accessible orgs.

Zuora-Track-Idstring

A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.

The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (:), semicolon (;), double quote ("), and quote (').

Zuora-Versionstring

The minor API version.

For a list of available minor versions, see API upgrades.

Request body

featureIdstring

Unique identifier of the catalog feature to include on the plan.

defaultQuantitynumber

Default quantity granted by this entitlement definition for a numbered feature.

product_rate_plan_idstring

Unique identifier of the plan that owns this entitlement definition.

feature_numberstring

Feature number of the catalog feature to include on the plan.

featureNumberstring

Camel-case form of feature_number.

startDatestring date

Date the entitlement definition becomes effective, in YYYY-MM-DD format.

endDatestring date

Date the entitlement definition ends, in YYYY-MM-DD format.

quantitynumber

Quantity granted by this entitlement definition for a numbered feature.

valuesstring[]

Permitted values for an enumType feature. Each value must be in the feature's allowed list.

chargeSourcestring

Charge source for the entitlement definition.

Common values include usage_charge and non_billable.

scopestring

Scope of the entitlement, for example subscription.

enforcementModestring

How entitlement overage is enforced.

Common values include soft_warn and none.

resetPolicystring

How metered usage resets, for example calendar_month.

alertThresholdsstring

Usage alert thresholds, typically a JSON array of percentages such as [75, 95].

limitSourcestring

Source of the entitlement limit.

Common values include static and charge.

limitValuenumber

Static limit applied when limitSource is static.

Example request

{
  "featureId": "572a2efe711b449e80cbef94419bc050",
  "defaultQuantity": 100,
  "product_rate_plan_id": "38660706ef2f48cfb5222f7dde491895",
  "feature_number": "FEAT-00000001",
  "featureNumber": "FEAT-00000001",
  "startDate": "2025-01-01",
  "endDate": "2099-12-31",
  "quantity": 5,
  "values": [
    "basic",
    "pro"
  ],
  "chargeSource": "non_billable",
  "scope": "subscription",
  "enforcementMode": "none",
  "resetPolicy": "calendar_month",
  "alertThresholds": "[75, 95]",
  "limitSource": "static",
  "limitValue": 1000
}

Response

OK

Example response

{
  "value": {
    "id": "ee2d1ce1036c4dd6ae9d6945565ff7a0",
    "entitlementNumber": "ENT-00000001",
    "featureId": "572a2efe711b449e80cbef94419bc050",
    "featureNumber": "FEAT-00000001",
    "feature_number": "FEAT-00000001",
    "defaultQuantity": 10000,
    "quantity": 5,
    "planId": "38660706ef2f48cfb5222f7dde491895",
    "productRatePlanChargeId": "fe9b0e764dca4178a11c0e471e5dc0d8",
    "product_rate_plan_charge_id": "fe9b0e764dca4178a11c0e471e5dc0d8",
    "chargeSource": "usage_charge",
    "charge_source": "usage_charge",
    "scope": "subscription",
    "enforcementMode": "soft_warn",
    "resetPolicy": "calendar_month",
    "reset_policy": "calendar_month",
    "alertThresholds": "[75, 95]",
    "limitSource": "charge",
    "limit_source": "charge",
    "limitValue": 1000,
    "values": [
      "basic",
      "pro"
    ],
    "entitlementBool": true,
    "entitlement_bool": true
  }
}

Changes

No operation changes recorded.