订单

获取订单列表

GET /residential/orders

查询参数

名称
类型
说明

页码

数值

页数

per_page

数值

每页返回订单数量

查询示例:

curl -X GET "https://resi-api.iproyal.com/v1/residential/orders?page=1&per_page=10" \
     -H "Authorization: Bearer <your_api_token>"

查询结果:

{
  "data": [
    {
      "id": 4,
      "note": null,
      "product_name": "Residential",
      "status": "confirmed",
      "amount": 50,
      "quantity": 10,
      "order_billing_type": "subscription",
      "created_at": "2025-06-26 10:01:50"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 1,
    "per_page": 20,
    "total": 1
  }
}

创建订单

POST /residential/orders

正文参数:

名称
类型
说明

数量

数值

GB大小

coupon_code(优惠码)

字符串

请在此填写可用优惠码

card_id(卡号)

数值

提供卡号,则使用对应卡片付款;否则我们将从账户余额中扣款

order_billing_type(订单支付类型)

字符串

subscription (订购)或regular (常规一次性),默认为 subscription (订购)

查询示例:

curl -X POST https://resi-api.iproyal.com/v1/residential/orders \
     -H "Authorization: Bearer <your_api_token>" \
     -H "Content-Type: application/json" \
     -d '{"quantity": 10}'

查询结果:

{
    "id": 4,
    "note": null,
    "product_name": "Residential",
    "status": "confirmed",
    "amount": 50,
    "quantity": 10,
    "order_billing_type": "subscription",
    "created_at": "2025-06-26 10:01:50"
}

计算价格

GET /residential/orders/calculate-pricing

查询参数:

名称
类型
说明

数量

数值

必填。订购数量。

coupon_code(优惠码)

字符串

选填。订单优惠码。

order_billing_type(订单支付类型)

字符串

subscription (订购)或regular (常规一次性),默认为 subscription (订购)

查询示例:

curl -X GET https://resi-api.iproyal.com/v1/residential/orders/calculate-pricing \
     -H "Authorization: Bearer <your_api_token>" \
     -H "Content-Type: application/json" \
     -d '{"quantity": 10}'

查询结果:

{
  "total": 50
}

Last updated