Initialize subscription entitlements from plan
curl --request POST \
--url https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize \
--header 'Content-Type: application/json' \
--header 'x-admin-api-key: <x-admin-api-key>' \
--data '
{
"subscriptionId": "123e4567-e89b-12d3-a456-426614174000",
"planId": "123e4567-e89b-12d3-a456-426614174001"
}
'import requests
url = "https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize"
payload = {
"subscriptionId": "123e4567-e89b-12d3-a456-426614174000",
"planId": "123e4567-e89b-12d3-a456-426614174001"
}
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({
subscriptionId: '123e4567-e89b-12d3-a456-426614174000',
planId: '123e4567-e89b-12d3-a456-426614174001'
})
};
fetch('https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize', 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-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize",
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([
'subscriptionId' => '123e4567-e89b-12d3-a456-426614174000',
'planId' => '123e4567-e89b-12d3-a456-426614174001'
]),
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-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize"
payload := strings.NewReader("{\n \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"planId\": \"123e4567-e89b-12d3-a456-426614174001\"\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-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize")
.header("x-admin-api-key", "<x-admin-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"planId\": \"123e4567-e89b-12d3-a456-426614174001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize")
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 \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"planId\": \"123e4567-e89b-12d3-a456-426614174001\"\n}"
response = http.request(request)
puts response.read_bodySubscription Entitlements
Initialize subscription entitlements from plan
Creates entitlements for a subscription based on the plan configuration
POST
/
api
/
v1
/
sub-entitlement
/
initialize
Initialize subscription entitlements from plan
curl --request POST \
--url https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize \
--header 'Content-Type: application/json' \
--header 'x-admin-api-key: <x-admin-api-key>' \
--data '
{
"subscriptionId": "123e4567-e89b-12d3-a456-426614174000",
"planId": "123e4567-e89b-12d3-a456-426614174001"
}
'import requests
url = "https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize"
payload = {
"subscriptionId": "123e4567-e89b-12d3-a456-426614174000",
"planId": "123e4567-e89b-12d3-a456-426614174001"
}
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({
subscriptionId: '123e4567-e89b-12d3-a456-426614174000',
planId: '123e4567-e89b-12d3-a456-426614174001'
})
};
fetch('https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize', 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-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize",
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([
'subscriptionId' => '123e4567-e89b-12d3-a456-426614174000',
'planId' => '123e4567-e89b-12d3-a456-426614174001'
]),
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-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize"
payload := strings.NewReader("{\n \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"planId\": \"123e4567-e89b-12d3-a456-426614174001\"\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-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize")
.header("x-admin-api-key", "<x-admin-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"planId\": \"123e4567-e89b-12d3-a456-426614174001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/initialize")
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 \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"planId\": \"123e4567-e89b-12d3-a456-426614174001\"\n}"
response = http.request(request)
puts response.read_bodyHeaders
The API key to access the admin API
Body
application/json
Response
Entitlements initialized successfully
⌘I