Skip to main content
POST
/
api
/
v2
/
order
/
cancel-refund
/
{subscription_id}
/
{product_id}
Cancel & Refund
curl --request POST \
  --url https://dashboard.statproxies.com/api/v2/order/cancel-refund/{subscription_id}/{product_id}
import requests

url = "https://dashboard.statproxies.com/api/v2/order/cancel-refund/{subscription_id}/{product_id}"

response = requests.post(url)

print(response.text)
const options = {method: 'POST'};

fetch('https://dashboard.statproxies.com/api/v2/order/cancel-refund/{subscription_id}/{product_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://dashboard.statproxies.com/api/v2/order/cancel-refund/{subscription_id}/{product_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://dashboard.statproxies.com/api/v2/order/cancel-refund/{subscription_id}/{product_id}"

req, _ := http.NewRequest("POST", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://dashboard.statproxies.com/api/v2/order/cancel-refund/{subscription_id}/{product_id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://dashboard.statproxies.com/api/v2/order/cancel-refund/{subscription_id}/{product_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
{
  "response": "<string>",
  "message": "<string>",
  "details.order_id": "<string>",
  "details.subscription_id": "<string>",
  "details.credit_amount": 123,
  "details.credit_amount_cents": 123,
  "details.invoice_id": "<string>",
  "details.hours_since_renewal": 123
}
Cancel a subscription immediately and credit the full amount of its most recent paid invoice back to your Stripe billing account balance. Designed for reseller organizations whose end-customer’s payment failed after our subscription had already renewed.
This cancels the subscription immediately (not at period end) and queues the proxies for deletion right away. The order is marked expired.

Requirements

  • Organization API key only — user-scoped keys receive 403
  • The cancel_refund feature must be enabled for your organization (contact support)
  • Must be called within 3 days (72 hours) of the most recent invoice payment
  • The order must be active or cancelled (not expired), and not a crypto subscription

Effects

When successful:
  1. The order is marked expired
  2. The Stripe subscription is cancelled immediately (not at period end)
  3. The invoice amount is credited to the Stripe customer the order was billed to
  4. The proxies are queued for deletion right away

Request

Headers

HeaderValueRequired
AuthorizationBearer {your_api_key}Yes

Path Parameters

subscription_id
string
required
The subscription ID from order creation.
product_id
string
required
The product ID (e.g., "captcha").

Example Request

curl -X POST "https://dashboard.statproxies.com/api/v2/order/cancel-refund/sub_1RqJP3JB4G9i6PKHDwmKPJOb/captcha" \
  -H "Authorization: Bearer {your_api_key}"

Response

Success Response

{
  "response": "success",
  "message": "Subscription cancelled and account credited",
  "details": {
    "order_id": "sub_1rqjp3jb4g9i6pkhdwmkpjob",
    "subscription_id": "sub_1RqJP3JB4G9i6PKHDwmKPJOb",
    "credit_amount": 25.5,
    "credit_amount_cents": 2550,
    "invoice_id": "in_1RqJP3JB4G9i6PKHAbCdEfGh",
    "hours_since_renewal": 5.25
  }
}

Response Fields

response
string
Status of the request.
message
string
Human-readable result message.
details.order_id
string
The order ID that was processed.
details.subscription_id
string
The Stripe subscription that was cancelled.
details.credit_amount
number
Amount credited, in dollars.
details.credit_amount_cents
integer
Amount credited, in cents.
details.invoice_id
string
The Stripe invoice that was credited.
details.hours_since_renewal
number
Hours between the invoice payment and this request.

Error Responses

403 Forbidden - Not an Organization Key

{
  "response": "error",
  "message": "This endpoint is only available for organization API keys"
}

403 Forbidden - Feature Not Enabled

{
  "response": "error",
  "message": "Post-renewal cancellation feature is not enabled for your organization. Contact support to enable this feature."
}

400 Bad Request - No Billing Account

{
  "response": "error",
  "message": "Organization does not have a billing account configured. Contact support."
}

400 Bad Request - Order Not Processable

{
  "response": "error",
  "message": "Order cannot be processed (current status: expired)"
}

400 Bad Request - Crypto Subscription

{
  "response": "error",
  "message": "This endpoint does not support crypto subscriptions. Contact support for manual processing."
}

400 Bad Request - No Paid Invoices

{
  "response": "error",
  "message": "No paid invoices found for this subscription"
}

400 Bad Request - Refund Window Passed

{
  "response": "error",
  "message": "Refund window has passed. The most recent payment was 5 day(s) ago. Credits are only available within 3 days of renewal."
}

404 Not Found

{
  "response": "error",
  "message": "Order not found"
}

409 Conflict - Already Processed

{
  "response": "error",
  "message": "This order has already been processed for cancellation"
}

500 Internal Server Error

{
  "response": "error",
  "message": "Internal server error"
}

Delete Order

Schedule a cancellation at period end (no immediate refund).

List Orders

Check an order’s current status.