Administrator

GET /core/v1/admin/topup-orders

Administrator · GET /core/v1/admin/topup-orders

Stripe remains disabled and its routes support test mode only. The global payment_enabled flag does not establish Stripe availability. Webhooks require server verification of an official signature over unmodified raw bytes.

Authentication

Administrator. Session/administrative writes are not executed in the public Playground.

Endpoint

curl --request GET 'https://api.oneaster.ai/core/v1/admin/topup-orders' \
  --header 'Authorization: Bearer '"$ONEASTER_SESSION_TOKEN"

Parameters

- page (query, Optional): {"type":"integer","minimum":1,"maximum":1000000,"default":1}

- size (query, Optional): {"type":"integer","minimum":1,"maximum":100,"default":20}

- state (query, Optional): {"enum":["creating","unknown","open","paid","expired","failed"]}

- user_id (query, Optional): {"type":"string","pattern":"^[1-9][0-9]*$"}

Responses

200

管理员测试订单;不返回支付链接

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "page": {
              "type": "integer",
              "minimum": 0
            },
            "size": {
              "type": "integer",
              "minimum": 0
            },
            "total": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "user_id": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  },
                  "mode": {
                    "const": "test"
                  },
                  "currency": {
                    "const": "usd"
                  },
                  "amount_usd_cents": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$",
                    "maxLength": 6,
                    "description": "USD整数美分;不是积分。1美分=10000 OneAster整数账务单位。"
                  },
                  "credit_micro": {
                    "type": "string",
                    "pattern": "^[0-9]+$",
                    "description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
                  },
                  "state": {
                    "enum": [
                      "creating",
                      "unknown",
                      "open",
                      "paid",
                      "expired",
                      "failed"
                    ]
                  },
                  "stripe_session_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "checkout_url": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "description": "仅本人未支付open订单返回;仅checkout.stripe.com可信URL。"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "updated_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "paid_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "user_id",
                  "mode",
                  "currency",
                  "amount_usd_cents",
                  "credit_micro",
                  "state",
                  "stripe_session_id",
                  "checkout_url",
                  "created_at",
                  "updated_at",
                  "paid_at"
                ]
              }
            }
          },
          "required": [
            "page",
            "size",
            "total",
            "items"
          ]
        }
      },
      "required": [
        "success",
        "data"
      ]
    }
  }
}

default

错误代码见 core-api.md;供应商/数据库错误已隐藏。

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "type": {
              "const": "oneaster_error"
            }
          },
          "required": [
            "code",
            "message",
            "type"
          ]
        },
        "data": {
          "type": "null"
        }
      },
      "required": [
        "success",
        "error",
        "data"
      ]
    }
  }
}