Pricing - Ports and connection

This section provides a comprehensive guide for integrating Console Connect Pricing - Ports and Layer 2 Connection API which accepts an array of port configuration or an array of connection configuration.

Prerequisite

The following requirements must be met to perform the provided code samples.

  1. API Key - Contact the Console Connect Support team to request for an API Key Email: support@consoleconnect.com
  2. Access Rights - User must have role: Network Admin/NETWORKCONTROL. You may verify your role here
  3. Acceptance of Agreement - API users must sign the Specific Terms for API Use.
  4. Your company has been verified on the Console Connect platform.

I. Prerequisite Procedure

I.I Searching Data Center Facilities (DCF)

Below is an example execution of API to filter and return a list Data Center Facilities with details, it accepts criteria(optional), page, and page size query parameters.

curl -X GET "https://api.consoleconnect.com/v2/data-center-facility/search?criteria={}&page=1&pageSize=10"`\
    -H "Authorization: Bearer <API_KEY>"
If the request was successful, it will respond with a detailed list of DCFs.
[{
  "company": {
    "privacy": {
      "network": {
        "mode": "PUBLIC",
        "blackListIds": [],
        "whiteListIds": []
      },
      "community": {
        "mode": "PUBLIC",
        "blackListIds": [],
        "whiteListIds": []
      }
    },
    "addresses": [
      {
        "registered": false,
        "address": "",
        "city": "Hong Kong",
        "state": "",
        "zip": "zipcode",
        "country": "HK",
        "email": null,
        "phone": null,
        "geo": {
          "type": "Point",
          "coordinates": []
        }
      }
    ],
    "parentIds": [],
    "regionalInternetRegistry": [],
    "businessRegistrationCertVerified": "UNVERIFIED",
    "website": "http://www.company.com1",
    "emailDomains": [],
    "industry": "",
    "businessDevelopmentManagerTypePreference": "UNSPECIFIED",
    "isIoTDemoCompany": false
  },
  "username": "DCF_COMPANY_USERNAME",
  "name": "SAMPLE-DCF-NAME",
  "tags": [
    "offnet",
    "monthly-ports"
  ],
  "dataCenterFacility": {
    "airportCodes": [],
    "speeds": [],
    "metroId": "xxxxxxxxxxxxxxxxxxxxxxxx",
    "ready": true,
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "nniReady": true,
    "brandId": null,
    "canBundleCrossConnect": false
  },
  "stats": {
    "members": 0,
    "interconnections": 0,
    "followers": 5,
    "following": 0,
    "privateArticles": 0,
    "privateEvents": 0,
    "privatePosts": 0,
    "articles": 0,
    "events": 0,
    "posts": 0
  },
  "provider": [
    "PCCWGLOBAL"
  ],
  "selectiveQinQTunnelProvider": [],
  "externalId": null,
  "destinationPortOnly": false,
  "verified": true,
  "nnis": null,
  "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
  "bundleCrossConnectChargeId": null,
  "deletedAt": null,
  "createdAt": "2018-02-20T04:49:09.604Z",
  "updatedAt": "2024-07-10T04:22:15.894Z",
  "products": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "companyId": null,
      "dataCenterFacilityId": "xxxxxxxxxxxxxxxxxxxxxxxx",
      "slug": null,
      "status": "PUBLISHED",
      "transactionType": "ENQUIRE",
      "productType": "Data centers",
      "promoted": true,
      "name": "Sample Product Name",
      "headline": "Sample Headline",
      "description": "Demo description",
      "logo": null,
      "overviewImage": null,
      "background": null,
      "categories": [
        "Data Center"
      ],
      "tags": null,
      "promoTitle": "Sample Title",
      "promoHeadline": "Sample Headline",
      "callToActionLabel": "Order rack",
      "callToActionLink": null,
      "vendorUrl": null,
      "hubspotFormId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "productFamilyId": null,
      "isAddon": false,
      "productCode": null,
      "created_at": "2021-02-16T04:18:06.026Z",
      "updated_at": "2021-05-19T06:43:38.193Z"
    }
  ],
  "isFollowing": false
}]

Info

Take note of the DCF ID ([0].id).

II. Calculate Port Pricing

This section is a detailed guideline for calculating Ports with different payload configuration.

II.I. Single Port

This sample calculates a single port with 20 Mbps bandwidth for 1 month duration.

curl -X POST https://api.consoleconnect.com/api/pricing/calculate`\
   -H "Authorization: Bearer <API_KEY>"
   --data-raw '{
    "ports": [
      {
        "dcf: "xxxxxxxxxxxxxxxxxxxxxxxx",
        "speed": 1000,
        "duration": "y"
      }
    ]
   }' 
If the request was successful, it will respond with a list/array of ports or connection pricing details:
{
  "results": [
    {
      "type": "PORT",
      "entity": {
        "dcf": {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "Company A",
          "popId": null,
          "regionIds": null,
          "metroIds": null,
          "tags": null
        },
        "speed": 1000,
        "discountId": "",
        "durationUnit": "y"
      },
      "price": 300,
      "preAuthAmount": 300,
      "amountSaved": null,
      "amountSavedTotal": null,
      "basicTotalAmount": null,
      "basicMonthlyAmount": null,
      "priceCalculatorAttributes": {
        "discountIds": [],
        "discounts": []
      }
    }
  ]
}

II.II. Single Port with Cross Connect

This sample calculates a single port with 1000 Mbps bandwidth for 1 month duration and with a cross-connect add-on.

curl -X POST https://api.consoleconnect.com/api/pricing/calculate`\
   -H "Authorization: Bearer <API_KEY>"
   --data-raw '{
    "ports": [
      {
        "dcf": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "speed": 1000,
        "durationUnit": "y"
      }
    ],
    "includeCrossConnect": true
  }' 
If the request was successful, it will respond with a list/array of ports or connection pricing details:
{
  "results": [
    {
      "type": "PORT",
      "entity": {
        "dcf": {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "Company A",
          "popId": null,
          "regionIds": null,
          "metroIds": null,
          "tags": null
        },
        "speed": 1000,
        "discountId": "",
        "durationUnit": "y"
      },
      "price": 300,
      "preAuthAmount": 300,
      "amountSaved": null,
      "amountSavedTotal": null,
      "basicTotalAmount": null,
      "basicMonthlyAmount": null,
      "priceCalculatorAttributes": {
        "discountIds": [],
        "discounts": []
      },
      "crossConnectAmount": 65
    }
  ]
}

II.III. Multiple Ports

This sample calculates a multiple ports with different bandwidth configuration and duration

curl -X POST https://api.consoleconnect.com/api/pricing/calculate`\
   -H "Authorization: Bearer <API_KEY>"
   --data-raw '{
    "ports": [
      {
        "dcf": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "speed": 10000,
        "durationUnit": "y"
      },
      {
        "dcf": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "speed": 1000,
        "durationUnit": "m"
      }
    ]
  }' 
If the request was successful, it will respond with a list/array of ports or connection pricing details:
{
  "results": [
    {
      "type": "PORT",
      "entity": {
        "dcf": {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "Company A",
          "popId": null,
          "regionIds": null,
          "metroIds": null,
          "tags": null
        },
        "speed": 10000,
        "discountId": "",
        "durationUnit": "y"
      },
      "price": 400,
      "preAuthAmount": 400,
      "amountSaved": null,
      "amountSavedTotal": null,
      "basicTotalAmount": null,
      "basicMonthlyAmount": null,
      "priceCalculatorAttributes": {
        "discountIds": [],
        "discounts": []
      }
    },
    {
      "type": "PORT",
      "entity": {
        "dcf": {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "Company B",
          "popId": null,
          "regionIds": null,
          "metroIds": null,
          "tags": null
        },
        "speed": 1000,
        "discountId": "",
        "durationUnit": "m"
      },
      "price": 450,
      "preAuthAmount": 450,
      "amountSaved": null,
      "amountSavedTotal": null,
      "basicTotalAmount": null,
      "basicMonthlyAmount": null
    }
  ]
}

III. Calculate L2 Connection Pricing

This section is a detailed guideline for calculating Ports with different payload configuration.

III.I. Single Connection

This sample calculates a single connection with 20 Mbps bandwidth for 1 month duration.

curl -X POST https://api.consoleconnect.com/api/pricing/calculate`\
   -H "Authorization: Bearer <API_KEY>"
   --data-raw '{
      "connections": [
        {
          "bandwidth": 20,
          "classOfService": "SILVER",
          "duration": {
            "value": 1,
            "unit": "m"
          },
          "srcDcf": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "destDcf": "xxxxxxxxxxxxxxxxxxxxxxxx"
        }
      ]
    }' 
If the request was successful, it will respond with a list/array of ports or connection pricing details:
{
  "results": [
    {
      "type": "CONNECTION",
      "entity": {
        "srcDcf": {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "Company A",
          "popId": null,
          "regionIds": null,
          "metroIds": null,
          "tags": null
        },
        "destDcf": {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "Company B",
          "popId": null,
          "regionIds": null,
          "metroIds": null,
          "tags": null
        },
        "duration": {
          "from": null,
          "to": null,
          "unit": "m",
          "value": 1
        },
        "bandwidth": 20,
        "classOfService": "SILVER",
        "discountId": ""
      },
      "price": 80,
      "preAuthAmount": 80,
      "amountSaved": null,
      "amountSavedTotal": null,
      "basicTotalAmount": 80,
      "basicMonthlyAmount": 80,
      "formula": "(bandwidthCost*multiplier)*duration/(1-margin)+portFee",
      "factors": [
        {
          "name": "margin",
          "number": 0,
          "ref": null
        },
        {
          "name": "portFee",
          "number": 0,
          "ref": null
        },
        {
          "name": "nniFee",
          "number": 0,
          "ref": null
        },
        {
          "name": "bandwidthCost",
          "number": 80,
          "ref": {
            "from": {
              "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
              "name": "EUROPE/UK",
              "regionIds": [
                "xxxxxxxxxxxxxxxxxxxxxxxx"
              ]
            },
            "to": {
              "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
              "name": "EUROPE/UK",
              "regionIds": [
                "xxxxxxxxxxxxxxxxxxxxxxxx"
              ]
            },
            "price": {
              "price": 1.75,
              "bandwidth": {
                "from": 1,
                "to": 100
              },
              "cos": "SILVER"
            }
          }
        },
        {
          "name": "multiplier",
          "number": 1,
          "ref": null
        },
        {
          "name": "duration",
          "number": 1,
          "ref": null
        }
      ],
      "priceCalculatorAttributes": {
        "discountIds": [],
        "discounts": []
      }
    }
  ]
}

III.I. Multiple Connection

This sample calculates multiple connections with different configuration.

curl -X POST https://api.consoleconnect.com/api/pricing/calculate`\
   -H "Authorization: Bearer <API_KEY>"
   --data-raw '{
  "connections": [
      
        "bandwidth": 20,
        "classOfService": "SILVER",
        "duration": {
          "value": 1,
          "unit": "w"
        },
        "srcDcf": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "destDcf": "xxxxxxxxxxxxxxxxxxxxxxxx"
      },
      {
        "bandwidth": 20,
        "classOfService": "SILVER",
        "duration": {
          "value": 1,
          "unit": "m"
        },
        "srcDcf": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "destDcf": "xxxxxxxxxxxxxxxxxxxxxxxx"
      }
    ]
  }'
If the request was successful, it will respond with a list/array of ports or connection pricing details:
{
  "results": [
    {
      "type": "CONNECTION",
      "entity": {
        "srcDcf": {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "Company A",
          "popId": null,
          "regionIds": null,
          "metroIds": null,
          "tags": null
        },
        "destDcf": {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "Company B",
          "popId": null,
          "regionIds": null,
          "metroIds": null,
          "tags": null
        },
        "duration": {
          "from": null,
          "to": null,
          "unit": "w",
          "value": 1
        },
        "bandwidth": 20,
        "classOfService": "SILVER",
        "discountId": ""
      },
      "price": 28.8,
      "preAuthAmount": 28.8,
      "amountSaved": null,
      "amountSavedTotal": null,
      "basicTotalAmount": 28.8,
      "basicMonthlyAmount": 28.8,
      "formula": "(bandwidthCost*multiplier)*duration/(1-margin)+portFee",
      "factors": [
        {
          "name": "margin",
          "number": 0,
          "ref": null
        },
        {
          "name": "portFee",
          "number": 0,
          "ref": null
        },
        {
          "name": "nniFee",
          "number": 0,
          "ref": null
        },
        {
          "name": "bandwidthCost",
          "number": 80,
          "ref": {
            "from": {
              "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
              "name": "EUROPE/UK",
              "regionIds": [
                "xxxxxxxxxxxxxxxxxxxxxxxx"
              ]
            },
            "to": {
              "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
              "name": "EUROPE/UK",
              "regionIds": [
                "xxxxxxxxxxxxxxxxxxxxxxxx"
              ]
            },
            "price": {
              "price": 1.75,
              "bandwidth": {
                "from": 1,
                "to": 100
              },
              "cos": "SILVER"
            }
          }
        },
        {
          "name": "multiplier",
          "number": 0.36,
          "ref": null
        },
        {
          "name": "duration",
          "number": 1,
          "ref": null
        }
      ],
      "priceCalculatorAttributes": {
        "discountIds": [],
        "discounts": []
      }
    },
    {
      "type": "CONNECTION",
      "entity": {
        "srcDcf": {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "Company A",
          "popId": null,
          "regionIds": null,
          "metroIds": null,
          "tags": null
        },
        "destDcf": {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "Company B",
          "popId": null,
          "regionIds": null,
          "metroIds": null,
          "tags": null
        },
        "duration": {
          "from": null,
          "to": null,
          "unit": "m",
          "value": 1
        },
        "bandwidth": 20,
        "classOfService": "SILVER",
        "discountId": ""
      },
      "price": 80,
      "preAuthAmount": 80,
      "amountSaved": null,
      "amountSavedTotal": null,
      "basicTotalAmount": 80,
      "basicMonthlyAmount": 80,
      "formula": "(bandwidthCost*multiplier)*duration/(1-margin)+portFee",
      "factors": [
        {
          "name": "margin",
          "number": 0,
          "ref": null
        },
        {
          "name": "portFee",
          "number": 0,
          "ref": null
        },
        {
          "name": "nniFee",
          "number": 0,
          "ref": null
        },
        {
          "name": "bandwidthCost",
          "number": 80,
          "ref": {
            "from": {
              "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
              "name": "EUROPE/UK",
              "regionIds": [
                "xxxxxxxxxxxxxxxxxxxxxxxx"
              ]
            },
            "to": {
              "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
              "name": "EUROPE/UK",
              "regionIds": [
                "xxxxxxxxxxxxxxxxxxxxxxxx"
              ]
            },
            "price": {
              "price": 1.75,
              "bandwidth": {
                "from": 1,
                "to": 100
              },
              "cos": "SILVER"
            }
          }
        },
        {
          "name": "multiplier",
          "number": 1,
          "ref": null
        },
        {
          "name": "duration",
          "number": 1,
          "ref": null
        }
      ]
    }
  ]
}