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

# Eliminar Puerto (v3)

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

Elimina (termina) el Puerto cambiando el estado de aprovisionamiento.

Cuando el Puerto se termina, cualquier servicio (como VXCs) adjunto al Puerto también se termina.

**Nota:** Solo puede actualizar un servicio cuando su estado de aprovisionamiento es `CONFIGURED` o `LIVE`.

El `productUid` es una cadena obligatoria que identifica el servicio mediante un identificador de producto único.

La `action` es una cadena obligatoria que indica el cambio en el servicio. Los valores aceptados son:

* `CANCEL` - Cancela el servicio en un Puerto al final del plazo del contrato. Puede restaurar el Puerto antes de que finalice el contrato.

* `UN_CANCEL` - Restaura un Puerto que ha sido cancelado pero no ha alcanzado el final del plazo del contrato.

* `CANCEL_NOW` - Detiene el servicio en el Puerto inmediatamente. Seguirá facturándose por el resto de su contrato y se aplicarán tarifas de terminación anticipada. El Puerto no se puede restaurar.

**Nota:** Terminar un Puerto en un plazo de contrato resultará en una tarifa de terminación anticipada (ETF) equivalente al 100% del resto del plazo.

Para obtener más información sobre el ciclo de vida del producto y el estado de aprovisionamiento, consulte [Monitorear el Estado del Servicio con la API](https://docs.megaport.com/api/monitoring/).

#### Razones de Cancelación

Puede personalizar el Cuerpo de la solicitud con los detalles de la razón de cancelación para terminar un servicio. Especificar la razón para terminar un servicio nos permitirá comprender cómo podemos mejorar su experiencia de cliente.

**Nota:**

* **Ordenado por Error o Reordenando** (SERVICE\_ORDERED\_IN\_ERROR) debe especificarse si ha actualizado o degradado la velocidad del servicio y lo ha vuelto a pedir.

* **Razón no Listada** (OTHER) proporciona un campo de texto libre opcional que le permite especificar una razón diferente a las enumeradas. Este campo tiene un máximo de 400 caracteres.

* También puede proporcionar detalles adicionales en el campo de texto libre para cualquiera de las razones de cancelación.

| **Atributo**           | **Descripción**                                                                                                                                                                                                                                                   |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cancellation_reason`  | (Opcional) La razón para eliminar el servicio.  Estas opciones están disponibles:  `MOVED_TO_CLOUD_NATIVE_SOL`  `SERVICE_MOVED`  `SERVICE_ORDERED_IN_ERROR`  `PROOF_OF_CONCEPT`  `PROJECT_ENDED`  `SWITCHING_PROVIDER`  `PRICING`  `PRODUCT_PERFORMANCE`  `OTHER` |
| `cancellation_comment` | Especifique texto libre (máx. 400 caracteres) con una explicación adicional de la razón por la que se terminó el servicio.                                                                                                                                        |

Para obtener más información, consulte [Terminando un Puerto](https://docs.megaport.com/connections/terminating-port/).

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

## Servers

- `https://api.megaport.com` (Entorno de producción, default)
- `https://api-staging.megaport.com` (Entorno de pruebas (solo pruebas, se restablece cada 24 horas))

## Request

### Path parameters

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

### Query parameters

- `terminationDate` (string, optional) — La fecha de terminación para la conexión de Internet de Megaport. (Obligatorio - entero)

### Body (application/json)

This endpoint expects an object.

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

## Response

### 200

Eliminar Puerto (v3) / Eliminar Puerto con Motivo de Cancelación (CANCELAR) (v3) / Eliminar Puerto con Motivo de Cancelación (CANCELAR AHORA) (v3) / Eliminar Puerto con Motivo de Cancelación (CANCELAR AHORA) (v3) / Eliminar Puerto con Motivo de Cancelación (CANCELAR) (v3) / Eliminar Puerto (v3) / Eliminar VXC (v3) / Eliminar VXC con Motivo de Cancelación (v3) / Eliminar VXC (v3) / Eliminar VXC con Motivo de Cancelación (v3) / Eliminar Internet Megaport - Con Motivo de Cancelación / Eliminar Internet Megaport - Con Motivo de Cancelación / Eliminar MCR (v3) / Eliminar MCR con Motivo de Cancelación (v3) / Eliminar MCR (v3) / Eliminar MCR con Motivo de Cancelación (v3) / Eliminar Internet Megaport (v3) / Eliminar Internet Megaport (v3) / Eliminar MVE (v3) / Eliminar MVE con Motivo de Cancelación (v3) / Eliminar MVE con Motivo de Cancelación (v3) / Eliminar MVE (v3) / Eliminar IX con Motivo de Cancelación (v3) / Eliminar IX con Motivo de Cancelación (v3) / Actualizar Acción de Ciclo de Vida del Producto (v3) / Actualizar Acción de Ciclo de Vida del Producto con Motivo de Cancelación (CANCELAR AHORA) (v3) / Actualizar Acción de Ciclo de Vida del Producto (v3) / Actualizar Acción de Ciclo de Vida del Producto con Motivo de Cancelación (CANCELAR AHORA) (v3)

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

## Examples

### Delete IX With Cancellation Reason (v3)

**Response**

```json
{
  "message": "Acción [CANCEL_NOW Servicio 3af07097-c7f8-4590-bb96-4f9172ede274] ha sido realizada.",
  "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": "Acción [CANCEL_NOW Servicio 34f19998-d8da-4ddc-92f6-6bcecc8b8378] ha sido realizada.",
  "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": "Acción [CANCEL_NOW Service d6efa8b2-03f1-47ed-b2d1-e76e28debefa] ha sido realizada.",
  "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": "Acción [CANCEL_NOW Servicio 19440a03-a8fc-4191-99c6-23429a267f2e] ha sido realizada.",
  "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": "Acción [CANCEL_NOW Servicio f390422d-4318-4d26-bef0-1ff2208ab409] ha sido realizada.",
  "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": "Acción [CANCEL_NOW Servicio e11d4d5e-8694-4748-a9da-14a0bf0cd69f] ha sido realizada.",
  "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": "Acción [CANCEL_NOW Servicio 1d4c6f4c-18a8-43d9-be1d-be27ad4b7fcc] ha sido realizada.",
  "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": "Acción [CANCELAR Servicio b3468b8d-9c00-46cd-bb06-899681226a10] se ha realizado.",
  "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": "Acción [CANCEL_NOW Servicio b3468b8d-9c00-46cd-bb06-899681226a10] ha sido realizada.",
  "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": "Acción [CANCELAR Servicio b3468b8d-9c00-46cd-bb06-899681226a10] se ha realizado.",
  "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": "Acción [CANCEL_NOW Servicio 0109ae60-7930-40f4-a4f2-5c26c0843f36] ha sido realizada.",
  "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": "Acción [CANCEL_NOW Servicio 1445a5b1-1f09-4ad0-a467-f9436da898af] ha sido realizada.",
  "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": "Acción [CANCELAR Servicio 1f1ffdc2-2967-431f-a6f2-b6adbab63fa6] ha sido realizada.",
  "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": "Acción [CANCEL_NOW Servicio 1f1ffdc2-2967-431f-a6f2-b6adbab63fa6] ha sido realizada.",
  "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": "Acción [CANCEL_NOW Servicio 3af07097-c7f8-4590-bb96-4f9172ede274] ha sido realizada.",
  "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()
```