Subscription Management API
Remove user subscriptions and manage subscription lifecycle programmatically
Subscription Management API
Remove and manage user subscriptions. Handle subscription cancellations, clean up expired subscriptions, and manage the complete subscription lifecycle.
Remove Subscriptions
Cancel active subscriptions.
Clean Lifecycle
Handle subscription states.
Admin Control
Full management access.
Endpoint Overview
/graphqlRemove a user's subscription entirely. This revokes VPN access and cleans up all subscription-related data for the specified user.
Request Parameters
usernameString!RequiredThe username of the user whose subscription should be removed.
GraphQL Mutation
mutation RemoveSubscription($username: String!) {
removeUserSubscription(username: $username) {
id
expiresAt
group {
id
name
}
multiLoginCount
dailyBandwidth
downloadUpload
isTrialPeriod
duration
price
gateway
}
}Variables:
{
"username": "johndoe"
}HTTP Request:
curl -X POST https://api.orbnet.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
-d '{
"query": "mutation RemoveSubscription($username: String!) { removeUserSubscription(username: $username) { id expiresAt group { id name } } }",
"variables": {
"username": "johndoe"
}
}'Response
{
"data": {
"removeUserSubscription": {
"id": "sub_12345",
"expiresAt": "2024-06-15T10:30:00Z",
"group": {
"id": "100",
"name": "Premium Plan"
},
"multiLoginCount": 5,
"dailyBandwidth": "unlimited",
"downloadUpload": "unlimited",
"isTrialPeriod": false,
"duration": 30,
"price": 9.99,
"gateway": "stripe"
}
}
}{
"errors": [
{
"message": "User with username 'johndoe' not found",
"path": ["removeUserSubscription"],
"extensions": {
"code": "NOT_FOUND"
}
}
],
"data": null
}When to Remove
Cancellation
User requests subscription cancellation.
Policy Violation
User violated terms of service.
Account Closure
Complete account deletion process.
Cleanup
Remove test or inactive accounts.
Best Practices
Confirm First
Verify removal is intended before proceeding.
Notify User
Send cancellation confirmation to user.
Document Reason
Record why subscription was removed.
Consider Alternatives
Pause or downgrade instead of full removal.
Related Endpoints
Irreversible Action
Removing a subscription revokes VPN access immediately. The user will need a new subscription to reconnect. Consider pausing instead if the removal might be temporary.
Update Instead of Remove?
If you just need to modify subscription settings, use the Update Subscription endpoint.