Contents
On this page
Refund Order - Plugixa Stream
POST /plugixa-stream/v1/admin/orders/{id}/refund
Refund a paid order through its gateway, then take its coins back at once. Coins the viewer already spent are recovered by locking again the episodes bought with them since the payment.
Needs a user with the plugixa_stream_manage_settings capability (signed in with an Application Password or the login cookie). Administrators hold it; other roles only when you grant it.
Note. VIP payments are refunded from the Stripe Dashboard or your PayPal account, not here.
Request
POST https://your-site.example/wp-json/plugixa-stream/v1/admin/orders/41/refund
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The order id |
Responses
200 OK. data is the order, now refunded.
{
"success": true,
"data": {
"id": "41",
"user_id": "7",
"gateway": "stripe",
"gateway_ref": "cs_test_a1B2c3D4",
"payment_ref": "pi_3Q1x2y3z",
"product": "pack",
"product_id": "p300",
"amount": "1499",
"currency": "USD",
"coins": "300",
"bonus_coins": "30",
"coupon": "",
"discount": "0",
"trial_days": "0",
"status": "refunded",
"created_at": "2026-11-16 19:02:11",
"paid_at": "2026-11-16 19:03:40"
}
}
The rows come as the database stores them: every value, numbers included, is a string.
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
plugixa_stream_forbidden |
The caller lacks the capability. |
422 |
plugixa_stream_refund |
The order is not paid, or it is a VIP payment. |
502 |
plugixa_stream_stripe |
Stripe refused; plugixa_stream_paypal for PayPal. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-stream/v1/admin/orders/41/refund" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/orders/41/refund');
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/admin/orders/41/refund', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share