POST/api/v1/orders创建订单(HTTP 镜像)

创建一笔收款订单。业务服务经 NATS subject payment.order.create 创建;本 HTTP 端点供内部工具使用,语义相同。

Request

Headers

NameData TypeRequiredDescription
AuthorizationstringYes会话令牌认证,格式 `Bearer <sessionToken>`
Content-TypestringYes请求体内容类型(默认值 "application/json")
type RequestHeaders = {
  /** 会话令牌认证,格式 `Bearer <sessionToken>` */
  Authorization: string
  /** 请求体内容类型,默认值 "application/json" */
  Content-Type: string
}
{
  "Authorization": "Bearer st_7c1f9e05b28d4a63",
  "Content-Type": "application/json"
}

Body

NameData TypeRequiredDescription
userIdstringYes下单用户 ID
titlestringYes订单标题
businessServicestringYes业务服务标识
amountnumberYes金额
currencystringYes币种,如 USD
descriptionstringNo订单说明
type RequestBody = {
  /** 下单用户 ID */
  userId: string
  /** 订单标题 */
  title: string
  /** 业务服务标识 */
  businessService: string
  /** 金额 */
  amount: number
  /** 币种,如 USD */
  currency: string
  /** 订单说明 */
  description?: string
}
{
  "userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
  "title": "Xeegam Cloud · 专业版年付",
  "businessService": "cloud",
  "amount": 288,
  "currency": "USD",
  "description": "专业版年付订阅"
}

Response

Body

NameData TypeRequiredDescription
orderIdstringYes订单 ID
userIdstringYes用户 ID
titlestringYes订单标题
businessServicestringYes业务服务
amountnumberYes金额
currencystringYes币种
statusstringYes固定为 pending
createdAtstringYes创建时间
type ResponseBody = {
  /** 订单 ID */
  orderId: string
  /** 用户 ID */
  userId: string
  /** 订单标题 */
  title: string
  /** 业务服务 */
  businessService: string
  /** 金额 */
  amount: number
  /** 币种 */
  currency: string
  /** 固定为 pending */
  status: string
  /** 创建时间 */
  createdAt: string
}
{
  "orderId": "01JD8SNZFT8A1B7HB",
  "userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
  "title": "Xeegam Cloud · 专业版年付",
  "businessService": "cloud",
  "amount": 288,
  "currency": "USD",
  "status": "pending",
  "createdAt": "2026-10-14T15:00:00Z"
}

HTTP Code

HTTP Status Meaning Notes
200 成功 返回新订单

Response Code

响应使用统一信封 {id, code, messages, result},其 code 字段:

code Meaning Notes
0 成功 返回新订单

Examples

POST /api/v1/orders
Authorization: Bearer st_7c1f9e05b28d4a63
Content-Type: application/json

{
  "userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
  "title": "Xeegam Cloud · 专业版年付",
  "businessService": "cloud",
  "amount": 288,
  "currency": "USD"
}
{
  "id": "01JD8SSQGL5G3IB",
  "code": 0,
  "messages": [],
  "result": {
    "orderId": "01JD8SNZFT8A1B7HB",
    "userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
    "title": "Xeegam Cloud · 专业版年付",
    "businessService": "cloud",
    "amount": 288,
    "currency": "USD",
    "status": "pending",
    "createdAt": "2026-10-14T15:00:00Z"
  }
}