> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://en.megaport.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://en.megaport.ferndocs.com/_mcp/server.

# Delete Port (v3)

POST https://api.megaport.com/v3/product/{productUid}/action/{action}
Content-Type: application/json

Deletes (terminates) the Port by changing the provisioning status.

When the Port is terminated, any services (such as VXCs) attached to the Port are also terminated.

**Note:** You can only update a service when its provisioning status is `CONFIGURED` or `LIVE`.

The `productUid` is a required string that identifies the service by the unique product identifier.

The `action` is a required string that indicates the change in the service. Accepted values are:

* `CANCEL` - Cancels service on a Port at the end of the contract term. You can restore the Port before the contract ends.

* `UN_CANCEL` - Restores a Port that has been canceled but not reached the end of the contract term.

* `CANCEL_NOW` - Stops the service on the Port immediately. You will still be billed for the remainder of your contract and early termination fees apply. The Port cannot be restored.

**Note:** Terminating a Port on a contract term will result in an early termination fee (ETF) equivalent to 100% of the remainder of the term.

For more information about the product lifecycle and provisioning status, see [Monitoring Service Status with the API](https://docs.megaport.com/api/monitoring/).

#### Cancellation Reasons

You customize the Body of the request with the cancellation reason details for terminating a service. Specifying the reason for terminating a service will allow us to understand how we can improve your customer experience.

**Note:**

* **Ordered in Error or Reordering** (SERVICE\_ORDERED\_IN\_ERROR) should be specified if you have upgraded or downgraded the service speed and re-ordered.

* **Reason not Listed** (OTHER) provides an optional free text field that allows you to specify a different reason to those listed. This field has a maximum of 400 characters.

* You can also provide additional details in the free text field for any of the cancellation reasons.

| **Attribute**          | **Description**                                                                                                                                                                                                                                               |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cancellation_reason`  | (Optional) The reason for deleting the service.  These options are available:  `MOVED_TO_CLOUD_NATIVE_SOL`  `SERVICE_MOVED`  `SERVICE_ORDERED_IN_ERROR`  `PROOF_OF_CONCEPT`  `PROJECT_ENDED`  `SWITCHING_PROVIDER`  `PRICING`  `PRODUCT_PERFORMANCE`  `OTHER` |
| `cancellation_comment` | Specify free text (max. 400 characters) with an additional explanation for the reason the service was terminated.                                                                                                                                             |

For more information, see [Terminating a Port](https://docs.megaport.com/connections/terminating-port/).

Reference: https://en.megaport.ferndocs.com/api-reference/product-details/delete-port-v-3

## Servers

- `https://api.megaport.com` (Production environment, default)
- `https://api-staging.megaport.com` (Staging environment (test only, reset every 24 hours))

## Request

### Path parameters

- `productUid` (string, required)
- `action` (string, required)

### Query parameters

- `terminationDate` (string, optional) — The termination date for the Megaport Internet connection. (Required - integer)

### Body (application/json)

This endpoint expects an object.

- `cancellation_comment` (string, optional)
- `cancellation_reason` (string, optional)

## Response

### 200

Delete Port (v3) / Delete Port With Cancellation Reason (CANCEL) (v3) / Delete Port With Cancellation Reason (CANCEL NOW) (v3) / Delete Port With Cancellation Reason (CANCEL NOW) (v3) / Delete Port With Cancellation Reason (CANCEL) (v3) / Delete Port (v3) / Delete VXC (v3) / Delete VXC With Cancellation Reason (v3) / Delete VXC (v3) / Delete VXC With Cancellation Reason (v3) / Delete Megaport Internet - With Cancel Reason / Delete Megaport Internet - With Cancel Reason / Delete MCR (v3) / Delete MCR With Cancellation Reason (v3) / Delete MCR (v3) / Delete MCR With Cancellation Reason (v3) / Delete Megaport Internet (v3) / Delete Megaport Internet (v3) / Delete MVE (v3) / Delete MVE With Cancellation Reason (v3) / Delete MVE With Cancellation Reason (v3) / Delete MVE (v3) / Delete IX With Cancellation Reason (v3) / Delete IX With Cancellation Reason (v3) / Update Product Lifecycle Action (v3) / Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3) / Update Product Lifecycle Action (v3) / Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3)

- `message` (string, optional)
- `terms` (string, optional)

## Examples

### Delete IX With Cancellation Reason (v3)

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service 3af07097-c7f8-4590-bb96-4f9172ede274] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete IX With Cancellation Reason (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

response = requests.post(url)

print(response.json())
```

```javascript Delete IX With Cancellation Reason (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete IX With Cancellation Reason (v3)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete IX With Cancellation Reason (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java Delete IX With Cancellation Reason (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .asString();
```

```php Delete IX With Cancellation Reason (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action');

echo $response->getBody();
```

```csharp Delete IX With Cancellation Reason (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Delete IX With Cancellation Reason (v3)
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete MCR (v3)

**Request**

```json
{
  "cancellation_comment": "This MCR was created in the wrong data center. Needs to be deleted.",
  "cancellation_reason": "SERVICE_ORDERED_IN_ERROR"
}
```

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service 34f19998-d8da-4ddc-92f6-6bcecc8b8378] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete MCR (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

payload = {
    "cancellation_comment": "This MCR was created in the wrong data center. Needs to be deleted.",
    "cancellation_reason": "SERVICE_ORDERED_IN_ERROR"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Delete MCR (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"cancellation_comment":"This MCR was created in the wrong data center. Needs to be deleted.","cancellation_reason":"SERVICE_ORDERED_IN_ERROR"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete MCR (v3)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	payload := strings.NewReader("{\n  \"cancellation_comment\": \"This MCR was created in the wrong data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_ORDERED_IN_ERROR\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete MCR (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cancellation_comment\": \"This MCR was created in the wrong data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_ORDERED_IN_ERROR\"\n}"

response = http.request(request)
puts response.read_body
```

```java Delete MCR (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .header("Content-Type", "application/json")
  .body("{\n  \"cancellation_comment\": \"This MCR was created in the wrong data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_ORDERED_IN_ERROR\"\n}")
  .asString();
```

```php Delete MCR (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action', [
  'body' => '{
  "cancellation_comment": "This MCR was created in the wrong data center. Needs to be deleted.",
  "cancellation_reason": "SERVICE_ORDERED_IN_ERROR"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Delete MCR (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cancellation_comment\": \"This MCR was created in the wrong data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_ORDERED_IN_ERROR\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Delete MCR (v3)
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "cancellation_comment": "This MCR was created in the wrong data center. Needs to be deleted.",
  "cancellation_reason": "SERVICE_ORDERED_IN_ERROR"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete MCR With Cancellation Reason (v3)

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service d6efa8b2-03f1-47ed-b2d1-e76e28debefa] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete MCR With Cancellation Reason (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

response = requests.post(url)

print(response.json())
```

```javascript Delete MCR With Cancellation Reason (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete MCR With Cancellation Reason (v3)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete MCR With Cancellation Reason (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java Delete MCR With Cancellation Reason (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .asString();
```

```php Delete MCR With Cancellation Reason (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action');

echo $response->getBody();
```

```csharp Delete MCR With Cancellation Reason (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Delete MCR With Cancellation Reason (v3)
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete MVE (v3)

**Request**

```json
{}
```

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service 19440a03-a8fc-4191-99c6-23429a267f2e] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete MVE (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Delete MVE (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete MVE (v3)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete MVE (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java Delete MVE (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php Delete MVE (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Delete MVE (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Delete MVE (v3)
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete MVE With Cancellation Reason (v3)

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service f390422d-4318-4d26-bef0-1ff2208ab409] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete MVE With Cancellation Reason (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

response = requests.post(url)

print(response.json())
```

```javascript Delete MVE With Cancellation Reason (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete MVE With Cancellation Reason (v3)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete MVE With Cancellation Reason (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java Delete MVE With Cancellation Reason (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .asString();
```

```php Delete MVE With Cancellation Reason (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action');

echo $response->getBody();
```

```csharp Delete MVE With Cancellation Reason (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Delete MVE With Cancellation Reason (v3)
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete Megaport Internet (v3)

**Request**

```json
{
  "cancellation_comment": "This Megaport Internet connection was created in error. It needs to be deleted and then a new connection created.",
  "cancellation_reason": "OTHER"
}
```

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service e11d4d5e-8694-4748-a9da-14a0bf0cd69f] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete Megaport Internet (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

payload = {
    "cancellation_comment": "This Megaport Internet connection was created in error. It needs to be deleted and then a new connection created.",
    "cancellation_reason": "OTHER"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Delete Megaport Internet (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"cancellation_comment":"This Megaport Internet connection was created in error. It needs to be deleted and then a new connection created.","cancellation_reason":"OTHER"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete Megaport Internet (v3)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	payload := strings.NewReader("{\n  \"cancellation_comment\": \"This Megaport Internet connection was created in error. It needs to be deleted and then a new connection created.\",\n  \"cancellation_reason\": \"OTHER\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete Megaport Internet (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cancellation_comment\": \"This Megaport Internet connection was created in error. It needs to be deleted and then a new connection created.\",\n  \"cancellation_reason\": \"OTHER\"\n}"

response = http.request(request)
puts response.read_body
```

```java Delete Megaport Internet (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .header("Content-Type", "application/json")
  .body("{\n  \"cancellation_comment\": \"This Megaport Internet connection was created in error. It needs to be deleted and then a new connection created.\",\n  \"cancellation_reason\": \"OTHER\"\n}")
  .asString();
```

```php Delete Megaport Internet (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action', [
  'body' => '{
  "cancellation_comment": "This Megaport Internet connection was created in error. It needs to be deleted and then a new connection created.",
  "cancellation_reason": "OTHER"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Delete Megaport Internet (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cancellation_comment\": \"This Megaport Internet connection was created in error. It needs to be deleted and then a new connection created.\",\n  \"cancellation_reason\": \"OTHER\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Delete Megaport Internet (v3)
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "cancellation_comment": "This Megaport Internet connection was created in error. It needs to be deleted and then a new connection created.",
  "cancellation_reason": "OTHER"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete Megaport Internet - With Cancel Reason

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service 1d4c6f4c-18a8-43d9-be1d-be27ad4b7fcc] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete Megaport Internet - With Cancel Reason
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

response = requests.post(url)

print(response.json())
```

```javascript Delete Megaport Internet - With Cancel Reason
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete Megaport Internet - With Cancel Reason
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete Megaport Internet - With Cancel Reason
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java Delete Megaport Internet - With Cancel Reason
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .asString();
```

```php Delete Megaport Internet - With Cancel Reason
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action');

echo $response->getBody();
```

```csharp Delete Megaport Internet - With Cancel Reason
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Delete Megaport Internet - With Cancel Reason
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete Port (v3)

**Request**

```json
{}
```

**Response**

```json
{
  "message": "Action [CANCEL Service b3468b8d-9c00-46cd-bb06-899681226a10] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete Port (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Delete Port (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete Port (v3)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete Port (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java Delete Port (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php Delete Port (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Delete Port (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Delete Port (v3)
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete Port With Cancellation Reason (CANCEL NOW) (v3)

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service b3468b8d-9c00-46cd-bb06-899681226a10] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete Port With Cancellation Reason (CANCEL NOW) (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

response = requests.post(url)

print(response.json())
```

```javascript Delete Port With Cancellation Reason (CANCEL NOW) (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete Port With Cancellation Reason (CANCEL NOW) (v3)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete Port With Cancellation Reason (CANCEL NOW) (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java Delete Port With Cancellation Reason (CANCEL NOW) (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .asString();
```

```php Delete Port With Cancellation Reason (CANCEL NOW) (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action');

echo $response->getBody();
```

```csharp Delete Port With Cancellation Reason (CANCEL NOW) (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Delete Port With Cancellation Reason (CANCEL NOW) (v3)
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete Port With Cancellation Reason (CANCEL) (v3)

**Response**

```json
{
  "message": "Action [CANCEL Service b3468b8d-9c00-46cd-bb06-899681226a10] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete Port With Cancellation Reason (CANCEL) (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

response = requests.post(url)

print(response.json())
```

```javascript Delete Port With Cancellation Reason (CANCEL) (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete Port With Cancellation Reason (CANCEL) (v3)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete Port With Cancellation Reason (CANCEL) (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java Delete Port With Cancellation Reason (CANCEL) (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .asString();
```

```php Delete Port With Cancellation Reason (CANCEL) (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action');

echo $response->getBody();
```

```csharp Delete Port With Cancellation Reason (CANCEL) (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Delete Port With Cancellation Reason (CANCEL) (v3)
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete VXC (v3)

**Request**

```json
{
  "cancellation_comment": "This VXC was created in the wrong AWS data center. Needs to be deleted.",
  "cancellation_reason": "SERVICE_MOVED"
}
```

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service 0109ae60-7930-40f4-a4f2-5c26c0843f36] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete VXC (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

payload = {
    "cancellation_comment": "This VXC was created in the wrong AWS data center. Needs to be deleted.",
    "cancellation_reason": "SERVICE_MOVED"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Delete VXC (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"cancellation_comment":"This VXC was created in the wrong AWS data center. Needs to be deleted.","cancellation_reason":"SERVICE_MOVED"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete VXC (v3)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	payload := strings.NewReader("{\n  \"cancellation_comment\": \"This VXC was created in the wrong AWS data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete VXC (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cancellation_comment\": \"This VXC was created in the wrong AWS data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}"

response = http.request(request)
puts response.read_body
```

```java Delete VXC (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .header("Content-Type", "application/json")
  .body("{\n  \"cancellation_comment\": \"This VXC was created in the wrong AWS data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}")
  .asString();
```

```php Delete VXC (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action', [
  'body' => '{
  "cancellation_comment": "This VXC was created in the wrong AWS data center. Needs to be deleted.",
  "cancellation_reason": "SERVICE_MOVED"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Delete VXC (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cancellation_comment\": \"This VXC was created in the wrong AWS data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Delete VXC (v3)
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "cancellation_comment": "This VXC was created in the wrong AWS data center. Needs to be deleted.",
  "cancellation_reason": "SERVICE_MOVED"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete VXC With Cancellation Reason (v3)

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service 1445a5b1-1f09-4ad0-a467-f9436da898af] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete VXC With Cancellation Reason (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

response = requests.post(url)

print(response.json())
```

```javascript Delete VXC With Cancellation Reason (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete VXC With Cancellation Reason (v3)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete VXC With Cancellation Reason (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java Delete VXC With Cancellation Reason (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .asString();
```

```php Delete VXC With Cancellation Reason (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action');

echo $response->getBody();
```

```csharp Delete VXC With Cancellation Reason (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Delete VXC With Cancellation Reason (v3)
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update Product Lifecycle Action (v3)

**Request**

```json
{
  "cancellation_comment": "This service was created in the wrong data center. Needs to be deleted.",
  "cancellation_reason": "SERVICE_MOVED"
}
```

**Response**

```json
{
  "message": "Action [CANCEL Service 1f1ffdc2-2967-431f-a6f2-b6adbab63fa6] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Update Product Lifecycle Action (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

payload = {
    "cancellation_comment": "This service was created in the wrong data center. Needs to be deleted.",
    "cancellation_reason": "SERVICE_MOVED"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update Product Lifecycle Action (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"cancellation_comment":"This service was created in the wrong data center. Needs to be deleted.","cancellation_reason":"SERVICE_MOVED"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update Product Lifecycle Action (v3)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	payload := strings.NewReader("{\n  \"cancellation_comment\": \"This service was created in the wrong data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update Product Lifecycle Action (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cancellation_comment\": \"This service was created in the wrong data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}"

response = http.request(request)
puts response.read_body
```

```java Update Product Lifecycle Action (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .header("Content-Type", "application/json")
  .body("{\n  \"cancellation_comment\": \"This service was created in the wrong data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}")
  .asString();
```

```php Update Product Lifecycle Action (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action', [
  'body' => '{
  "cancellation_comment": "This service was created in the wrong data center. Needs to be deleted.",
  "cancellation_reason": "SERVICE_MOVED"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Update Product Lifecycle Action (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cancellation_comment\": \"This service was created in the wrong data center. Needs to be deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update Product Lifecycle Action (v3)
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "cancellation_comment": "This service was created in the wrong data center. Needs to be deleted.",
  "cancellation_reason": "SERVICE_MOVED"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3)

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service 1f1ffdc2-2967-431f-a6f2-b6adbab63fa6] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

response = requests.post(url)

print(response.json())
```

```javascript Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {method: 'POST'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	req, _ := http.NewRequest("POST", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
```

```java Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .asString();
```

```php Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action');

echo $response->getBody();
```

```csharp Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Update Product Lifecycle Action With Cancellation Reason (CANCEL NOW) (v3)
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete IX (v3)

**Request**

```json
{
  "cancellation_comment": "This IX has been deleted.",
  "cancellation_reason": "SERVICE_MOVED"
}
```

**Response**

```json
{
  "message": "Action [CANCEL_NOW Service 3af07097-c7f8-4590-bb96-4f9172ede274] has been done.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Delete IX (v3)
import requests

url = "https://api.megaport.com/v3/product/productUid/action/action"

payload = {
    "cancellation_comment": "This IX has been deleted.",
    "cancellation_reason": "SERVICE_MOVED"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Delete IX (v3)
const url = 'https://api.megaport.com/v3/product/productUid/action/action';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"cancellation_comment":"This IX has been deleted.","cancellation_reason":"SERVICE_MOVED"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete IX (v3)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v3/product/productUid/action/action"

	payload := strings.NewReader("{\n  \"cancellation_comment\": \"This IX has been deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete IX (v3)
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v3/product/productUid/action/action")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cancellation_comment\": \"This IX has been deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}"

response = http.request(request)
puts response.read_body
```

```java Delete IX (v3)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.megaport.com/v3/product/productUid/action/action")
  .header("Content-Type", "application/json")
  .body("{\n  \"cancellation_comment\": \"This IX has been deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}")
  .asString();
```

```php Delete IX (v3)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.megaport.com/v3/product/productUid/action/action', [
  'body' => '{
  "cancellation_comment": "This IX has been deleted.",
  "cancellation_reason": "SERVICE_MOVED"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Delete IX (v3)
using RestSharp;

var client = new RestClient("https://api.megaport.com/v3/product/productUid/action/action");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cancellation_comment\": \"This IX has been deleted.\",\n  \"cancellation_reason\": \"SERVICE_MOVED\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Delete IX (v3)
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "cancellation_comment": "This IX has been deleted.",
  "cancellation_reason": "SERVICE_MOVED"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/action/action")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```