Administrator

POST /core/v1/admin/topup-orders/{id}/reconcile

Administrator · POST /core/v1/admin/topup-orders/{id}/reconcile

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 POST 'https://api.oneaster.ai/core/v1/admin/topup-orders/00000000-0000-4000-8000-000000000001/reconcile' \
  --header 'Authorization: Bearer '"$ONEASTER_SESSION_TOKEN"

Parameters

- id (path, Required): {"type":"string","format":"uuid"}

Responses

200

对已知Session只读查证并原子核账;不创建付款会话

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "order": {
              "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"
              ]
            },
            "reused": {
              "type": "boolean"
            }
          },
          "required": [
            "order",
            "reused"
          ]
        }
      },
      "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"
      ]
    }
  }
}