Skip to content

Creating a Port with the API

This topic steps through the API procedure to create a Port, including how to look up Port locations, validate the Port and determine the cost, order the Port, and download an LOA. An example in cURL appears after the Postman example.

Before you begin, obtain a valid access token. For more information, see Creating an API Key.

To look up Port location details in the Postman collection

  1. Click Locations in the left navigation and click GET Locations.
    This request is not expecting Parameters or Body information.

  2. Click Send to make the request.

    GET {baseUrl}/v2/locations

    Get locations

    Ensure the request was successful by looking for Status: 200 OK and display the response in the Body section in the Pretty format.

    The request returns hundreds of Port locations. You can search by clicking the magnifying glass and entering a specific city, data center, or other parameter in the search field. This example uses the Digital Realty, London location.

            "country": "United Kingdom",
            "liveDate": 1467331200000,
            "siteCode": "lon-tc1",
            "networkRegion": "MP1",
            "address": {
                "country": "United Kingdom",
                "city": "London",
                "street": "227 Marsh Wall",
                "postcode": "E14 9SD",
                "suburb": null,
                "state": null
            "campus": "campus_deprecated",
            "latitude": 51.499714,
            "products": {
                "mcr": false,
                "megaport": [
            "market": "UK",
            "metro": "London",
            "name": "Digital Realty LHR20",
            "vRouterAvailable": false,
            "id": 89,
            "dc": {
                "name": "Digital Telx",
                "id": 3
            "status": "Active",
            "longitude": -0.012144,
            "ordering_message": null

To create a Port, you need the market value and id value. In this example, the market is UK and the data center ID is 89.

To test and validate the Port order

  1. In Postman, open the Ports folder in the left navigation and select POST Validate Port Order (v3).

  2. Update the Body with the locationId (89), term (number of months - 1, 12, 24, or 36), productName (whatever name you want for your Port), portSpeed (1000, 10000, or 100000 Mbps), and market (UK) and click Send.

    "locationId": 89,
    "term": 1,
    "locationUid": null,
    "productName": "API Port",
    "productType": "MEGAPORT",
    "createDate": 1452475039656,
    "portSpeed": 1000,
    "virtual": false,
    "promoCode": "promox3mnthfree2",
    "market": "UK"

A successful response passes validation and has a 200 OK status. The response also includes pricing details of the service.

    "message": "Validation passed",
    "terms": "This data is subject to the Acceptable Use Policy",
    "data": [
            "price": {
                "hourlySetup": 0,
                "dailySetup": 0,
                "monthlySetup": 0,
                "hourlyRate": 0,
                "dailyRate": 0,
                "monthlyRate": 500.00,
                "fixedRecurringCharge": 500.00,
                "postPaidBaseRate": "no base rate",
                "longHaulMbpsRate": 0,
                "mbpsRate": 0,
                "currency": "GBP",
                "key": "no key",
                "productType": "MEGAPORT",
                "empty": false
            "serviceName": "API Port",
            "productType": "MEGAPORT",
            "productUid": "f9859fd3-344d-4a33-8cd2-a3b6ebfaaef0",
            "market": "UK",
            "string": "London"

To order the validated Port

  1. With a validated Port request and reviewed cost information, copy the Body from POST Validate Port Order (v3) and paste into the Body of POST Buy Port (v3).


    If you make this call on, your account will be charged for the service. Alternatively, you can provision against the staging API without charges, as in these examples.

  2. Send the request.
    A successful response includes a technicalServiceUid, which is the same as the productId and productUid.
    For our example, this value is a49cf3f1-20a1-4390-93aa-5005bdafe3d7.

    "message": "MEGAPORT [a49cf3f1-20a1-4390-93aa-5005bdafe3d7] created. ",
    "terms": "This data is subject to the Acceptable Use Policy",
    "data": [
            "serviceName": "API Port",
            "name": "API Port",
            "secondaryName": null,
            "technicalServiceId": 68124,
            "technicalServiceUid": "a49cf3f1-20a1-4390-93aa-5005bdafe3d7",
            "requestedDate": 1588862976322,
            "configuredDate": null,
            "currentEstimatedDelivery": null,
            "companyName": "Megaport Lab",
            "companyId": 2278,
            "aggregationId": null,
            "lagPrimary": false,
            "billingContactName": null,
            "billingContactId": null,
            "adminContactName": null,
            "adminContactId": null,
            "technicalContactName": null,
            "technicalContactId": null,
            "salesName": null,
            "salesId": null,
            "billableId": 56333,
            "billableUsageAlgorithm": "NOT_POST_PAID",
            "productType": "MEGAPORT",
            "provisioningStatus": "DEPLOYABLE",
            "inAdvanceBillingStatus": "NOT_ACTIVATED",
            "provisioningItems": [],
            "tags": [],
            "vxcDistanceBand": null,
            "intercapPath": null,
            "marketplaceVisibility": true,
            "vxcPermitted": true,
            "vxcAutoApproval": false,
            "createDate": 1588862976322,
            "terminationDate": null,
            "contractStartDate": 1588860000000,
            "contractTermMonths": 1,
            "rateType": "MONTHLY",
            "trialAgreement": false,
            "payerCompanyId": null,
            "nonPayerCompanyId": null,
            "minimumSpeed": null,
            "maximumSpeed": null,
            "rateLimit": 10000,
            "errorMessage": null,
            "market": "UK",
            "accountManager": null,
            "promptUid": null,
            "components": [],
            "attributes": [],
            "aLocation": null,
            "bLocation": null,
            "aLocationId": null,
            "bLocationId": null,
            "attributeTags": {},  
            "createdBy":  "a51cc1c6-95a0-48c7-a5a0-e49d77a6c536",
            "buyoutPort": false,
            "virtual": false,
            "locked": false,
            "adminLocked": false

The new Port now appears in your working environment, either or

New API Port


To see all options for the requests used in this example, see

Download the Letter of Authorization

After you create your Port, you can download the Letter of Authorization (LOA).


Before you can download the LOA, the Provisioning Status of the Port must be Configured.

To download the LOA

  1. In Postman, expand Ports in the left navigation and select GET Regenerate LOA for Megaport Service.

  2. In the GET command, replace the productID with the value created during Port creation.

  3. Send the request.

    With a successful 200 OK response, this message appears in the Body section:

    This response could not be previewed. 
    Download the response to open it with an appropriate application.

    This message appears because the LOA is a PDF document and must be downloaded. To download, click Save Response in Postman and save the PDF to a convenient location.

Last update: 2024-05-07