> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# 刷新 AceDataCloud 平台订单状态

> Platform 集成指南 - Ace Data Cloud

主动查询订单对应支付方式的最新状态并同步到平台。该请求可能访问支付服务并改变订单状态，只在回调延迟或需要立即确认时使用。

## 准备工作

* 使用 [Account Token](https://platform.acedata.cloud/documents/platform-token)。
* 从[订单列表](https://platform.acedata.cloud/documents/platform-order-list)取得本人订单 ID。

```shell theme={null}
export PLATFORM_TOKEN='你的账户令牌'
export ORDER_ID='你的订单 ID'
```

## 接口概览

| 项 | 内容 |
| - | - |
| 方法 | `POST` |
| URL | `https://platform.acedata.cloud/api/v1/orders/{order_id}/refresh/` |
| 鉴权 | 订单所有者或超级管理员 |
| Body | 通常为空；PayPal 回调场景可需要 `payer_id` / `PayerID` |

```shell theme={null}
curl -X POST \
  "https://platform.acedata.cloud/api/v1/orders/${ORDER_ID}/refresh/" \
  -H "Authorization: Bearer ${PLATFORM_TOKEN}"
```

成功返回刷新后的完整 Order 对象。使用 `state` 判断结果，并以 `finished_at` 作为完成时间；当前模型没有 `paid_at` 字段。状态值包括 `Pending`、`Paid`、`Finished`、`Expired`、`Failed`、`Refunded`。

支付截止时间只会将仍处于 `Pending` 的订单改为 `Expired`。已退款的 `Refunded` 订单在刷新或收到延迟支付回调后仍保持已退款状态。

## 重试建议

* 正常支付优先依赖平台回调；只有状态迟迟不更新时才主动 refresh。
* 不要固定高频轮询。建议指数退避，并在明确终态后停止。
* `401` 表示令牌无效；`403` 表示不是订单所有者；`404` 表示订单不存在。
* 支付服务查询失败时，保留订单 ID 和 trace ID，稍后重试；不要创建重复订单来替代状态确认。

## 相关接口

* [获取订单详情](https://platform.acedata.cloud/documents/platform-order-detail)
* [支付订单](https://platform.acedata.cloud/documents/platform-order-pay)
* [获取订单列表](https://platform.acedata.cloud/documents/platform-order-list)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.