NOWPayments 使用账户会话管理充值订单;仅 IPN 由供应商携带 x-nowpayments-sig 调用。先检查当前充值能力,USD 美分与 credit_micro 为不同单位。保留原订单和 Idempotency-Key,unknown 不重建 invoice;只有官方查询核实足额 finished 才唯一入账。签名为递归排序 JSON 的 HMAC SHA512,不能由浏览器伪造付款。
身份要求
管理员. 会话/管理写操作不在公共 Playground 执行。
接口
curl --request GET 'https://api.oneaster.ai/core/v1/admin/billing/nowpayments/orders' \ --header 'Authorization: Bearer '"$ONEASTER_SESSION_TOKEN"
参数
- page (query, 可选): {"type":"integer","minimum":1,"maximum":1000000,"default":1}
- size (query, 可选): {"type":"integer","minimum":1,"maximum":100,"default":20}
- state (query, 可选): {"enum":["creating","unknown","open","paid","expired","failed"]}
- user_id (query, 可选): {"type":"string","pattern":"^[1-9][0-9]*$"}
- archived (query, 可选): {"enum":["false","true","all"],"default":"false"} 默认仅未归档,true 仅归档,all 包括两者;本人查询仍只读本人订单。
- order_id (query, 可选): {"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"} OneAster 订单 UUID,遵循现有 UUID 校验规则并精确匹配。
- invoice_id (query, 可选): {"type":"string","pattern":"^[1-9][0-9]{0,127}$"} NOWPayments invoice ID,规范正整数字符串,精确匹配。
响应
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]+$"
},
"currency": {
"const": "usd"
},
"amount_usd_cents": {
"type": "string",
"pattern": "^(?:[1-9][0-9]{2,5}|1000000)$",
"maxLength": 7,
"description": "NOWPayments USD整数美分,100–1000000($1–$10000);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"
]
},
"invoice_id": {
"anyOf": [
{
"type": "string",
"pattern": "^[0-9]+$"
},
{
"type": "null"
}
]
},
"checkout_url": {
"anyOf": [
{
"type": "string",
"format": "uri",
"description": "仅本人未归档且付款窗口未超时的 open 订单返回托管付款链接;旧订单没有本地截止时间。"
},
{
"type": "null"
}
]
},
"latest_payment_status": {
"anyOf": [
{
"enum": [
"waiting",
"confirming",
"confirmed",
"sending",
"partially_paid",
"finished",
"failed",
"refunded",
"expired"
]
},
{
"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"
}
]
},
"archived": {
"type": "boolean"
},
"archived_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
]
},
"pay_currency": {
"anyOf": [
{
"enum": [
"usdttrc20",
"usdtbsc",
"usdterc20",
"usdtmatic",
"usdcsol",
"usdcbsc",
"usdc",
"usdcmatic"
]
},
{
"type": "null"
}
]
},
"expires_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
]
},
"payment_window_expired": {
"type": "boolean"
}
},
"required": [
"id",
"user_id",
"currency",
"amount_usd_cents",
"credit_micro",
"state",
"invoice_id",
"checkout_url",
"latest_payment_status",
"created_at",
"updated_at",
"paid_at",
"archived",
"archived_at",
"pay_currency",
"expires_at",
"payment_window_expired"
]
}
}
},
"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"
]
}
}
}