OpenMeter Entitlements

Create customer entitlement

Changed on

Create an entitlement for the customer.

A customer can have only one active entitlement per feature. The feature must be compatible with the entitlement type. Entitlements cannot be modified after creation, only deleted.

post/openmeter/customers/{customerId}/entitlements

Request

  • Base URL: http://localhost:8888/api/v3
  • URL: http://localhost:8888/api/v3/openmeter/customers/{customerId}/entitlements
  • Auth: none declared

Path parameters

customerIdstring required

ULID (Universally Unique Lexicographically Sortable Identifier).

Example:01G65Z755AFWAKHE12NY0CQ9FH

Request body

OR
OR

Example request

{
  "feature": {
    "id": "01G65Z755AFWAKHE12NY0CQ9FH"
  },
  "labels": {
    "env": "test"
  },
  "usage_period": {
    "interval": "P1Y",
    "anchor": "2023-01-01T01:01:01.001Z"
  },
  "measure_usage_from": "2023-01-01T01:01:01.001Z",
  "grants": [
    {
      "priority": 1,
      "effective_at": "2023-01-01T01:01:01.001Z",
      "expires_after": "P1Y",
      "labels": {
        "env": "test"
      },
      "recurrence": {
        "interval": "P1Y",
        "anchor": "2023-01-01T01:01:01.001Z"
      }
    }
  ]
}

Response

Entitlement created response.

OR
OR

Example response

{
  "id": "01G65Z755AFWAKHE12NY0CQ9FH",
  "feature": {
    "id": "01G65Z755AFWAKHE12NY0CQ9FH"
  },
  "customer": {
    "id": "01G65Z755AFWAKHE12NY0CQ9FH"
  },
  "labels": {
    "env": "test"
  },
  "active_from": "2023-01-01T01:01:01.001Z",
  "active_to": "2023-01-01T01:01:01.001Z",
  "created_at": "2023-01-01T01:01:01.001Z",
  "updated_at": "2023-01-01T01:01:01.001Z",
  "deleted_at": "2023-01-01T01:01:01.001Z",
  "usage_period": {
    "anchor": "2023-01-01T01:01:01.001Z",
    "interval": "P1Y"
  },
  "current_usage_period": {
    "from": "2023-01-01T01:01:01.001Z",
    "to": "2023-01-01T01:01:01.001Z"
  },
  "measure_usage_from": "2023-01-01T01:01:01.001Z",
  "last_reset": "2023-01-01T01:01:01.001Z"
}

Changes