Skip to main content

Terminate a Subscription (Subnet / Service)

This guide explains how to terminate an active subscription (for example, an IPv4 subnet lease) using the IPXO API. A termination can be:
  • End of period – service remains active until the current billing period ends
  • Immediate – service is terminated right away (irreversible)

Prerequisites

Before starting this flow, you need:
  • A valid access token ({access_token})
  • Your tenant UUI ({tenant_uuid})
  • At least one active subscription

Flow overview

At a high level, terminating a subscription consists of:
  1. Listing active subscriptions
  2. Selecting a subscription to terminate
  3. Creating a termination request
  4. (Optional) Cancelling a pending termination

1) List active subscriptions

Try it
Start by retrieving all active subscriptions for the tenant.
curl 'https://apigw.ipxo.com/ecommerce/public/{tenant_uuid}/subscriptions/search' \
-X POST \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
    "filter": {
      "status": "active"
    },
    "per_page": "100"
  }'

What this does

  • Returns all currently active subscriptions
  • Each subscription represents a recurring service (e.g. subnet lease)

What to save from the response

From the selected subscription:
  • uuid{subscription_uuid}

2) Terminate a subscription

Try it
Create a termination request for the selected subscription.
curl 'https://apigw.ipxo.com/ecommerce/public/{tenant_uuid}/subscriptions/{subscription_uuid}/terminate'   -X POST   -H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
    "type": "end_of_period",
    "reason": "Pricing",
    "details": "Cancellation reason detailed explanation",
    "meta": {
      "use_again": false
    }
  }'

Termination types

TypeBehavior
end_of_periodService remains active until current billing period ends
immediateService is terminated immediately (cannot be undone)
⚠️ Important: Immediate terminations are irreversible.
End-of-period terminations can be cancelled before the period ends.

Termination reason

There are more termination reasons available.
For this API example, only one is provided (Pricing).

What this does

  • Creates a termination request
  • Marks the subscription for termination
  • Does not immediately delete the service (unless immediate)

What to save from the response

  • uuid{subscription_termination_uuid}

3) (Optional) List termination requests

If you need to:
  • Verify termination status
  • Retrieve the termination UUID
  • Check whether a termination can be cancelled
Try it
List pending termination requests for the subscription.
curl 'https://apigw.ipxo.com/ecommerce/public/{tenant_uuid}/subscriptions/termination-requests?filter[status]=pending&filter[subscription_id]={subscription_uuid}' \
-X GET \
-H 'Authorization: Bearer {access_token}'

When this is useful

  • You didn’t store the termination UUID
  • You want to check if termination is still pending
  • You want to allow the user to undo termination

4) (Optional) Cancel a pending termination

Try it
If the termination type was end_of_period, it can be cancelled before it is executed.
curl 'https://apigw.ipxo.com/ecommerce/public/{tenant_uuid}/subscriptions/termination-requests/{subscription_termination_uuid}/cancel' \
-X POST \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{}'

What this does

  • Cancels a pending termination request
  • Keeps the subscription active
  • Restores normal recurring billing

Subscription lifecycle summary

active
  │── terminate (end_of_period)
     │── pending
     `── cancel → active
     `── executed terminated
  `── terminate (immediate)
        `── terminated (irreversible)

Variables created in this flow

VariableSourcePurpose
{subscription_uuid}List subscriptionsIdentify service to terminate
{subscription_termination_uuid}Terminate subscriptionTrack / cancel termination