Home / API Reference / Packages
Resource
Packages
Session packages the account sells in package mode: a number of sessions for one price. Active and secret packages can be paid for; inactive ones are listed but cannot be; deleted ones are not returned.
The package object
Every package record carries these fields in this order, after object, which is always "package".
| Field | Type | Description |
|---|---|---|
id | integer | |
package_name | string, up to 255 characters | |
package_desc | text | |
package_sessions | integer | The number of sessions the package buys. Each purchase adds them to the client's remaining package sessions. |
package_cost | decimal | The price of the whole package, in the account currency. |
package_status | string, up to 10 characters | "active" (sold online and in the app), "secret" (in the app only) or "inactive" (not sold). A payment can name an active or secret package. |
Example
{
"object": "package",
"id": 42,
"package_name": "Example name",
"package_desc": "text",
"package_sessions": 1,
"package_cost": 25.5,
"package_status": "text"
} List packages
GET /api/v1/packages
Parameters
| Parameter | In | Description |
|---|---|---|
limit | query | Records per page, 1 to 1000 (default 100). |
offset | query | Records to skip (default 0). |
Returns
A list envelope of package records (see Pagination).
Request
curl "https://www.bizstim.com/api/v1/packages" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Accept: application/json"<?php
$ch = curl_init('https://www.bizstim.com/api/v1/packages');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-KEY: YOUR_API_KEY', 'Accept: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);const response = await fetch('https://www.bizstim.com/api/v1/packages', {
headers: { 'X-API-KEY': 'YOUR_API_KEY', 'Accept': 'application/json' }
});
const data = await response.json();Response
{
"object": "list",
"total": 2,
"limit": 100,
"offset": 0,
"has_more": false,
"data": [
{
"object": "package",
"id": 42,
"package_name": "Example name",
"package_desc": "text",
"package_sessions": 1,
"package_cost": 25.5,
"package_status": "text"
},
{
"object": "package",
"id": 43,
"package_name": "Example name",
"package_desc": "text",
"package_sessions": 1,
"package_cost": 25.5,
"package_status": "text"
}
]
} Retrieve a package
GET /api/v1/packages/{id}
Parameters
| Parameter | In | Description |
|---|---|---|
id | path | The record's id. |
Returns
One package record, or 404 not_found when no record with that id exists on your account.
Request
curl "https://www.bizstim.com/api/v1/packages/42" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Accept: application/json"<?php
$ch = curl_init('https://www.bizstim.com/api/v1/packages/42');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-KEY: YOUR_API_KEY', 'Accept: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);const response = await fetch('https://www.bizstim.com/api/v1/packages/42', {
headers: { 'X-API-KEY': 'YOUR_API_KEY', 'Accept': 'application/json' }
});
const data = await response.json();Response
{
"object": "package",
"id": 42,
"package_name": "Example name",
"package_desc": "text",
"package_sessions": 1,
"package_cost": 25.5,
"package_status": "text"
}