json
{
"PackageId": "PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db",
"ProductId": "PRID-d9e74d70-3ca8-40f3-a415",
"Price": "1.12",
"Monthly": false,
"Type": "Type 3"
}curl -X POST https://api.telegent.com/v1.0/packages/items/add \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"PackageId": "PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db",
"ProductId": "PRID-d9e74d70-3ca8-40f3-a415"
}'import requests
url = "https://api.telegent.com/v1.0/packages/items/add"
payload = {
"PackageId": "PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db",
"ProductId": "PRID-d9e74d70-3ca8-40f3-a415",
"Price": "1.12",
"Monthly": False,
"Type": "Type 3"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
PackageId: 'PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db',
ProductId: 'PRID-d9e74d70-3ca8-40f3-a415',
Price: '1.12',
Monthly: false,
Type: 'Type 3'
})
};
fetch('https://api.telegent.com/v1.0/packages/items/add', 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://api.telegent.com/v1.0/packages/items/add",
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([
'PackageId' => 'PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db',
'ProductId' => 'PRID-d9e74d70-3ca8-40f3-a415',
'Price' => '1.12',
'Monthly' => false,
'Type' => 'Type 3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.telegent.com/v1.0/packages/items/add"
payload := strings.NewReader("{\n \"PackageId\": \"PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db\",\n \"ProductId\": \"PRID-d9e74d70-3ca8-40f3-a415\",\n \"Price\": \"1.12\",\n \"Monthly\": false,\n \"Type\": \"Type 3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.telegent.com/v1.0/packages/items/add")
.header("Content-Type", "application/json")
.body("{\n \"PackageId\": \"PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db\",\n \"ProductId\": \"PRID-d9e74d70-3ca8-40f3-a415\",\n \"Price\": \"1.12\",\n \"Monthly\": false,\n \"Type\": \"Type 3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telegent.com/v1.0/packages/items/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"PackageId\": \"PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db\",\n \"ProductId\": \"PRID-d9e74d70-3ca8-40f3-a415\",\n \"Price\": \"1.12\",\n \"Monthly\": false,\n \"Type\": \"Type 3\"\n}"
response = http.request(request)
puts response.read_body{
"PackageItemId": "PIID-4efee842-16f0-4803-9780-8c3c30d19b74",
"PackageId": "PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db",
"Type": "Type 3",
"Price": 1.12,
"Monthly": false,
"Active": true
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}Packages
Add Package Item
Add a product to an existing package. Specify the package, product, price, and billing frequency for the item.
What this does: Returns the new package item ID and confirmation. Adding an item to a package makes that product available to all subscribers with an active subscription to this package.
Next steps:
- View all items in the package —
GET /v1.0/packages/items - Remove an item —
POST /v1.0/packages/items/delete
POST
/
v1.0
/
packages
/
items
/
add
json
{
"PackageId": "PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db",
"ProductId": "PRID-d9e74d70-3ca8-40f3-a415",
"Price": "1.12",
"Monthly": false,
"Type": "Type 3"
}curl -X POST https://api.telegent.com/v1.0/packages/items/add \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"PackageId": "PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db",
"ProductId": "PRID-d9e74d70-3ca8-40f3-a415"
}'import requests
url = "https://api.telegent.com/v1.0/packages/items/add"
payload = {
"PackageId": "PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db",
"ProductId": "PRID-d9e74d70-3ca8-40f3-a415",
"Price": "1.12",
"Monthly": False,
"Type": "Type 3"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
PackageId: 'PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db',
ProductId: 'PRID-d9e74d70-3ca8-40f3-a415',
Price: '1.12',
Monthly: false,
Type: 'Type 3'
})
};
fetch('https://api.telegent.com/v1.0/packages/items/add', 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://api.telegent.com/v1.0/packages/items/add",
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([
'PackageId' => 'PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db',
'ProductId' => 'PRID-d9e74d70-3ca8-40f3-a415',
'Price' => '1.12',
'Monthly' => false,
'Type' => 'Type 3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.telegent.com/v1.0/packages/items/add"
payload := strings.NewReader("{\n \"PackageId\": \"PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db\",\n \"ProductId\": \"PRID-d9e74d70-3ca8-40f3-a415\",\n \"Price\": \"1.12\",\n \"Monthly\": false,\n \"Type\": \"Type 3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.telegent.com/v1.0/packages/items/add")
.header("Content-Type", "application/json")
.body("{\n \"PackageId\": \"PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db\",\n \"ProductId\": \"PRID-d9e74d70-3ca8-40f3-a415\",\n \"Price\": \"1.12\",\n \"Monthly\": false,\n \"Type\": \"Type 3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telegent.com/v1.0/packages/items/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"PackageId\": \"PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db\",\n \"ProductId\": \"PRID-d9e74d70-3ca8-40f3-a415\",\n \"Price\": \"1.12\",\n \"Monthly\": false,\n \"Type\": \"Type 3\"\n}"
response = http.request(request)
puts response.read_body{
"PackageItemId": "PIID-4efee842-16f0-4803-9780-8c3c30d19b74",
"PackageId": "PID-9a8435dc-ca6e-4a98-b761-5e6dc04447db",
"Type": "Type 3",
"Price": 1.12,
"Monthly": false,
"Active": true
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}{
"StatusCode": 123,
"Message": "<string>"
}Body
application/json
Response
Add Package Item
The response is of type object.
⌘I