Skip to content

POST Create Tariff Template endpoint.

Endpoint

POST/web/v1/system/tariffs/templates/create WEB

Authentication

  • Chain: WEB
  • JWT Token: true
  • API Key: false
  • Permissions: ["tariff:write"]

Rate Limit

Standard rate limit applies.

Headers

Frontend Headers

HeaderRequiredDescription
X-LOCALEYes用户的 locale
Accept-LanguageNo语言偏好

Cloudflare Headers

HeaderRequiredDescription
CF-Connecting-IPYesClient IP from Cloudflare
CF-IPCountryYesClient country code
CF-RayYesCloudflare Ray ID
CF-VisitorYesVisitor scheme
CF-WorkerNoCloudflare Worker indicator
CF-TCP-PortNoClient TCP port
CF-Edge-Keep-AliveNoEdge keep-alive status
CF-Cache-StatusNoCache status
CDN-LoopNoCDN loop detection
X-Real-IPYesReal client IP

Nginx Headers

HeaderRequiredDescription
X-PORTAL-ACCESS-CODEYesPortal access code
X-Real-IPYes客户端真实 IP
X-Forwarded-ForYes代理链
X-Forwarded-ProtoYes协议

Request Parameters

Body (JSON)

FieldTypeRequiredDescription
templateCodeStringYes模板编码 (必填, 最长 64 字符)
templateNameStringYes模板名称 (必填, 最长 128 字符)
descriptionStringNo描述 (可选, 最长 512 字符)
tariffModelStringYes费率模型 (必填, 如 FIXED, PERCENTAGE, TIERED)
fixedAmountBigDecimalYes固定金额 (可选)
rateBigDecimalYes费率比例 (可选)
floorAmountBigDecimalYes费用下限 (可选)
ceilingAmountBigDecimalYes费用上限 (可选)
amountScaleShortNo金额精度 (默认 2)
roundingModeStringNo舍入模式 (默认 HALF_UP)
bandsConfigStringNo分段配置 JSON (可选)
isDefaultBooleanYes是否默认模板 (必填)

Response

200 OK

FieldTypeDescription
data.bizIdString业务 ID
data.templateCodeString模板编码
data.templateNameString模板名称
data.descriptionString描述
data.tariffModelString费率模型
data.fixedAmountBigDecimal固定金额
data.rateBigDecimal费率比例
data.floorAmountBigDecimal费用下限
data.ceilingAmountBigDecimal费用上限
data.amountScaleShort金额精度
data.roundingModeString舍入模式
data.bandsConfigString分段配置 JSON
data.isDefaultBoolean是否默认模板
data.enabledBoolean是否启用
data.createdAtInstant创建时间
data.updatedAtInstant更新时间

Phase 3 Simulation

SlaunchX Internal Documentation