November 23, 2017
# Example to cancel a VLAN
# The script will get the Billing_Item id of the VLAN service
# then it will cancel the VLAN service
# Important manual pages
# License:
# Author: SoftLayer Technologies, Inc. <>
use lib 'softlayer-api-perl-client-master/';
use SoftLayer::API::SOAP;
use JSON;
use Data::Dumper;

# Your SoftLayer API key username.
my $username = 'set me';
my $key = 'set me';

# The VLAN id you wish to cancel
my $vlan_id = 563298;

# Creating a SoftLayer API client object
my $network_vlan_service = SoftLayer::API::SOAP->new('SoftLayer_Network_Vlan', undef, $username, $key);
my $billing_item_service = SoftLayer::API::SOAP->new('SoftLayer_Billing_Item', undef, $username, $key);


# Declaring an object mask to get the billing item information
my $object_mask = "mask[id,]";

# Getting the Billing Item to cancel the VLAN service.
my $vlan = $network_vlan_service->getObject();
if ($vlan->fault) {
    die 'Unable to retrieve the vlan. ' . $vlan->faultstring;

# Canceling the VLAN service.
$result = $billing_item_service->cancelService();
if ($result->fault) {
    die 'Unable to cancel the vlan. ' . $result->faultstring;

print Dumper($result->result);


If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue