Bridge Levels REST API
A single endpoint for reading available membership tiers from the active subscription plugin bridge for a given show. Useful for add-ons that need to populate a tier picker without going through the bridge directly.
GET /benecaster/v1/bridge/levels
Returns all membership levels available from the active bridge for a specific show.
Auth: manage_options + X-WP-Nonce
Parameters:
| Param | Type | Required | Description |
|---|---|---|---|
show_id |
int | Yes | Show to query bridge levels for |
Response:
{
"levels": [
{ "id": 1, "name": "Gold Member" },
{ "id": 2, "name": "Silver Member" },
{ "id": 3, "name": "Free" }
]
}
When no bridge is configured for the show, NullBridge returns an empty array:
{
"levels": []
}
Errors:
| Code | HTTP | Condition |
|---|---|---|
show_not_found |
404 | show_id does not exist |
invalid_param |
400 | show_id missing or not an integer |
Notes:
idvalues correspond to the bridge’s external tier identifier — the same values used when configuring tier mappings inPOST /shows/{id}/tiers.- The response reflects what
BridgeManager::get_active_bridge()->get_all_tiers()returns at call time. If the active bridge cannot connect to the membership plugin, it returns an empty levels array rather than an error. - Levels are not filtered or sorted — they are returned in the order the bridge provides them.
- Add-ons that present a tier picker should call this endpoint rather than calling
get_all_tiers()directly — the REST layer applies nonce verification and permission checks that a direct PHP call skips.
Relationship to other endpoints:
To read the tier mappings Benecaster has already configured for a show (mapping external bridge levels to Benecaster internal tiers), use GET /shows/{id}/tiers. Use GET /bridge/levels to read what the bridge has available; use GET /shows/{id}/tiers to read what’s been mapped.