blob: 08c83a0b6ae956124e1081b02920fc01415a9632 [file] [log] [blame]
components:
schemas:
AccountQueryRequest:
type: object
title: 账户查询请求
required:
- userid
properties:
userid:
title: 用户ID
type: string
subaccounts:
title: 子账户列表
type: array
items:
description: |
需要查询的子账户名,如果查询所有子账户可以用 ['*'] 来查询
type: string
title: 子账户ID
AccountQueryResponse:
type: object
title: 账户查询应答
properties:
userid:
title: 用户ID
type: string
username:
title: 用户名
type: string
status:
title: 账户状态
$ref: 'definitions.yaml#/components/schemas/UserStatus'
balance:
title: 总余额(分)
type: integer
frozenbal:
title: 冻结金额(分)
type: integer
subaccountList:
type: array
title: 子账户列表
items:
title: 子账户属性
$ref: 'definitions.yaml#/components/schemas/SubAccountMetadata'
PreAuthorizedDebitRequest:
type: object
title: 预授权交易请求
required:
- userid
- preAuthorizedAmount
- shopaccno
- transDate
- transTime
properties:
billno:
$ref: 'definitions.yaml#/components/schemas/Refno'
userid:
title: 用户ID
type: string
accountName:
title: 账户名
type: string
preAuthorizedAmount:
title: 预授权金额(分)
type: integer
shopaccno:
$ref: 'definitions.yaml#/components/schemas/ShopAccNo'
transDate:
$ref: 'definitions.yaml#/components/schemas/TransDate'
transTime:
$ref: 'definitions.yaml#/components/schemas/TransTime'
PreAuthorizedDebitResponse:
type: object
title: 预授权交易应答
properties:
refno:
$ref: 'definitions.yaml#/components/schemas/Refno'
result:
$ref: 'definitions.yaml#/components/schemas/TransResult'
message:
type: string
title: 预授权交易信息
PreAuthorizedSettleRequest:
type: object
title: 预授权交易清算
required:
- refno
- billno
- transTime
- transTime
- amount
properties:
refno:
title: 预授权交易系统交易参考号
$ref: 'definitions.yaml#/components/schemas/Refno'
billno:
title: 预授权交易清算订单号
$ref: 'definitions.yaml#/components/schemas/Refno'
transDate:
$ref: 'definitions.yaml#/components/schemas/TransDate'
transTime:
$ref: 'definitions.yaml#/components/schemas/TransTime'
amount:
title: 清算金额, 小于等于预授权金额(分)
type: integer
PreAuthorizedSettleResponse:
type: object
title: 预授权交易清算结果
properties:
refno:
title: 预授权交易清算交易系统交易参考号
$ref: 'definitions.yaml#/components/schemas/Refno'
leftPreAuthorizedAmount:
title: 清算后剩余预授权金额
type: integer
AccountPayRequest:
type: object
title: 主账户余额扣款交易
required:
- billno
- shopaccno
- transTime
- transDate
- userid
- amount
- dtltype
properties:
billno:
title: 交易订单号
$ref: 'definitions.yaml#/components/schemas/Refno'
shopaccno:
$ref: 'definitions.yaml#/components/schemas/ShopAccNo'
transDate:
$ref: 'definitions.yaml#/components/schemas/TransDate'
transTime:
$ref: 'definitions.yaml#/components/schemas/TransTime'
userid:
title: 用户ID
type: string
amount:
title: 扣款金额(分)
type: integer
accountName:
title: 账户名
type: string
description:
title: 交易描述
type: string
dtltype:
title: 交易类型
type: string
default: "pos"
AccountPayResponse:
type: object
title: 账户余额扣款交易应答
required:
- refno
properties:
refno:
title: 系统交易参考号
$ref: 'definitions.yaml#/components/schemas/Refno'
description:
title: 系统返回交易描述
type: string
aftbal:
title: 账户余额(分)
type: integer
realAmount:
title: 实际扣款金额(分)
type: integer
paths:
accountQuery:
parameters:
- $ref: definitions.yaml#/components/headers/TenantId
post:
tags:
- pos
requestBody:
description: 账户余额查询
content:
application/json:
schema:
$ref: '#/components/schemas/AccountQueryRequest'
responses:
'200':
description: 查询账户成功
content:
application/json:
schema:
$ref: '#/components/schemas/AccountQueryResponse'
'404':
description: 指定用户不存在
content:
application/json:
schema:
$ref: 'definitions.yaml#/components/schemas/ErrorResponse'
default:
$ref: 'definitions.yaml#/components/responses/CommonError'
accountPay:
parameters:
- $ref: definitions.yaml#/components/headers/TenantId
post:
tags:
- pos
requestBody:
description: 主账户余额消费
content:
application/json:
schema:
$ref: '#/components/schemas/AccountPayRequest'
responses:
'200':
description: 账户消费成功
content:
application/json:
schema:
$ref: '#/components/schemas/AccountPayResponse'
'400':
description: |
消费失败, code 用于定义错误信息
* short_of_balance 余额不足
* account_status_error 账户状态异常
content:
application/json:
schema:
$ref: 'definitions.yaml#/components/schemas/ErrorResponse'
default:
$ref: 'definitions.yaml#/components/responses/CommonError'
accountPreAuthorizedDebit:
parameters:
- $ref: definitions.yaml#/components/headers/TenantId
post:
tags:
- pos
requestBody:
description: 账户预授权交易
content:
application/json:
schema:
$ref: '#/components/schemas/PreAuthorizedDebitRequest'
responses:
'200':
description: 预授权交易成功
content:
application/json:
schema:
$ref: '#/components/schemas/PreAuthorizedDebitResponse'
default:
$ref: 'definitions.yaml#/components/responses/CommonError'
accountPreAuthorizedSettle:
parameters:
- $ref: definitions.yaml#/components/headers/TenantId
post:
tags:
- pos
requestBody:
description: 预授权交易清算
content:
application/json:
schema:
$ref: '#/components/schemas/PreAuthorizedSettleRequest'
responses:
'200':
description: 预授权交易清算成功
content:
application/json:
schema:
$ref: '#/components/schemas/PreAuthorizedSettleResponse'
default:
$ref: 'definitions.yaml#/components/responses/CommonError'