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.
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.
curl "https://smsverifier.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatus&id=NUMBER_ID&status=8"
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)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);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
getRentNumberto detect incoming OTP SMS. -
Step 3 — Cancel if unused
If no SMS arrives within the expiry window, call
setStatuswith status 8 to cancel and request refund. -
Step 4 — Verify refund
Check your balance with
getBalanceto confirm the refund was processed.
Best Practices and Common Pitfalls
To ensure your automation works smoothly, consider the following tips:
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.
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?
Is there an automatic refund for unused numbers through the API?
How do I check the status of a virtual number via the API?
What is the typical refund time once a number is canceled?
Are there any prerequisites to use the cancellation and refund API features?
Can I automate the entire lifecycle of virtual numbers using SMSVerifier API?
Where can I find detailed API documentation for these features?
Ready to automate virtual number management?
Access the SMSVerifier API and start canceling and refunding unused numbers programmatically today.
Read the API docs