新购下单

本接口用于新购下单

接口信息

POST /client/order/addStatic

请求头

参数名必选类型说明
x-merchant-tokenstring商户访问令牌
x-merchant-codestring商户编码

请求参数

参数名必选类型说明
countryNumsArray of CountryNumsItemVO国家IP数量分配列表
monthCountLong购买几个月
dayCountLong购买天数(仅支持:7)
currencyString货币类型CNY

CountryNumsItemVO结构

参数名必选类型说明
countryCodeString国家代码
locationString省/州/区
numLong该国家需要的IP数量
ipTypeLong0:广播 1:原生
ipCategoryStringHOST-住宅 IDC-机房
bandwidthInteger带宽规格(Mbps),如 5、10;见下方「带宽说明」

请求示例

const response = await fetch('/client/order/addStatic', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-merchant-token': 'your-token-here',
    'x-merchant-code': 'your-merchant-code'
  },
  body: JSON.stringify({
      "countryNums": [
          {
              "countryCode": "US",
              "num": "2",
              "location" : "New York",
              "ipType":1,
              "ipCategory":"HOST",
              "bandwidth":10
          }
      ],
      "monthCount":1,
      "currency":"CNY"
  })
});

const result = await response.json();

响应结果

{
    "msg": "操作成功",
    "code": 200,
    "data": "N2025032701271232584"
}

带宽说明

countryNums 中每一项必须传入 bandwidth(单位 Mbps,常见取值为 510):

  • 按指定带宽计价、校验库存并开通;若该地区未配置该带宽的售价或库存不足,下单失败。
  • 未传或传 null 时接口返回错误,例如:countryNums[0].bandwidth不能为空
  • 服务端不会再按 10 Mbps → 5 Mbps 自动选档。

建议:先调用 可购地区列表查询,按返回记录中的 bandwidthpriceipTotals 下单,并与本接口传入值保持一致。

注意事项

  1. dayCount参数仅支持7天,并且传入dayCount参数将忽略monthCount参数。
  2. 并非所有地区都支持7天购买,请根据实际情况选择(需要参考 可购地区列表查询 对应带宽记录是否返回 price7 具体价格而定)。
  3. 同一国家/地区若存在多种带宽规格,必须为每一行 countryNums 显式传入目标 bandwidth