> ## 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

分页返回账户的充值订单，适合查找订单 ID、查看支付状态和对账。

## 准备工作

创建 [Account Token](https://platform.acedata.cloud/documents/platform-token)，并从 `GET /api/v1/platform-tokens/me/` 获取当前账户 UUID。

```shell theme={null}
export PLATFORM_TOKEN='你的账户令牌'
export USER_ID='你的账户 UUID'
```

## 接口概览

| 项 | 内容 |
| - | - |
| 方法 | `GET` |
| URL | `https://platform.acedata.cloud/api/v1/orders/` |
| 鉴权 | Account Token，OAuth token 需 `orders:read` |
| 分页 | `count` + `items` |

普通用户必须传自己的 `user_id`；否则分页遇到无权对象时可能返回 `403`。

## 查询参数

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `user_id` | UUID | 普通用户必填 | 订单所属账户；支持重复参数 |
| `pay_way` | string | 否 | 按支付方式筛选；支持重复或逗号分隔值 |
| `state` | string | 否 | 按状态筛选；支持重复或逗号分隔值 |
| `created_at_from/to` | datetime | 否 | 创建时间范围 |
| `finished_at_from/to` | datetime | 否 | 完成时间范围 |
| `limit` / `offset` | integer | 否 | 分页 |
| `ordering` | string | 否 | `created_at`、`-created_at`、`finished_at` 或 `-finished_at` |

当前列表不支持 `application_id`、`service_id`、`package_id`、`payment_method` 或 `tag` 筛选；支付方式字段名为 `pay_way`。

```shell theme={null}
curl --get 'https://platform.acedata.cloud/api/v1/orders/' \
  --data-urlencode "user_id=${USER_ID}" \
  --data-urlencode 'state=Paid,Finished' \
  --data-urlencode 'pay_way=Stripe' \
  --data-urlencode 'limit=100' \
  -H "Authorization: Bearer ${PLATFORM_TOKEN}"
```

## 响应说明

响应为 `{count, items}`。线上列表项包含 `id`、`user_id`、`application_id/application_ids`、`package_id/package_ids`、`price`、`amount`、`discount`、`remaining_amount`、`state`、`pay_way`、`pay_id`、`pay_url`、`finished_at`、`expired_at`、`invoice`、`metadata` 与时间字段。

* 状态实际为 `Pending`、`Paid`、`Finished`、`Expired`、`Failed`、`Refunded`，没有 `Cancelled`。
* 字段名是 `pay_way`、`finished_at`、`discount` 和 `price`，不是 `payment_method`、`paid_at`、`discount_rate` 或 `final_price`。
* `price` 是订单记录的最终价格；币种和结算细节可能位于受控 metadata，不能仅凭支付方式自行推断。

## 相关接口

* [创建充值订单](https://platform.acedata.cloud/documents/platform-order-create)
* [获取订单详情](https://platform.acedata.cloud/documents/platform-order-detail)
* [支付订单](https://platform.acedata.cloud/documents/platform-order-pay)
* [刷新订单状态](https://platform.acedata.cloud/documents/platform-order-refresh)


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