Account session

GET /core/v1/billing/nowpayments/orders

Account session · GET /core/v1/billing/nowpayments/orders

NOWPayments orders require an account session; the provider alone calls IPN with x-nowpayments-sig. Check current capabilities and distinguish USD cents from credit_micro. Preserve the original order and Idempotency-Key; unknown does not recreate invoices. Only a verified, sufficiently paid finished payment is credited once. IPN uses recursively sorted JSON HMAC SHA512, not browser-supplied proof.

Authentication

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

Endpoint

curl --request GET 'https://api.oneaster.ai/core/v1/billing/nowpayments/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"]}

- archived (query, Optional): {"enum":["false","true","all"],"default":"false"} 默认仅未归档,true 仅归档,all 包括两者;本人查询仍只读本人订单。

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]+$"
                  },
                  "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"
      ]
    }
  }
}