Fetch a subscriber’s active subscriptions from a headless or native client
GET /benecaster/v1/account/subscriptions (cookie auth) returns { items: [...] } — each item carries show_id, show_title, show_artwork, tier_name, feed_url (masked, first 8 chars + placeholder), status, and token_prefix. Use from a headless front-end or native client to render a subscriber’s account without loading the WordPress account page. Note: feed_url is always the masked form — to obtain the full URL call POST /account/reset-token.
Code
<?php
// WordPress: fetch own subscriptions server-side (e.g. in a REST proxy add-on)
$response = wp_remote_get(
rest_url( 'benecaster/v1/account/subscriptions' ),
[
'cookies' => $_COOKIE, // forward logged-in user's cookies
]
);
$data = json_decode( wp_remote_retrieve_body( $response ), true );
foreach ( $data['items'] as $sub ) {
// $sub['show_title'], $sub['tier_name'], $sub['token_prefix'] etc.
}