Skip to main content
POST
/
companies
/
{company_id}
/
entitlements
Create Entitlement
curl --request POST \
  --url https://api.maplebilling.com/api/v1/companies/{company_id}/entitlements \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "aggregator_type": "OR",
  "key": "<string>",
  "name": "<string>",
  "possible_values": [
    "<string>"
  ],
  "type": "BOOL"
}'
{
  "aggregator_type": "<string>",
  "id": "<string>",
  "key": "<string>",
  "name": "<string>",
  "possible_values": [
    "<string>"
  ],
  "type": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string

The idempotency key that will be used to ensure the request is only performed once

Path Parameters

company_id
string
required

The company ID with the prefix 'cmp_'.

Body

application/json
aggregator_type
enum<string>
required

The aggregator type of the entitlement in case a customer has different values for different subscriptions. This can be one of OR, AND (for BOOL), ADD, MINIMUM, MAXIMUM (for NUMBER), COALESCE (for TEXT or ENUM)

Available options:
OR,
AND,
ADD,
MINIMUM,
MAXIMUM,
COALESCE
key
string
required

A unique key for the entitlement without spaces, unicode or special characters eg. test-feature-1

name
string
required

The name of the entitlement

type
enum<string>
required

The type of the entitlement that can be one of boolean, text, number or an enum.

Available options:
BOOL,
NUMBER,
TEXT,
ENUM
possible_values
string[]

The possible values for the entitlement of enum type

Response

201 - application/json

Created

aggregator_type
string

The aggregator type of the entitlement

id
string

The ID of the entitlement

key
string

The key of the entitlement

name
string

The name of the entitlement

possible_values
string[]

The possible values of the entitlement if the type is ENUM

type
string

The type of the entitlement that can be BOOL, TEXT, NUMBER or ENUM

I