> ## 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 API guide - 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'
```

## API 概要

| 項目 | 内容 |
| - | - |
| メソッド | `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 に含まれる場合があり、支払い方法だけで独自に推測することはできません。

## 関連 API

* [チャージ注文を作成する](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.