Catalog
Choose public lists to display active Pricings, member plans to describe an existing membership, or detail reads for a known ID. Business terms and selection guide explain plan, Pricing, membership and resource. Detail visibility differs from list visibility.
Catalog context
Use the API base and resource public key already supplied for the integration. Credentials distinguish guest, member and Firebase-enabled member requests. The local request table specifies the exact context; public lists, known-record details, member plans and team plans have different selection rules.
Shared context errors apply where those checks run. A catalog result is neither a membership nor a content permission. Examples use synthetic inputs and sample runtimes.
Operations
| Operation | Method / path |
|---|---|
| List the user’s plans | GET /api/v1/user/plans |
| List available team plans | GET /api/v1/user/teams/{team_id}/plans |
| Read the embedded integration catalog | GET /api/v1/integrations/plans |
| List public plans | GET /api/v1/plans |
| Get a plan | GET /api/v1/plans/{id} |
| List public Pricings | GET /api/v1/subscriptions |
| Get a Pricing | GET /api/v1/subscriptions/{id} |
List the user’s plans
GET /api/v1/user/plans
List distinct plans attached to this user through subscription membership in the selected resource. This is the member’s catalog, not the public Pricing list. The selection does not add an active/private plan filter.
Before you call
Use an existing member token. A matching membership must exist to produce an item; obtaining a Pricing ID alone is not enough. See catalog context for supplied configuration and shared checks.
Request
GET with no request body or request Content-Type requirement. Response media type is JSON. Requires the user role or inherited permission and active member context. See credential transport.
| Name | Location | Type | Requirement / default | Meaning and constraint |
|---|---|---|---|---|
resource | header | string | required context | Public resource key; not the secret. |
token | header | string | member context | Existing member-session token. |
firebase-token | header | string | Firebase-enabled member context | Configured Firebase ID token alongside the Wallkit token. |
page | query | integer | optional | Use 1 for the first page; pass it explicitly. No explicit omitted-page default in the operation. |
limit | query | integer | optional | Default 10. No universal maximum is specified. |
filter | query | object / JSON string | optional | Model-field filters; bracket notation or JSON string. Text fields use case-insensitive substring matching; numeric arrays use membership. |
order / by | query | string | optional | order takes precedence over by; default indicated below. |
sort | query | string | optional | Default DESC; use ASC or DESC. |
Filters span Plans, Subscriptions and UserPlanRelationships. Sorting defaults to Plans.created_at DESC; order overrides by. Only one membership is serialized per plan even if several matching relationships exist.
Result
HTTP 200 JSON.
| Field / projection | Type / presence | Meaning |
|---|---|---|
items[] | plan with singular membership | Use the field definitions and field definitions. Only one membership is represented per plan. |
paginator uses the collection fields. An empty collection is an ordinary result; do not interpret it as an authentication failure.
Example: list the user’s plans
A reader already has the Monthly membership on Reader plan. The relationship expiration and renewal choice explain their account state. Supply the sample configuration and runtimes. These three requests are equivalent.
cURL
curl "${WALLKIT_API_BASE}/api/v1/user/plans?page=1&limit=10" \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${USER_TOKEN}"
JavaScript
// Node.js 18+; built-in fetch. Supply existing integration configuration.
async function main() {
const url = new URL("/api/v1/user/plans", process.env.WALLKIT_API_BASE);
url.searchParams.set("page", "1");
url.searchParams.set("limit", "10");
const headers = { resource: process.env.RESOURCE_KEY, token: process.env.USER_TOKEN };
const response = await fetch(url, { method: "GET", headers });
const body = await response.json();
console.log(response.status, body);
}
main().catch(console.error);
Python
# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen
url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/user/plans")
url += "?" + urlencode({'page': '1', 'limit': '10'})
headers = {"resource": os.environ["RESOURCE_KEY"], "token": os.environ["USER_TOKEN"]}
request = Request(url, headers=headers, method="GET")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 response excerpt:
{
"items": [
{
"id": 1001,
"title": "Reader plan",
"slug": "reader",
"active": true,
"private": false,
"subscription": {
"id": 2001,
"title": "Monthly",
"price": 1200,
"currency": "USD",
"period": "1 month",
"subscription_end_date": "2026-12-01 00:00:00",
"autorenew": true,
"is_team_subscription": false
}
}
]
}
Alternate result
No matching records on this page. Show an empty state; review the member/resource context or filters if unexpected. Do not treat an empty list as permission or as an API error.
Response excerpt:
{
"items": []
}
Recovery
| HTTP status | API code / response | Cause | Next action |
|---|---|---|---|
| 401 | auth_failed | Required identity is missing. | Supply the existing member token and check its selected resource context. |
| 401 | auth_access_fail | Inactive account or locked/suspended resource relationship. | Ask the administrator to check account activation and the resource relationship’s lock/suspension state. |
| 401 / 403 | access | Role does not permit the operation. | Use an identity permitted for this action; ask the administrator to check the assigned role. |
| 404 | resource_not_exists | Required resource is missing or unknown. | Check the resource public key and selected integration context with the administrator. |
See catalog context for applicable shared checks; follow the local error table above.
Next task
Read Pricing definitions to distinguish the member’s relationship dates from available purchase Pricings.
List available team plans
GET /api/v1/user/teams/{team_id}/plans
Find child plans reachable from this user’s plan relationships for team subscriptions. The team ID must exist; the selection itself is based on user-plan relationships, not a team-specific membership filter. Parent and child plans must be active, and child plans cannot themselves own teams.
Before you call
Use an existing member token and team ID from your integration’s team record. The team must exist. Selection follows the user’s linked plans; it does not prove ownership of that team or restrict the selection by the supplied team ID. See catalog context for supplied configuration and shared checks.
Request
GET with no request body or request Content-Type requirement. Response media type is JSON. Requires the user role or inherited permission and active member context. See credential transport.
| Name | Location | Type | Requirement / default | Meaning and constraint |
|---|---|---|---|---|
resource | header | string | required context | Public resource key; not the secret. |
token | header | string | member context | Existing member-session token. |
firebase-token | header | string | Firebase-enabled member context | Configured Firebase ID token alongside the Wallkit token. |
team_id | path | decimal digits | yes | Existing team ID; route accepts one or more digits. |
page | query | integer | optional | Use 1 for the first page; pass it explicitly. No explicit omitted-page default in the operation. |
limit | query | integer | optional | Default 10. No universal maximum is specified. |
filter | query | bracket object | optional | Plan/subscription model-field filters, e.g. filter[Plans.id]. No JSON-string filter recipe here. |
No explicit sorting option or team ownership validation is added by this operation. Do not use this list as proof that the caller owns the given team.
Result
HTTP 200 JSON.
| Field / projection | Type / presence | Meaning |
|---|---|---|
items[] | plan with subscriptions array | Use the field definitions and team branch of field definitions; Pricings add users_limit. |
paginator uses the collection fields. An empty collection is an ordinary result; do not interpret it as an authentication failure.
Example: list available team plans
Team 3001 exists and this member has a linked eligible plan. The returned Pricing has a five-user limit; the result does not prove team ownership. Supply the sample configuration and runtimes. These three requests are equivalent.
cURL
curl "${WALLKIT_API_BASE}/api/v1/user/teams/3001/plans?page=1&limit=10" \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${USER_TOKEN}"
JavaScript
// Node.js 18+; built-in fetch. Supply existing integration configuration.
async function main() {
const url = new URL("/api/v1/user/teams/3001/plans", process.env.WALLKIT_API_BASE);
url.searchParams.set("page", "1");
url.searchParams.set("limit", "10");
const headers = { resource: process.env.RESOURCE_KEY, token: process.env.USER_TOKEN };
const response = await fetch(url, { method: "GET", headers });
const body = await response.json();
console.log(response.status, body);
}
main().catch(console.error);
Python
# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen
url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/user/teams/3001/plans")
url += "?" + urlencode({'page': '1', 'limit': '10'})
headers = {"resource": os.environ["RESOURCE_KEY"], "token": os.environ["USER_TOKEN"]}
request = Request(url, headers=headers, method="GET")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 response excerpt:
{
"items": [
{
"id": 1001,
"title": "Reader plan",
"slug": "reader",
"active": true,
"private": false,
"subscriptions": [
{
"id": 2001,
"title": "Monthly",
"price": 1200,
"currency": "USD",
"period": "1 month",
"users_limit": 5
}
]
}
]
}
Alternate result
No matching records on this page. Show an empty state; review the member/resource context or filters if unexpected. Do not treat an empty list as permission or as an API error.
Response excerpt:
{
"items": []
}
Recovery
| HTTP status | API code / response | Cause | Next action |
|---|---|---|---|
| 401 | auth_failed | Required identity is missing. | Supply the existing member token and check its selected resource context. |
| 401 | auth_access_fail | Inactive account or locked/suspended resource relationship. | Ask the administrator to check account activation and the resource relationship’s lock/suspension state. |
| 401 / 403 | access | Role does not permit the operation. | Use an identity permitted for this action; ask the administrator to check the assigned role. |
| 404 | resource_not_exists | Required resource is missing or unknown. | Check the resource public key and selected integration context with the administrator. |
| 404 | team_not_found | The team ID does not exist. | Check the team ID against the integration’s existing team record. |
See catalog context for applicable shared checks; follow the local error table above.
Next task
Read a selected Pricing to show its terms; keep team ownership checks separate in your integration.
Read the embedded integration catalog
GET /api/v1/integrations/plans
Load the resource-scoped plan/subscription catalog used by embedded integrations. Prefer the public plan list when you need its explicit active/private visibility rules.
Before you call
Use the resource public key supplied for the embedded integration. No member token is required. Missing resource context is not rejected, but cannot produce a useful catalog. See catalog context for supplied configuration and shared checks.
Request
GET with no request body or request Content-Type requirement. Response media type is JSON. Permits guest access with the context described above. See credential transport.
| Name | Location | Type | Requirement / default | Meaning and constraint |
|---|---|---|---|---|
resource | header | string | supply for integration/session context | Public resource key; not the secret. |
Supply resource for useful results, although this operation does not reject missing resource context. Results are grouped by plan and ordered by plan title ascending. No pagination, filter or sort parameters are read. Active-only selection is not guaranteed for this legacy selector.
Result
HTTP 200 JSON.
| Field / projection | Type / presence | Meaning |
|---|---|---|
items[] | plan with subscriptions array | Use the field definitions and unfiltered integration branch of field definitions. |
No pagination. Missing resource context returns items: []; a resolved resource with no plans can leave items absent. Handle both, rather than assuming one fixed empty shape.
Example: read the embedded integration catalog
The embedded integration loads Reader plan and its configured Monthly Pricing. This legacy selector does not provide the public list’s visibility guarantee. Supply the sample configuration and runtimes. These three requests are equivalent.
cURL
curl "${WALLKIT_API_BASE}/api/v1/integrations/plans" \
-H "resource: ${RESOURCE_KEY}"
JavaScript
// Node.js 18+; built-in fetch. Supply existing integration configuration.
async function main() {
const url = new URL("/api/v1/integrations/plans", process.env.WALLKIT_API_BASE);
const headers = { resource: process.env.RESOURCE_KEY };
const response = await fetch(url, { method: "GET", headers });
const body = await response.json();
console.log(response.status, body);
}
main().catch(console.error);
Python
# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen
url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/integrations/plans")
headers = {"resource": os.environ["RESOURCE_KEY"]}
request = Request(url, headers=headers, method="GET")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 response excerpt:
{
"items": [
{
"id": 1001,
"title": "Reader plan",
"slug": "reader",
"active": true,
"private": false,
"subscriptions": [
{
"id": 2001,
"title": "Monthly",
"price": 1200,
"currency": "USD",
"period": "1 month"
}
]
}
]
}
Alternate result
Missing resource context can return an empty list. Supply the integration’s resource key; with a resolved resource and no matching plans, items may instead be absent.
Response excerpt:
{
"items": []
}
Recovery
No operation-specific named error is established for this read. Apply the common identity/configuration recovery only where its shared checks apply.
See catalog context for applicable shared checks; follow the local error table above.
Next task
Use the public plan list when building a public Pricing chooser that needs active/public visibility rules.
List public plans
GET /api/v1/plans
List active, non-private plans in the selected resource that have active, non-private subscriptions. A validated invite may include its private subscription and associated private plan.
Before you call
Use the resource public key supplied for your integration. No member token is required. Have an invite code only when your integration already supplies one; these docs do not issue invites. See catalog context for supplied configuration and shared checks.
Request
GET with no request body or request Content-Type requirement. Response media type is JSON. Permits guest access with the context described above. See credential transport.
| Name | Location | Type | Requirement / default | Meaning and constraint |
|---|---|---|---|---|
resource | header | string | required context | Public resource key; not the secret. |
page | query | integer | optional | Use 1 for the first page; pass it explicitly. No explicit omitted-page default in the operation. |
limit | query | integer | optional | Default 10. No universal maximum is specified. |
filter | query | object / JSON string | optional | Criteria-style fields on Plans, such as filter[Plans.id]. |
by | query | string | optional | Default Plans.id. |
sort | query | string | optional | Default DESC. |
invite | query | string | optional | Invite code; valid codes may widen private visibility. Invalid codes are not guaranteed a rejection response. |
Result
HTTP 200 JSON.
| Field / projection | Type / presence | Meaning |
|---|---|---|
items[] | plan with subscriptions array | Use the field definitions and public-list branch of field definitions. |
paginator uses the collection fields. An empty collection is an ordinary result; do not interpret it as an authentication failure.
Example: list public plans
Show an active public Reader plan and its Monthly Pricing on the first page. Supply the sample configuration and runtimes. These three requests are equivalent.
cURL
curl "${WALLKIT_API_BASE}/api/v1/plans?page=1&limit=10" \
-H "resource: ${RESOURCE_KEY}"
JavaScript
// Node.js 18+; built-in fetch. Supply existing integration configuration.
async function main() {
const url = new URL("/api/v1/plans", process.env.WALLKIT_API_BASE);
url.searchParams.set("page", "1");
url.searchParams.set("limit", "10");
const headers = { resource: process.env.RESOURCE_KEY };
const response = await fetch(url, { method: "GET", headers });
const body = await response.json();
console.log(response.status, body);
}
main().catch(console.error);
Python
# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen
url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/plans")
url += "?" + urlencode({'page': '1', 'limit': '10'})
headers = {"resource": os.environ["RESOURCE_KEY"]}
request = Request(url, headers=headers, method="GET")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 response excerpt:
{
"items": [
{
"id": 1001,
"title": "Reader plan",
"slug": "reader",
"active": true,
"private": false,
"subscriptions": [
{
"id": 2001,
"title": "Monthly",
"price": 1200,
"currency": "USD",
"period": "1 month"
}
]
}
],
"paginator": {
"current_page": 1,
"page": 1,
"total_pages": 1,
"total_items": 1,
"limit": 10
}
}
Alternate result
No matching records on this page. Show an empty state; review the member/resource context or filters if unexpected. Do not treat an empty list as permission or as an API error.
Response excerpt:
{
"items": []
}
Recovery
| HTTP status | API code / response | Cause | Next action |
|---|---|---|---|
| 404 | resource_not_exists | Required resource is missing or unknown. | Check the resource public key and selected integration context with the administrator. |
See catalog context for applicable shared checks; follow the local error table above.
Next task
Read a selected plan to show its details while preserving the list’s selection policy.
Get a plan
GET /api/v1/plans/{id}
Read a known plan in the selected resource. Unlike the list, this lookup does not require the plan or its subscriptions to be active/non-private.
Before you call
Take the plan ID from the plan list or an existing integration record. It must belong to the selected resource. A private/inactive detail record is not proof of purchase eligibility. See catalog context for supplied configuration and shared checks.
Request
GET with no request body or request Content-Type requirement. Response media type is JSON. Permits guest access with the context described above. See credential transport.
| Name | Location | Type | Requirement / default | Meaning and constraint |
|---|---|---|---|---|
resource | header | string | required context | Public resource key; not the secret. |
id | path | decimal digits | yes | Plan ID; one or more digits. |
Result
HTTP 200 JSON.
| Field / projection | Type / presence | Meaning |
|---|---|---|
| top-level object | plan with subscriptions array | Use the field definitions and detail branch of field definitions. No items wrapper. |
Example: get a plan
Read Reader plan 1001 after selecting it from the catalog. Its subscriptions are detail relationships rather than a filtered public chooser. Supply the sample configuration and runtimes. These three requests are equivalent.
cURL
curl "${WALLKIT_API_BASE}/api/v1/plans/1001" \
-H "resource: ${RESOURCE_KEY}"
JavaScript
// Node.js 18+; built-in fetch. Supply existing integration configuration.
async function main() {
const url = new URL("/api/v1/plans/1001", process.env.WALLKIT_API_BASE);
const headers = { resource: process.env.RESOURCE_KEY };
const response = await fetch(url, { method: "GET", headers });
const body = await response.json();
console.log(response.status, body);
}
main().catch(console.error);
Python
# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen
url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/plans/1001")
headers = {"resource": os.environ["RESOURCE_KEY"]}
request = Request(url, headers=headers, method="GET")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 response excerpt:
{
"id": 1001,
"title": "Reader plan",
"slug": "reader",
"active": true,
"private": false,
"subscriptions": [
{
"id": 2001,
"title": "Monthly",
"price": 1200,
"currency": "USD",
"period": "1 month"
}
]
}
Alternate result
HTTP 404: Check the plan ID and selected resource; choose a current ID from the appropriate list.
Response excerpt:
{
"error": "plan_not_found",
"error_description": "Plan not found",
"req_guid": "example-request"
}
Recovery
| HTTP status | API code / response | Cause | Next action |
|---|---|---|---|
| 404 | resource_not_exists | Required resource is missing or unknown. | Check the resource public key and selected integration context with the administrator. |
| 404 | plan_not_found | Plan does not exist in this resource. | Check the plan ID and selected resource; choose a current ID from the appropriate list. |
| 409 | invalid_id | An empty/zero ID reaches the operation. | Supply a nonzero existing plan ID from the appropriate list. |
See catalog context for applicable shared checks; follow the local error table above.
Next task
Read a selected Pricing to show billing terms; detail visibility alone does not establish purchase eligibility.
List public Pricings
GET /api/v1/subscriptions
List active public subscriptions whose parent plans are active and public in the selected resource. This lists Pricings, not user memberships.
Before you call
Use the resource public key. A member token is optional for user-specific cascade information; without it the example is a guest-readable Pricing list. See catalog context for supplied configuration and shared checks.
Request
GET with no request body or request Content-Type requirement. Response media type is JSON. Permits guest access with the context described above. See credential transport.
| Name | Location | Type | Requirement / default | Meaning and constraint |
|---|---|---|---|---|
resource | header | string | required context | Public resource key; not the secret. |
token | header | string | optional | Member token when requesting user-specific cascade context. |
page | query | integer | optional | Use 1 for the first page; pass it explicitly. No explicit omitted-page default in the operation. |
limit | query | integer | optional | Default 10. No universal maximum is specified. |
filter | query | object / JSON string | optional | Criteria-style Subscriptions fields, e.g. filter[Subscriptions.id]. |
by | query | string | optional | Default Plans.priority. |
sort | query | string | optional | Default DESC. |
A token is optional when you want user-specific cascade context; this read does not create a membership.
Result
HTTP 200 JSON.
| Field / projection | Type / presence | Meaning |
|---|---|---|
items[] | public Pricing | Use the field definitions, including applied_cascade_access. No membership is created. |
paginator uses the collection fields. An empty collection is an ordinary result; do not interpret it as an authentication failure.
Example: list public Pricings
Show Monthly Pricing 2001 to a guest. applied_cascade_access is false because this request supplies no member context. Supply the sample configuration and runtimes. These three requests are equivalent.
cURL
curl "${WALLKIT_API_BASE}/api/v1/subscriptions?page=1&limit=10" \
-H "resource: ${RESOURCE_KEY}"
JavaScript
// Node.js 18+; built-in fetch. Supply existing integration configuration.
async function main() {
const url = new URL("/api/v1/subscriptions", process.env.WALLKIT_API_BASE);
url.searchParams.set("page", "1");
url.searchParams.set("limit", "10");
const headers = { resource: process.env.RESOURCE_KEY };
const response = await fetch(url, { method: "GET", headers });
const body = await response.json();
console.log(response.status, body);
}
main().catch(console.error);
Python
# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen
url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/subscriptions")
url += "?" + urlencode({'page': '1', 'limit': '10'})
headers = {"resource": os.environ["RESOURCE_KEY"]}
request = Request(url, headers=headers, method="GET")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 response excerpt:
{
"items": [
{
"id": 2001,
"title": "Monthly",
"price": 1200,
"currency": "USD",
"period": "1 month",
"plan": {
"id": 1001,
"title": "Reader plan"
},
"applied_cascade_access": false
}
]
}
Alternate result
No matching records on this page. Show an empty state; review the member/resource context or filters if unexpected. Do not treat an empty list as permission or as an API error.
Response excerpt:
{
"items": []
}
Recovery
| HTTP status | API code / response | Cause | Next action |
|---|---|---|---|
| 404 | resource_not_exists | Required resource is missing or unknown. | Check the resource public key and selected integration context with the administrator. |
See catalog context for applicable shared checks; follow the local error table above.
Next task
Read the selected Pricing to show its terms. If the visitor intends to pay, follow the User subscriptions and Pricing selection; listing a Pricing does not create a membership.
Get a Pricing
GET /api/v1/subscriptions/{id}
Read a known subscription whose parent plan belongs to the selected resource. Unlike the list, this lookup does not add active/private checks.
Before you call
Take the Pricing ID from a subscription list or existing integration record. Use a nonzero ID belonging to a plan in this resource. See catalog context for supplied configuration and shared checks.
Request
GET with no request body or request Content-Type requirement. Response media type is JSON. Permits guest access with the context described above. See credential transport.
| Name | Location | Type | Requirement / default | Meaning and constraint |
|---|---|---|---|---|
resource | header | string | required context | Public resource key; not the secret. |
id | path | decimal digits | yes | Subscription ID; one or more digits; use a nonzero existing ID. |
Result
HTTP 200 JSON.
| Field / projection | Type / presence | Meaning |
|---|---|---|
| top-level object | general Pricing with detail plan | Use the field definitions and field definitions. No items wrapper. |
Example: get a Pricing
Read Monthly Pricing 2001. Its parent plan includes short Pricing summaries, with fewer fields than the public Pricing list. Supply the sample configuration and runtimes. These three requests are equivalent.
cURL
curl "${WALLKIT_API_BASE}/api/v1/subscriptions/2001" \
-H "resource: ${RESOURCE_KEY}"
JavaScript
// Node.js 18+; built-in fetch. Supply existing integration configuration.
async function main() {
const url = new URL("/api/v1/subscriptions/2001", process.env.WALLKIT_API_BASE);
const headers = { resource: process.env.RESOURCE_KEY };
const response = await fetch(url, { method: "GET", headers });
const body = await response.json();
console.log(response.status, body);
}
main().catch(console.error);
Python
# Python 3; standard library only.
import json
import os
from urllib.error import HTTPError
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen
url = urljoin(os.environ["WALLKIT_API_BASE"], "/api/v1/subscriptions/2001")
headers = {"resource": os.environ["RESOURCE_KEY"]}
request = Request(url, headers=headers, method="GET")
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
HTTP 200 response excerpt:
{
"id": 2001,
"title": "Monthly",
"price": 1200,
"currency": "USD",
"period": "1 month",
"active": true,
"private": false,
"public": true,
"plan": {
"id": 1001,
"title": "Reader plan",
"subscriptions": [
{
"id": 2001,
"title": "Monthly",
"price": 1200,
"currency": "USD",
"period": "1 month"
}
]
}
}
Alternate result
HTTP 404: Check the Pricing ID and its parent plan’s resource; choose a current ID from the appropriate list.
Response excerpt:
{
"error": "subscription_not_found",
"error_description": "Subscription not found",
"req_guid": "example-request"
}
Recovery
| HTTP status | API code / response | Cause | Next action |
|---|---|---|---|
| 404 | resource_not_exists | Required resource is missing or unknown. | Check the resource public key and selected integration context with the administrator. |
| 404 | subscription_not_found | Subscription missing or parent plan belongs to another resource. | Check the Pricing ID and its parent plan’s resource; choose a current ID from the appropriate list. |
See catalog context for applicable shared checks; follow the local error table above.
Next task
For a serving decision, check content access with the established member or permitted guest context. An existing paid membership is not a universal prerequisite for that check, and this Pricing result grants no access. For an intended payment, follow the User subscriptions and Pricing selection.