Contents
On this page

Unlock Series - Plugixa Stream

POST /plugixa-stream/v1/series/{id}/unlock

Unlock every paid episode of a title the caller does not own yet, in one payment at the bundle price. The price is in viewer.pricing of Get Title, shown before the first coin is spent.

Any signed-in user (an Application Password, or the login cookie with an X-WP-Nonce header). Signed out, it answers 401 plugixa_stream_login_required. It always acts on the caller’s own account. Rate-limited with the other unlock requests: 60 a minute per account.

Note. The bundle price is the title’s own bundle price while the caller owns none of its episodes; otherwise the full price less the site’s bundle discount. It is never above the full price.

Request

POST https://your-site.example/wp-json/plugixa-stream/v1/series/2814/unlock

Path parameters

Name Type Description
id integer The title’s id

Responses

200 OK.

{
  "success": true,
  "data": {
    "balance": {
      "paid": 0,
      "bonus": 0,
      "total": 0
    },
    "coins": 350,
    "episodes": 10
  }
}
Field Type Meaning
data.balance.paid integer Coins bought
data.balance.bonus integer Coins given: check-in rewards, pack bonuses, grants
data.balance.total integer Both
data.coins integer Coins spent
data.episodes integer Episodes unlocked

Errors

Status Code When
401 plugixa_stream_login_required Signed out.
403 plugixa_stream_kids_profile The account’s active profile is a kids profile, which may not spend.
404 plugixa_stream_not_found No published title with that id, or the title is not shown on the active profile.
409 plugixa_stream_already The caller can already watch every episode.
402 plugixa_stream_insufficient_coins Not enough coins.
500 plugixa_stream_wallet The wallet could not be updated. Nothing was charged.
429 plugixa_stream_rate_limited More than 60 requests of this kind in the current minute.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-stream/v1/series/2814/unlock" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/series/2814/unlock');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-stream/v1/series/2814/unlock', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share