API

Is it possible to automate cancellation and refund of unused virtual numbers via SMSVerifier API endpoints?

July 30, 2026 · 5 min read · 8 views
Yes, SMSVerifier API supports full automation of cancellation and refund for unused virtual numbers, enabling seamless management directly via API calls.

Overview of Cancellation and Refund Automation

Managing virtual numbers efficiently is crucial for developers integrating SMS verification services. SMSVerifier offers a robust API that allows you to not only purchase and receive SMS codes but also automate the cancellation and refund of unused virtual numbers. This means you can programmatically cancel numbers that you no longer need or that have not received SMS within the expected timeframe, and get refunded without manual intervention.

Important context.

Unused virtual numbers typically qualify for automatic refunds if no SMS is received before the expiry, usually within 20 minutes.

Automation ensures optimized resource usage and cost-saving by avoiding charges for numbers that remain unused. It is particularly useful when dealing with bulk number rentals or high-frequency verification workflows.

Key API Endpoints for Cancellation and Refund

SMSVerifier offers several API endpoints to manage the lifecycle of your virtual numbers. The critical endpoints for cancellation and refund automation include:

  • getRentNumber: Check the status and details of your rented number.
  • setStatus: Used to update the status of a virtual number, including cancellation.
  • getBalance: Monitor your account balance to verify refunds.
bash
curl "https://smsverifier.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatus&id=NUMBER_ID&status=8"
python
import requests

params = {
    "api_key": "YOUR_API_KEY",
    "action": "setStatus",
    "id": "NUMBER_ID",
    "status": 8  # 8 means cancel
}

response = requests.get("https://smsverifier.com/stubs/handler_api.php", params=params)
print(response.text)
javascript
const fetch = require("node-fetch");

const url = new URL("https://smsverifier.com/stubs/handler_api.php");
url.searchParams.append("api_key", "YOUR_API_KEY");
url.searchParams.append("action", "setStatus");
url.searchParams.append("id", "NUMBER_ID");
url.searchParams.append("status", "8");

fetch(url)
  .then(res => res.text())
  .then(console.log);
Pro tip.

Use status code 8 in the setStatus API call to cancel a number and trigger a refund if eligible.

Step-by-Step Automation Process

To automate cancellation and refund, follow this typical workflow:

  • Step 1 — Purchase a virtual number Use the API to buy a number for your desired service and country.
  • Step 2 — Monitor SMS arrival Periodically check the number status with getRentNumber to detect incoming OTP SMS.
  • Step 3 — Cancel if unused If no SMS arrives within the expiry window, call setStatus with status 8 to cancel and request refund.
  • Step 4 — Verify refund Check your balance with getBalance to confirm the refund was processed.
Automation reduces manual checks and saves money by refunding unused virtual numbers promptly.

Best Practices and Common Pitfalls

To ensure your automation works smoothly, consider the following tips:

Common pitfall.

Attempting to cancel a number after SMS arrival may not trigger a refund. Always verify SMS status before cancellation.

  • Use reliable polling intervals for checking SMS status to avoid premature cancellation.
  • Respect the 20-minute expiry timeframe for refunds; after this window, refunds may not apply.
  • Maintain error handling for API responses to manage cases where cancellation or refund fails.
  • Keep your API key secure and use HTTPS for all API calls.
Integration tip.

Combine cancellation automation with your overall SMS verification logic using webhook notifications or scheduled tasks.

Fast confirmation

Refunds are processed within seconds after cancellation via API.

🔄

Full lifecycle control

Buy, check, cancel, and refund numbers programmatically for full automation.

🔐

Secure API access

Use API keys with permissions to safeguard operations.

Frequently asked questions

Can I cancel a purchased virtual number using the SMSVerifier API?
Yes, SMSVerifier provides API endpoints that allow you to cancel virtual numbers programmatically before they are used.
Is there an automatic refund for unused numbers through the API?
Yes, if a virtual number remains unused and the SMS does not arrive within the set time, the API refunds your balance automatically.
How do I check the status of a virtual number via the API?
You can query the status of your virtual numbers using specific API endpoints to see if they are active, used, or eligible for refund.
What is the typical refund time once a number is canceled?
Refunds for unused numbers are processed within seconds after the cancellation is confirmed via the API.
Are there any prerequisites to use the cancellation and refund API features?
You need a valid SMSVerifier API key and sufficient permissions on your account to perform cancellations and request refunds.
Can I automate the entire lifecycle of virtual numbers using SMSVerifier API?
Yes, SMSVerifier API supports buying, checking, canceling, and refunding numbers to fully automate your SMS verification workflows.
Where can I find detailed API documentation for these features?
All cancellation and refund endpoints are documented in our API docs at /api/docs, including request parameters and response examples.

Ready to automate virtual number management?

Access the SMSVerifier API and start canceling and refunding unused numbers programmatically today.

Read the API docs
Tags: api automation refund virtual-numbers smsverifier
Browse Services A-Z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z #
View all services →
From Our Blog
Browse all articles →