惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
爱范儿
爱范儿
The Cloudflare Blog
Y
Y Combinator Blog
B
Blog RSS Feed
Stack Overflow Blog
Stack Overflow Blog
博客园 - 叶小钗
G
Google Developers Blog
J
Java Code Geeks
P
Proofpoint News Feed
美团技术团队
Engineering at Meta
Engineering at Meta
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
有赞技术团队
有赞技术团队
L
LangChain Blog
N
Netflix TechBlog - Medium
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】

Megaport Blog

A Guide to NAT Gateway A Guide to Cloud Storage How the Data Center Is Evolving in 2026 What to Expect When Attending Your First Network Operator Group (NOG) Nine Ways to Connect to Cloud Using Private Connectivity Migrate Your On-premises to the Cloud: A Step-by-Step Guide How to Lower Your Egress Fees in 2026 How to Achieve Data Sovereignty in Europe Cisco and Megaport: Redefining the Edge of Modern Networking How to Reduce Latency in Your Multicloud Environment Introducing Megaport High-Speed Cross-Cloud Encryption Are Businesses Leaving the Cloud? Using Meraki and Megaport Virtual Edge for Multicloud Networking Equinix Metal® is Going Away: Here’s What You Can Do Introducing Megaport On-ramp as a Service Megaport’s Full Solution Portfolio Is Coming to India New Bare-metal GPU Instance Now Available with NVIDIA RTX Pro 6000 A Look Back at 2025: Megaport's Biggest Updates Megaport Expands Into India With Strategic Acquisition of Extreme IX Your 2026 Predictions From AWS re:Invent 2025 What’s Next for NaaS? Top Trends for 2026 What is IPsec? When to Move From Public Internet to Private Connectivity Megaport and Latitude.sh: Bringing Compute and Connectivity Together How to Improve Your Microsoft ExpressRoute Resilience with Megaport Connectivity Comparing Ways to Connect to AWS What is API-First Networking? The Hidden Cost of Running Cloud-Hosted SD-WAN for IaaS How to Overcome NaaS Integration Challenges Introducing SCION with Anapaya and Megaport
API Highlight: Ordering
Megaport · 2015-01-05 · via Megaport Blog

A guide for systematically ordering services using the Megaport API.

In this post we’ll look at the process for systematically ordering services using the Megaport API. Currently there are four service types which can be ordered, three are widely available and the fourth is limited to partners.

  • MEGAPORT
  • IX
  • VXC
  • MEGADIRECT

The IX&#153, VXC&#153 and MEGADIRECT&#153 service types are all dependent on having an existing MEGAPORT service. First, we’ll get a list of locations that are valid for ordering to.

curl -X GET https://api.megaport.com/secure/dropdowns/locations?token=dafb8cd2-762a-4633-943b-7d5886c34124

The data returned is a list of datacentres in the format [id, name, state, country]. Now we have this information lets order a MEGAPORT at Global Switch in Sydney.

# /secure/ecommerce/megaport/order
curl -X POST -H 'Content-Type: application/json' -d
' {
"technicalContactId": "",
"megaPortProvItem": {
   "rackId":
   "DS01-99 R1",
   "opticalInterface": "",
   "speed": 10000,
   "networkServiceType": "MEGAPORT",
   "portId": "1",
   "location_id": "3" },
 "ixProvItem": {},
 "adminContactId": "",
 "companyId": 203,
 "billingContactId": "",
 "productType": "MEGAPORT",
 "customerRequestDate": "2014-12-29T14:00:00.000Z",
 "serviceName": "Test Service"
} '

 https://api.megaport.com/secure/ecommerce/megaport/order?token=dafb8cd2-762a-4633-943b-7d5886c34124

This submits the order for a MEGAPORT without any attached services however you can see in the JSON object that there is scope to order a MEGAPORT with an IX in the same request. Once we POST that to the API server we should get a response that looks something like this:

// [status, service_name, service_id]
["OK","Test Service","501"]

The provisioning process happens within the HTTP request, if an OK response is received then it’s generally safe to assume to assume that the order has been accepted. Resources are also allocated right away so a GET request to /secure/technicalservice/:serviceId will should provide useful data. There is one exception to this however, valid MEGAPORT orders will always be accepted even if the resources aren’t immediately available. Where a MEGAPORT order is accepted but the resources aren’t available, the networkService will remain in the Provisioning state and the resources property will be empty. This shouldn’t happen often but if it does someone will be in touch to provide further information.

Now we have a new MEGAPORT service, lets order a VXC.

# /secure/ecommerce/vxc/order
curl -s -XPOST -H'Content-Type: application/json' -d
' {
  "amazonDirectConnectConfigDto": {
  "type": "private",
  "asn": 65001,
  "authKey": "password1",
  "ownerAccount": "123456789123" },
  "payerMegaPortNsId": "388",
  "nonPayerMegaPortNsId": "720",
  "payerVlanId": 887,
  "nonPayerVlanId": 889,
  "payerStatus": "APPROVED",
  "rateType": "MONTHLY",
  "rollover": true,
  "speed": 100
} '

 https://api.megaport.com/secure/ecommerce/vxc/order?token=dafb8cd2-762a-4633-943b-7d5886c34124

The request above is an example of an AWS Direct Connect order. VXCs to Amazon are automatically approved however this happens in the backend in one of the post-order processing stages so the response object shows the non-payer approval stage as unassessed. A request object to order a VXC to a non-Amazon port is identical, just leave off the amazonDirectConnectConfigDto key. The way this is implementated behind the scenes will be explained in some more detail in an upcoming post on integration. The response object is a bit verbose but contains information on the service,

{
"createDate": 1419666180292,
"vxcOrderId": 267,
"payerMegaPortId": 245,
"nonPayerMegaPortId": 477,
"payerMegaPortName": "The MEGAPORT at Global Switch",
"nonPayerMegaPortName": "Amazon (ap-southeast-2) (Global Switch)",
"payerCompanyId": 203,
"nonPayerCompanyId": 117,
"salesId": null,
"payerCompanyName": "MEGAPORT",
"nonPayerCompanyName": "Amazon",
"payerMegaPortNsId": 388,
"nonPayerMegaPortNsId": 720,
"payerVlanId": 887,
"nonPayerVlanId": 889,
"payerApproverName": null,
"payerApproverId": null,
"nonPayerApproverName": null,
"nonPayerApproverId": null,
"payerApproval": null,
"nonPayerApproval": null,
"fixedTerm": true,
"duration": 1,
"rollover": true,
"name": "from The MEGAPORT at Global Switch to Amazon (ap-southeast-2) (Global Switch)",
"payerStatus": "APPROVED",
"nonPayerStatus": "UN_ASSESSED",
"speed": 100,
"distanceBand": "DATA_CENTRE",
"intercapPath": "",
"awsId": null,
"rateType": "MONTHLY",
"vxcJTechnicalServiceId": 678,
"provisionDate": 1419666180014,
"orderType": "NEW",
"monthlyDiscountAmount": null,
"discountMonths": null,
"amazonDirectConnectConfigDto": null,
"rate": null,
"setup": null
}

Conclusion

Today we covered the service types that are available and how to place orders for the various service types. In the next post we’ll look at how the billing systems work, what payment options we have and how to generate some simple reports.