订单
获取订单列表
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>"<?php
$api_token = '<your_api_token>';
$url = 'https://resi-api.iproyal.com/v1/residential/orders?page=1&per_page=10';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPGET, true);
$headers = [
"Authorization: Bearer $api_token"
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
?>查询结果:
{
"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 (订购)
查询示例:
查询结果:
计算价格
GET /residential/orders/calculate-pricing
查询参数:
名称
类型
说明
数量
数值
必填。订购数量。
coupon_code(优惠码)
字符串
选填。订单优惠码。
order_billing_type(订单支付类型)
字符串
subscription (订购)或regular (常规一次性),默认为 subscription (订购)
查询示例:
查询结果:
Last updated