Buy-ups Admin REST API
Admin REST endpoints for managing buy-up definitions. All endpoints require manage_options capability and a valid WP REST nonce (X-WP-Nonce header).
Base path: /wp-json/benecaster/v1/shows/{show_id}/buyups
List Buy-ups
GET /shows/{show_id}/buyups
Returns all buy-up definitions for the show (active and inactive).
Response — array of buy-up objects:
[
{
"id": 42,
"slug": "transcript-archive",
"name": "Transcript Archive",
"description": "Full text transcripts for every episode.",
"price_cents": 500,
"currency": "usd",
"available_to_tiers": ["gold", "silver"],
"token_type": "transcript-archive",
"subscriber_cap": 100,
"active_grants": 37,
"is_active": true,
"is_sold_out": false
}
]
Create a Buy-up
POST /shows/{show_id}/buyups
Request body:
{
"name": "Transcript Archive",
"description": "Full text transcripts for every episode.",
"price_cents": 500,
"currency": "usd",
"available_to_tiers": ["gold", "silver"],
"token_type": "transcript-archive",
"subscriber_cap": 100,
"is_active": true
}
token_type must not collide with any existing native tier slug. subscriber_cap is optional; omit for unlimited. On success, triggers StripeBuyupProvisioner to create the Stripe Product and Price.
Response: 201 Created with the full buy-up object.
Update a Buy-up
PUT /shows/{show_id}/buyups/{buyup_id}
Accepts the same body as POST. Partial updates are supported — include only the fields you want to change.
If price_cents changes, a new Stripe Price is created and the old Price is archived. Existing grants are not affected.
Response: 200 OK with the updated buy-up object.
Delete a Buy-up
DELETE /shows/{show_id}/buyups/{buyup_id}
Archives the buy-up definition. Active subscriber grants are not immediately revoked — they continue until the Stripe subscription item naturally ends. The buy-up is hidden from the subscriber account page immediately.
Response: 200 OK with { "deleted": true }.