> 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.

# Añadir complemento al MCR existente

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

Utilice este punto final para agregar un **complemento** a un MCR existente.

Estos complementos están disponibles:

* Configuración BGP

* Dirección IP

* IPsec

## Configuración BGP

La carga útil para la configuración BGP es la siguiente:

| Campo          | Formato          | Requerido | Valor                                                                                                                          |
| -------------- | ---------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `addOnType`    | cadena, no vacía | Sí        | BGP\_CONFIG                                                                                                                    |
| `customer_asn` | entero           | Sí        | Número de Sistema Autónomo BGP del cliente                                                                                     |
| `password`     | cadena           |           | Contraseña de autenticación BGP                                                                                                |
| `as_set`       | cadena           |           | Identificador AS-SET para la configuración BGP                                                                                 |
| `route_table`  | cadena, no vacía | Sí        | Tipo de tabla de rutas para la configuración BGP. Valores válidos son: "DEFAULT\_ONLY" "CUSTOMER\_AND\_PEER" "CUSTOMER" "FULL" |
| `prefixes`     | cadena           |           | Prefijos de ruta BGP                                                                                                           |
| `remark`       | cadena           |           | Notas adicionales o comentarios sobre la configuración BGP                                                                     |

Ejemplo:

`{`

`"addOnType": "BGP_CONFIG",`

`"customer_asn": 65000,`

`"password": "SecureBgpPassword12345",`

`"as_set": "AS-EXAMPLE",`

`"route_table": "DEFAULT_ONLY",`

`"prefixes": "192.168.0.0/24,10.0.0.0/16",`

`"remark": "Sesión BGP principal para servicios de producción"`

`}`

## Dirección IP

La carga útil para la dirección IP es la siguiente:

| Campo                        | Formato              | Requerido | Valor                                                                                         |
| ---------------------------- | -------------------- | --------- | --------------------------------------------------------------------------------------------- |
| `addOnType`                  | cadena, no vacía     | Sí        | IP\_ADDRESS                                                                                   |
| `subnetSize`                 | cadena, 3 caracteres | Sí        | Tamaño de la subred a asignar. Valores válidos son: "/24" "/25" "/26" "/27" "/28" "/29" "/30" |
| `purpose`                    | cadena, no vacía     | Sí        | Propósito para el cual se utilizará la dirección IP                                           |
| `projectedUtilizationMonths` | entero requerido     | Sí        |                                                                                               |
| `remark`                     | cadena               |           | Agregar                                                                                       |

Ejemplo:

`{`

`"addOnType": "IP_ADDRESS",`

`"subnetSize": "/29",`

`"purpose": "Servicios orientados al cliente",`

`"projectedUtilizationMonths": 12,`

`"remark": "Requerido para el despliegue de nuestro nuevo servicio web"`

`}`

## IPsec

La carga útil para IPsec es la siguiente:

| Campo         | Formato          | Requerido | Valor                                |
| ------------- | ---------------- | --------- | ------------------------------------ |
| `addOnType`   | cadena, no vacía | Sí        | IP\_SEC                              |
| `tunnelCount` | entero           |           | Número de túneles IPSec a configurar |

Ejemplo:

`{`

`"addOnType": "IP_SEC",`

`"tunnelCount": 30`

`}`

Reference: https://es.megaport.ferndocs.com/es/api-reference/product-details/add-add-on-to-existing-mcr

## 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)

### Body (application/json)

This endpoint expects an object.

- `addOnType` (string, optional)
- `tunnelCount` (double, optional)

## Response

### 201

Agregar Túneles IPsec / Agregar Túneles IPsec / Agregar Túneles IPsec / Agregar Túneles IPsec

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

## Types

### V3ProductProductUidAddonPostResponsesContentApplicationJsonSchemaData

- `addOnType` (string, optional)
- `addOnUid` (string, optional)
- `tunnelCount` (double, optional)

## Examples

### Add IPsec Tunnels

**Response**

```json
{
  "data": {
    "addOnType": "IP_SEC",
    "addOnUid": "4016a82f-0079-4d4e-aba6-eca7670a135a",
    "tunnelCount": 30
  },
  "message": "Se ha creado/solicitado correctamente el complemento IP_SEC.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Add IPsec Tunnels
import requests

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

response = requests.post(url)

print(response.json())
```

```javascript Add IPsec Tunnels
const url = 'https://api.megaport.com/v3/product/productUid/addon';
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 Add IPsec Tunnels
package main

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

func main() {

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

	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 Add IPsec Tunnels
require 'uri'
require 'net/http'

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

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 Add IPsec Tunnels
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Add IPsec Tunnels
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Add IPsec Tunnels
using RestSharp;

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

```swift Add IPsec Tunnels
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/addon")! 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()
```

### Add Add-on to Existing MCR

**Request**

```json
{
  "addOnType": "IP_SEC",
  "tunnelCount": 10
}
```

**Response**

```json
{
  "data": {
    "addOnType": "IP_SEC",
    "addOnUid": "4016a82f-0079-4d4e-aba6-eca7670a135a",
    "tunnelCount": 30
  },
  "message": "Se ha creado/solicitado correctamente el complemento IP_SEC.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Add Add-on to Existing MCR
import requests

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

payload = {
    "addOnType": "IP_SEC",
    "tunnelCount": 10
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript Add Add-on to Existing MCR
const url = 'https://api.megaport.com/v3/product/productUid/addon';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"addOnType":"IP_SEC","tunnelCount":10}'
};

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

```go Add Add-on to Existing MCR
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"addOnType\": \"IP_SEC\",\n  \"tunnelCount\": 10\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 Add Add-on to Existing MCR
require 'uri'
require 'net/http'

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

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  \"addOnType\": \"IP_SEC\",\n  \"tunnelCount\": 10\n}"

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

```java Add Add-on to Existing MCR
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Add Add-on to Existing MCR
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Add Add-on to Existing MCR
using RestSharp;

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

```swift Add Add-on to Existing MCR
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "addOnType": "IP_SEC",
  "tunnelCount": 10
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/addon")! 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()
```

### Add Add-on to Existing Product

**Request**

```json
{
  "addOnType": "IP_SEC",
  "tunnelCount": 30
}
```

**Response**

```json
{
  "data": {
    "addOnType": "IP_SEC",
    "addOnUid": "4016a82f-0079-4d4e-aba6-eca7670a135a",
    "tunnelCount": 30
  },
  "message": "Se ha creado/solicitado correctamente el complemento IP_SEC.",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Add Add-on to Existing Product
import requests

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

payload = {
    "addOnType": "IP_SEC",
    "tunnelCount": 30
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript Add Add-on to Existing Product
const url = 'https://api.megaport.com/v3/product/productUid/addon';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"addOnType":"IP_SEC","tunnelCount":30}'
};

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

```go Add Add-on to Existing Product
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"addOnType\": \"IP_SEC\",\n  \"tunnelCount\": 30\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 Add Add-on to Existing Product
require 'uri'
require 'net/http'

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

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  \"addOnType\": \"IP_SEC\",\n  \"tunnelCount\": 30\n}"

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

```java Add Add-on to Existing Product
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Add Add-on to Existing Product
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Add Add-on to Existing Product
using RestSharp;

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

```swift Add Add-on to Existing Product
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "addOnType": "IP_SEC",
  "tunnelCount": 30
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v3/product/productUid/addon")! 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()
```