订单
获取多个订单
GET
/orders
查询参数
product_id
整型
产品ID
page
整型
页数
per_page
整型
每页获取的订单数
location_id
整型
位置ID
status
字符串
订单状态
unpaid
in-progress
confirmed
refunded
expired
note_search
字符串
要搜索的订单备注字段中的短语
order_ids
数组
目标订单的ID
sort_by
字符串
要排序的列。与订单一起使用时为必填项
order
字符串
对订单分类。与sort_by一起使用时为必填项
asc
desc
statuses
数组
订单状态。必须仅包含可用选项中的值。
unpaid
in-progress
confirmed
refunded
expired
status_is_expiring_soon
布尔值
订单是否即将到期
order_billing_type
字符串
订单计费类型
subscription
regular
响应案例:
curl -X GET "https://apid.iproyal.com/v1/reseller/orders?product_id=123&page=1&per_page=10&location_id=456&status=in-progress¬e_search=example%20note&order_ids[]=789&order_ids[]=1011" \
-H "X-Access-Token: <your_access_token>" \
-H "Content-Type: application/json"
响应示例:
{
"data": [
{
"id": 420,
"note": null,
"product_name": "Static Residential",
"expire_date": "2024-04-20 10:25:12",
"plan_name": "30 Days",
"status": "confirmed",
"location": "United States",
"locations": "United States",
"quantity": 5,
"questions_answers": [
{
"question": "Extra requirements (if you have any):",
"answer": "I need 128.158.97"
}
],
"proxy_data": {
"ports": {
"socks5": 12324,
"http|https": 12323
},
"proxies": []
},
"auto_extend_settings": null,
"extended_history": []
},
...
],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 2,
"path": "https://apid.iproyal.com/v1/reseller/orders",
"per_page": 10,
"to": 10,
"total": 14
}
}
获取订单
GET
/orders/{order_id}
响应案例:
curl -X GET "https://apid.iproyal.com/v1/reseller/orders/12345" \
-H "X-Access-Token: <your_access_token>" \
-H "Content-Type: application/json"
响应示例:
{
"id": 420,
"note": null,
"product_name": "Static Residential",
"expire_date": "2024-04-20 10:25:12",
"plan_name": "30 Days",
"status": "expired",
"location": "Canada",
"locations": "Canada",
"quantity": 5,
"questions_answers": [],
"proxy_data": {
"ports": {
"socks5": 12324,
"http|https": 12323
},
"proxies": []
},
"auto_extend_settings": null,
"extended_history": []
}
计算价格
GET
/orders/calculate-pricing
查询参数
product_id
整型
产品ID
product_plan_id
整型
产品套餐ID
product_location_id
整型
产品地理位置ID
quantity
整型
代理数量
coupon_code
字符串
优惠码
order_id
整型
订单编号
order_billing_type
字符串
订单计费类型
subscription
regular
product_question_answers
数组
产品问题答案
响应案例:
curl -X GET "https://apid.iproyal.com/v1/reseller/orders/calculate-pricing?product_id=123&product_plan_id=456&product_location_id=789&quantity=10&coupon_code=DISCOUNT2024" \
-H "X-Access-Token: <your_access_token>" \
-H "Content-Type: application/json"
响应示例:
{
"pre_discount_price": 30,
"price_with_vat": 30,
"vat": null,
"price": 30,
"pre_discount_price_per_item": 3,
"price_per_item": 3,
"plan_discount_percent": 0,
"location_discount_percent": 0,
"coupon_discount_percent": 0,
"quantity_discount_percent": 0,
"total_discount_percent": 0,
"quantity_required_for_next_discount": {
"quantity": 90,
"discount": 5
},
"message": null
}
创建订单
POST
/orders
正文参数
product_id
整型
产品ID
product_plan_id
整型
产品套餐ID
product_location_id
整型
产品地理位置ID
quantity
整型
代理数量
coupon_code
字符串
优惠码
auto_extend
布尔值
订单是否会自动续期 預設值為 true
product_question_answers
数组
问题解答
{ question_id: answer, ... }
card_id
整型
卡号。如果订单通过卡支付,则必须提供卡号,否则会被视为用余额购买
selection
数组
您可以使用 selection.locations
字段提供多个位置及其数量。当您使用此功能时,无需在请求正文中指定product_plan_id
和quantity
量作为顶层参数。
响应案例:
curl -X POST "https://apid.iproyal.com/v1/reseller/orders" \
-H "X-Access-Token: <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"product_id": 123,
"product_plan_id": 456,
"coupon_code": "DISCOUNT2024",
"auto_extend": true,
"product_question_answers": {
"question_id_1": "answer_1",
"question_id_2": "answer_2"
},
"card_id": 1,
"selection": {
"locations": [
{
"product_location_id": 789,
"quantity": 10
}
]
}
}'
响应示例:
{
"id": 420,
"note": null,
"product_name": "Static Residential",
"plan_name": "30 Days",
"expire_date": "2024-04-20 10:25:12",
"status": "expired",
"location": "Canada",
"locations": "Canada",
"quantity": 5,
"questions_answers": [],
"proxy_data": {
"ports": {
"socks5": 12324,
"http|https": 12323
},
"proxies": []
},
"auto_extend_settings": null,
"extended_history": []
}
续期订单
POST
/orders/{order_id}/extend
正文参数
product_plan_id
整型
产品套餐ID
card_id
整型
卡号。如果订单通过卡支付,则必须提供卡号,否则会被视为用余额购买
响应案例:
curl -X POST "https://apid.iproyal.com/v1/reseller/orders/12345/extend" \
-H "X-Access-Token: <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"product_plan_id": 678
}'
响应示例:
{
"id": 420,
"note": null,
"product_name": "Static Residential",
"plan_name": "30 Days",
"expire_date": "2024-04-20 10:25:12",
"status": "expired",
"location": "Canada",
"locations": "Canada",
"quantity": 5,
"questions_answers": [],
"proxy_data": {
"ports": {
"socks5": 12324,
"http|https": 12323
},
"proxies": []
},
"auto_extend_settings": null,
"extended_history": []
}
Last updated