Polyv Help Center

Help Center

console-center-aggregate API Documentation

Updated: 2026-05-21 18:37:38

Place Order for Mall Package Version

API Endpoint

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

API Description

Creates an order based on the mall package version ID.

This API is provided by console-center-aggregate. It first calls MallApiClient#getVersionDetail to retrieve version details, then converts the mall version information into a renewal order model SubmitRenewalOrderReq, and finally reuses the payment-side /api/payment/submit_renewal_order to create the order.

The current implementation handles this as a new purchase, with the order type fixed to 0.

Request Parameters

Parameter Type Required Description
id Integer Yes Mall package version ID

Request Example

{
  "id": 1001
}

Version Detail Conversion Rules

Source Field Target Field Description
id productId Order product ID, converted to string
name productName / packageName Order name, package name
crm_product_id productInfo.productCode CRM product code
description productInfo.packageDesc Package description
unit_price productAmount / productInfo.amount Amount parsed in yuan, productAmount converted to cents
price_cycle + price_cycle_value startDate / endDate / validity / validityUnit Start time takes the current date, end time calculated based on the cycle
resource_quotas.type = main_package billingPlanCode / quantity / billingUnit Main package resource information
resource_quotas.type = function functionList Converted to a feature list recognizable by clearing

Notes:

  • startDate takes the current date, format yyyy-MM-dd.
  • endDate is the start date plus the corresponding cycle minus 1 day.
  • price_cycle mapping rules:
    • month -> validity=1
    • year -> validity=2
    • day -> validity=3
  • price_cycle_value is used directly as validityUnit.
  • If the function item does not exist in resource_quotas, it falls back to using feature_switches to construct functionList.
  • The entity information is derived based on the current account's package status and recent sales opportunities, with the default entity fallback being Guangzhou.

Request Example

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

{
  "id": 1001
}

Response Structure

Response Type: ResponseVO<PackageRenewalOrderVO>

ResponseVO Fields

Field Type Description
code Integer Status code, typically 200 on success
status String success / error
requestId String Request ID
error Object Error message
data PackageRenewalOrderVO Order data

PackageRenewalOrderVO Fields

Field Type Description
orderId String Order ID
tradeNo String Transaction serial number
status Integer Order status
amount Integer Order amount, in cents

Successful Response Example

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

Failed Response Example

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