Add an entitlement to a plan
curl --request POST \
--url https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement \
--header 'Content-Type: application/json' \
--header 'x-admin-api-key: <x-admin-api-key>' \
--data '
{
"planAndEntitlementQuotas": [
{
"planCode": "specter_starter_monthly",
"name": "Document Review",
"code": "SPECTER_DOCUMENT_REVIEW",
"description": "Document Review",
"isReportable": true,
"quota": 1000
}
]
}
'import requests
url = "https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement"
payload = { "planAndEntitlementQuotas": [
{
"planCode": "specter_starter_monthly",
"name": "Document Review",
"code": "SPECTER_DOCUMENT_REVIEW",
"description": "Document Review",
"isReportable": True,
"quota": 1000
}
] }
headers = {
"x-admin-api-key": "<x-admin-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-admin-api-key': '<x-admin-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
planAndEntitlementQuotas: [
{
planCode: 'specter_starter_monthly',
name: 'Document Review',
code: 'SPECTER_DOCUMENT_REVIEW',
description: 'Document Review',
isReportable: true,
quota: 1000
}
]
})
};
fetch('https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'planAndEntitlementQuotas' => [
[
'planCode' => 'specter_starter_monthly',
'name' => 'Document Review',
'code' => 'SPECTER_DOCUMENT_REVIEW',
'description' => 'Document Review',
'isReportable' => true,
'quota' => 1000
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-admin-api-key: <x-admin-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement"
payload := strings.NewReader("{\n \"planAndEntitlementQuotas\": [\n {\n \"planCode\": \"specter_starter_monthly\",\n \"name\": \"Document Review\",\n \"code\": \"SPECTER_DOCUMENT_REVIEW\",\n \"description\": \"Document Review\",\n \"isReportable\": true,\n \"quota\": 1000\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-admin-api-key", "<x-admin-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement")
.header("x-admin-api-key", "<x-admin-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"planAndEntitlementQuotas\": [\n {\n \"planCode\": \"specter_starter_monthly\",\n \"name\": \"Document Review\",\n \"code\": \"SPECTER_DOCUMENT_REVIEW\",\n \"description\": \"Document Review\",\n \"isReportable\": true,\n \"quota\": 1000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-admin-api-key"] = '<x-admin-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"planAndEntitlementQuotas\": [\n {\n \"planCode\": \"specter_starter_monthly\",\n \"name\": \"Document Review\",\n \"code\": \"SPECTER_DOCUMENT_REVIEW\",\n \"description\": \"Document Review\",\n \"isReportable\": true,\n \"quota\": 1000\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"planCode": "specter_starter_monthly",
"name": "Document Review",
"code": "SPECTER_DOCUMENT_REVIEW",
"description": "Document Review",
"isReportable": true,
"quota": 1000
}
]Plans
Add an entitlement to a plan
Add an entitlement to a plan with the provided details. Note: This endpoint is restricted for internal use only.
POST
/
api
/
v1
/
plans
/
entitlement
Add an entitlement to a plan
curl --request POST \
--url https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement \
--header 'Content-Type: application/json' \
--header 'x-admin-api-key: <x-admin-api-key>' \
--data '
{
"planAndEntitlementQuotas": [
{
"planCode": "specter_starter_monthly",
"name": "Document Review",
"code": "SPECTER_DOCUMENT_REVIEW",
"description": "Document Review",
"isReportable": true,
"quota": 1000
}
]
}
'import requests
url = "https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement"
payload = { "planAndEntitlementQuotas": [
{
"planCode": "specter_starter_monthly",
"name": "Document Review",
"code": "SPECTER_DOCUMENT_REVIEW",
"description": "Document Review",
"isReportable": True,
"quota": 1000
}
] }
headers = {
"x-admin-api-key": "<x-admin-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-admin-api-key': '<x-admin-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
planAndEntitlementQuotas: [
{
planCode: 'specter_starter_monthly',
name: 'Document Review',
code: 'SPECTER_DOCUMENT_REVIEW',
description: 'Document Review',
isReportable: true,
quota: 1000
}
]
})
};
fetch('https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'planAndEntitlementQuotas' => [
[
'planCode' => 'specter_starter_monthly',
'name' => 'Document Review',
'code' => 'SPECTER_DOCUMENT_REVIEW',
'description' => 'Document Review',
'isReportable' => true,
'quota' => 1000
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-admin-api-key: <x-admin-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement"
payload := strings.NewReader("{\n \"planAndEntitlementQuotas\": [\n {\n \"planCode\": \"specter_starter_monthly\",\n \"name\": \"Document Review\",\n \"code\": \"SPECTER_DOCUMENT_REVIEW\",\n \"description\": \"Document Review\",\n \"isReportable\": true,\n \"quota\": 1000\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-admin-api-key", "<x-admin-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement")
.header("x-admin-api-key", "<x-admin-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"planAndEntitlementQuotas\": [\n {\n \"planCode\": \"specter_starter_monthly\",\n \"name\": \"Document Review\",\n \"code\": \"SPECTER_DOCUMENT_REVIEW\",\n \"description\": \"Document Review\",\n \"isReportable\": true,\n \"quota\": 1000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-billing-api.iqraa.ai/api/v1/api/v1/plans/entitlement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-admin-api-key"] = '<x-admin-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"planAndEntitlementQuotas\": [\n {\n \"planCode\": \"specter_starter_monthly\",\n \"name\": \"Document Review\",\n \"code\": \"SPECTER_DOCUMENT_REVIEW\",\n \"description\": \"Document Review\",\n \"isReportable\": true,\n \"quota\": 1000\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"planCode": "specter_starter_monthly",
"name": "Document Review",
"code": "SPECTER_DOCUMENT_REVIEW",
"description": "Document Review",
"isReportable": true,
"quota": 1000
}
]Headers
The API key to access the admin API
Body
application/json
The list of plans and entitlements to add
Show child attributes
Show child attributes
Response
The entitlement has been successfully added to the plan
The Code of the plan
Example:
"specter_starter_monthly"
The name of the entitlement
Example:
"Document Review"
The code of the entitlement
Example:
"SPECTER_DOCUMENT_REVIEW"
The description of the entitlement
Example:
"Document Review"
Whether the entitlement is reportable
Example:
true
The quota for the entitlement
Example:
1000
⌘I