保利威文档中心

幫助中心

console-center-aggregate 介面文件

更新時間:2026-05-21 18:37:38

商城方案版本下單

介面位址

POST /v3/console/mall-package-version/create-order

介面說明

根據商城方案版本 ID 建立訂單。

目前介面由 console-center-aggregate 提供,內部先呼叫 MallApiClient#getVersionDetail 取得版本詳細資訊,再依商城版本資訊轉換為續約下單模型 SubmitRenewalOrderReq,最終複用支付端 /api/payment/submit_renewal_order 建立訂單。

目前實作依新購處理,訂單類型固定為 0

請求參數

參數名 類型 必填 說明
id Integer 商城方案版本 ID

請求範例

{
  "id": 1001
}

版本詳細資訊轉換規則

來源欄位 目標欄位 說明
id productId 訂單產品 ID,轉字串
name productName / packageName 訂單名稱、方案名稱
crm_product_id productInfo.productCode CRM 商品編碼
description productInfo.packageDesc 方案描述
unit_price productAmount / productInfo.amount 金額依元解析,productAmount 轉成分
price_cycle + price_cycle_value startDate / endDate / validity / validityUnit 開始時間取目前日期,結束時間依週期計算
resource_quotas.type = main_package billingPlanCode / quantity / billingUnit 主方案資源資訊
resource_quotas.type = function functionList 轉為 clearing 可辨識的功能列表

說明:

  • startDate 取目前日期,格式 yyyy-MM-dd
  • endDate 為開始日期加上對應週期後減 1 天。
  • price_cycle 對應規則:
    • month -> validity=1
    • year -> validity=2
    • day -> validity=3
  • price_cycle_value 直接作為 validityUnit
  • resource_quotas 中若不存在 function 項,則回退使用 feature_switches 建構 functionList
  • 主體資訊會結合目前帳號的方案狀態、最近銷售機會進行推導,預設主體兜底為廣州。

請求範例

POST /v3/console/mall-package-version/create-order
Content-Type: application/json

{
  "id": 1001
}

回傳結構

回傳類型:ResponseVO<PackageRenewalOrderVO>

ResponseVO 欄位

欄位名 類型 說明
code Integer 狀態碼,成功一般為 200
status String success / error
requestId String 請求 ID
error Object 失敗資訊
data PackageRenewalOrderVO 訂單資料

PackageRenewalOrderVO 欄位

欄位名 類型 說明
orderId String 訂單 ID
tradeNo String 交易序號
status Integer 訂單狀態
amount Integer 訂單金額,單位分

成功回傳範例

{
  "code": 200,
  "status": "success",
  "data": {
    "orderId": "202605211830000001",
    "tradeNo": "T202605211830000001",
    "status": 11,
    "amount": 1200000
  }
}

失敗回傳範例

{
  "code": 400,
  "status": "error",
  "error": {
    "code": 400,
    "desc": "参数错误"
  }
}
联系客服,在线咨询