57 lines
2.9 KiB
YAML
57 lines
2.9 KiB
YAML
openapi: 3.0.3
|
||
info:
|
||
title: 海外客户下单预估资金校验
|
||
version: 1.0.0
|
||
description: Finance异步冻结成功后才能创建客户采购/本土卡车订单。余额优先、授信补足及不足判断由Finance原子执行;本服务不自行修改钱包。创建订单须使用相同幂等键、金额及币种。未绑定预占15分钟过期;订单终态释放,释放失败重试。预占独立于最终人工费用结算。
|
||
security:
|
||
- bearerAuth: []
|
||
paths:
|
||
/api/merchant/v1/last-leg/order-budgets/{kind}/{key}:
|
||
parameters:
|
||
- {name: kind, in: path, required: true, schema: {type: string, enum: [procurement, trucking]}}
|
||
- {name: key, in: path, required: true, schema: {type: string, minLength: 1, maxLength: 128}}
|
||
post:
|
||
summary: 发起冻结或读取原请求,失败后可用原键重试
|
||
description: 客户身份仅来自认证。procurement需要merchant:cross-border:procurement:create,trucking需要merchant:cross-border:domestic-trucking:create;权限不能交叉使用。采购金额是预算单价乘采购数量,免费样品零金额不发资金指令;卡车金额必须大于0。重试禁止更改金额或币种。
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
type: object
|
||
required: [amount, currency]
|
||
properties:
|
||
amount: {type: number, minimum: 0, multipleOf: 0.01}
|
||
currency: {type: string, enum: [CNY, USD]}
|
||
responses:
|
||
'200': {$ref: '#/components/responses/Result'}
|
||
'403': {description: 身份或业务创建权限不足}
|
||
get:
|
||
summary: 读取当前客户本次下单的权威资金回执
|
||
description: 与POST相同创建权限;只有usable=true才允许继续下单。FREEZE_PENDING处理期间应轮询,超时保留原键重试;失败显示Finance返回原因。
|
||
responses:
|
||
'200': {$ref: '#/components/responses/Result'}
|
||
'403': {description: 身份或业务创建权限不足}
|
||
components:
|
||
securitySchemes:
|
||
bearerAuth: {type: http, scheme: bearer, bearerFormat: JWT}
|
||
responses:
|
||
Result:
|
||
description: 统一业务响应;code为字符串200表示查询或发起成功,不等于资金冻结成功。
|
||
content:
|
||
application/json:
|
||
schema:
|
||
type: object
|
||
properties:
|
||
code: {type: string}
|
||
message: {type: string}
|
||
data:
|
||
type: object
|
||
required: [status, amountCny, message, usable]
|
||
properties:
|
||
status: {type: string, enum: [FREEZE_PENDING, FROZEN, FAILED, RELEASE_PENDING, RELEASE_FAILED, RELEASED]}
|
||
amountCny: {type: number, minimum: 0}
|
||
message: {type: string}
|
||
orderNo: {type: string, nullable: true}
|
||
usable: {type: boolean}
|