订单
订单状态
以标准格式返回一个订单或最多 100 个订单的当前状态,并附带清晰的额外字段:退款、原因,以及此刻能否取消或补充。同一份数据同时供给 order_details 和 webhook,因此它们始终一致。
POST
https://notpanel.com/api/v3action=status- 需要 API key
- 请求过于频繁
- 请求体:
application/x-www-form-urlencoded
参数
始终发送
keystring必需- 你的 API key。
actionstring必需status必须是字面字符串 “status”。
发送 order 或 orders。
orderinteger以下之一- 一个订单号。2026-08-25 之前下的订单仍可用当时分配的 ID 读取;响应使用订单号。
ordersstring (CSV)以下之一- 最多 100 个以逗号分隔的订单号。两者都发送时,以
orders为准。
curl -X POST https://notpanel.com/api/v3 \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "key=YOUR_API_KEY&action=status&order=1234568"const res = await fetch("https://notpanel.com/api/v3", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
key: "YOUR_API_KEY",
action: "status",
order: "1234568",
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://notpanel.com/api/v3",
data={
"key": "YOUR_API_KEY",
"action": "status",
"order": "1234568",
},
)
print(res.json())<?php
$body = http_build_query([
'key' => 'YOUR_API_KEY',
'action' => 'status',
'order' => '1234568',
]);
$response = file_get_contents('https://notpanel.com/api/v3', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
'content' => $body,
'ignore_errors' => true,
],
]));
print_r(json_decode($response, true));
将 YOUR_API_KEY 替换为 API 页面中的密钥。
{
"charge": "0.87",
"start_count": "3572",
"status": "Partial",
"remains": "157",
"currency": "USD",
"order": 1234568,
"status_key": "partial",
"refund": "0.13",
"reason_code": "partially_delivered",
"reason": "Part of the order was delivered. The rest was refunded.",
"can_cancel": false,
"cancel_available": false,
"cancel_state": null,
"can_refill": true,
"refill_available_at": null,
"updated_at": "2026-10-03T12:00:00Z"
}错误
- 400
{"error":"Missing required parameter: order","error_code":"MISSING_PARAMETER","retryable":false,"details":{"param":"order"}}既没有发送 order,也没有发送 orders。
- 400
{"error":"Maximum 100 IDs per request","error_code":"TOO_MANY_IDS","retryable":false}orders 中的订单号超过 100 个。
- 404
{"error":"Order not found","error_code":"ORDER_NOT_FOUND","retryable":false}订单不存在或属于其他账户。两种情况的响应相同。
响应字段
前五个字段保持面板脚本读取的标准结构,order 重复订单号。其余为新增字段。
响应字段
chargestring- 订单现在对你的花费,以美元计,字符串形式。已扣除任何退款。
start_countstring- 交付开始时的计数;未知时为
"0"。 statusstring- 状态词。见状态值。
remainsstring- 尚未交付的数量。已完成的订单始终显示
"0"。 currencystring- 始终为
USD。 orderinteger- 订单号。
status_keystring- 状态的稳定小写形式,用于逻辑判断。
refundstring- 此订单退回钱包的金额(字符串);未退款时为
0.00。 reason_codestring | null- 订单以这种方式结束的原因,或
null。见原因代码。 reasonstring | nullreason_code对应的固定英文句子,或null。can_cancelboolean- 当前可以取消(即时取消或以请求方式)时为
true。 cancel_availableboolean- 订单当前可全额退款取消时为
true:下单后的最初几秒内,或订单仍在等待且从未发送时。 cancel_statestring | null- 取消请求之后为
requested或refused,否则为null。 can_refillboolean- 当前可以申请补充时为
true。 refill_available_atstring | null- 下一次补充何时可用,或
null。 updated_atstring- 订单最后一次变化的时间。
状态值
- Pending
status_key=pendingPending— 已接受但尚未发送。最初 15 秒内可免费取消订单。 - Processing
status_key=processingProcessing— 已发送,等待交付开始。发送未被确认的订单也会显示为处理中。 - In progress
status_key=in_progress— 交付进行中。
- Completed
status_key=completedCompleted— 已完全交付。remains始终为"0"。 - Partial
status_key=partialPartial— 订单已部分交付,其余部分已退款。可能可以补充。 - Canceled
status_key=cancelledCanceled— 不会再交付任何内容,费用已全额或部分退款。reason_code说明原因。
原因代码
订单提前结束时,reason_code 说明原因,reason 包含固定句子。金额在 refund 中,绝不在句子里。请把未知代码当作通用原因处理:可能会新增代码。
原因代码与句子
customer_canceled- You canceled this order. The charge was refunded.
canceled_on_request- Canceled at your request. The charge was refunded.
canceled_on_request_partial- Canceled at your request. Part of the order was delivered. The rest was refunded.
canceled_overdue- Canceled because it took too long. The charge was refunded.
delivery_canceled- This order was canceled. The charge was refunded.
partially_delivered- Part of the order was delivered. The rest was refunded.
link_invalid- The link is wrong or private. The charge was refunded.
link_busy- This link already had an active order. The charge was refunded.
service_unavailable- The service was not available. The charge was refunded.
quantity_rejected- The quantity was not accepted. The charge was refunded.
details_rejected- The order details were not accepted. The charge was refunded.
price_changed- The price changed before the order started. The charge was refunded.
start_failed- The order could not be started. The charge was refunded.
not_started_in_time- The order could not be started in time. The charge was refunded.
admin_refund- Refunded by support.
admin_completed- Marked completed by support.
legacy_canceled- Canceled.
legacy_refunded- Refunded.
退款与费用
key=YOUR_API_KEY&action=status&order=1234569{
"charge": "0.00",
"start_count": "0",
"status": "Canceled",
"remains": "1000",
"currency": "USD",
"order": 1234569,
"status_key": "cancelled",
"refund": "1.20",
"reason_code": "customer_canceled",
"reason": "You canceled this order. The charge was refunded.",
"can_cancel": false,
"cancel_available": false,
"cancel_state": null,
"can_refill": false,
"refill_available_at": null,
"updated_at": "2026-10-03T10:00:09Z"
}一次处理多个订单
使用 orders 时,响应是以每个请求 ID 为键的对象。每个 ID 得到它的状态对象或错误对象,HTTP 状态仍为 200。每次请求最多 100 个 ID。
key=YOUR_API_KEY&action=status&orders=1234567,1234568,999{
"999": {
"error": "Order not found",
"error_code": "ORDER_NOT_FOUND",
"retryable": false
},
"1234567": {
"charge": "1.20",
"start_count": "3572",
"status": "Completed",
"remains": "0",
"currency": "USD",
"order": 1234567,
"status_key": "completed",
"refund": "0.00",
"reason_code": null,
"reason": null,
"can_cancel": false,
"cancel_available": false,
"cancel_state": null,
"can_refill": false,
"refill_available_at": "2026-10-03T18:35:00Z",
"updated_at": "2026-10-03T12:35:00Z"
},
"1234568": {
"charge": "0.87",
"start_count": "3572",
"status": "Partial",
"remains": "157",
"currency": "USD",
"order": 1234568,
"status_key": "partial",
"refund": "0.13",
"reason_code": "partially_delivered",
"reason": "Part of the order was delivered. The rest was refunded.",
"can_cancel": false,
"cancel_available": false,
"cancel_state": null,
"can_refill": true,
"refill_available_at": null,
"updated_at": "2026-10-03T12:00:00Z"
}
}