140 lines
5.1 KiB
YAML

BillPay:
post:
tags:
- 账单管理
summary: 账单缴费
description: |
执行账单缴费操作,支持多种支付渠道。
## 业务说明
- 支持指定客户编号和缴费金额进行缴费
- 支持多种二级支付渠道(支付宝、微信等)
- 实时更新账单状态和生成交易记录
- 支持XML和JSON两种数据格式
- 缴费金额必须与账单金额完全匹配
## 业务规则
- 缴费金额必须大于0.01元
- 账单状态必须为未缴费状态
- 同一笔账单不能重复缴费
- 缴费成功后账单状态自动更新为已缴费
## 调用频率限制
- 单个客户编号每分钟最多缴费5次
- 单个机构每分钟最多缴费500次
operationId: payBill
parameters:
- $ref: '../components/parameters.yaml#/components/parameters/ContentTypeHeader'
- $ref: '../components/parameters.yaml#/components/parameters/EncryptTypeHeader'
- $ref: '../components/parameters.yaml#/components/parameters/EncryptModeHeader'
- $ref: '../components/parameters.yaml#/components/parameters/DataTypeHeader'
requestBody:
required: true
description: 账单缴费请求数据
content:
application/xml:
schema:
$ref: '../components/schemas.yaml#/components/schemas/BillPayRequest'
example: |
<?xml version="1.0" encoding="GBK"?>
<in>
<Version>1.0.1</Version>
<InstId>00001</InstId>
<TranCode>Pay</TranCode>
<TranDate>20240101</TranDate>
<TranSeq>123456789012</TranSeq>
<BillKey>123456</BillKey>
<CompanyId>654321</CompanyId>
<PayAmount>150.00</PayAmount>
<SubChannel>1</SubChannel>
</in>
application/json:
schema:
$ref: '../components/schemas.yaml#/components/schemas/BillPayRequest'
example:
Version: "1.0.1"
InstId: "00001"
TranCode: "Pay"
TranDate: "20240101"
TranSeq: "123456789012"
BillKey: "123456"
CompanyId: "654321"
PayAmount: 150.00
SubChannel: 1
responses:
'200':
description: 缴费成功
headers:
Content-Type:
$ref: '../components/headers.yaml#/components/headers/ContentType'
X-Response-Time:
$ref: '../components/headers.yaml#/components/headers/ResponseTime'
X-Request-Id:
$ref: '../components/headers.yaml#/components/headers/RequestId'
content:
application/xml:
schema:
$ref: '../components/schemas.yaml#/components/schemas/BillPayResponse'
example: |
<?xml version="1.0" encoding="GBK"?>
<out>
<Version>1.0.1</Version>
<InstId>00001</InstId>
<TranCode>PayRes</TranCode>
<TranDate>20240101</TranDate>
<TranSeq>123456789012</TranSeq>
<RespCode>AAAAAAA</RespCode>
<RespMessage>缴费成功</RespMessage>
<Data>
<Transaction>
<TranSeq>TXN123456789012</TranSeq>
<BillKey>123456</BillKey>
<CompanyId>654321</CompanyId>
<TranCode>Pay</TranCode>
<PayAmount>150.00</PayAmount>
<PayDate>2024-01-01T12:00:00.000Z</PayDate>
<SubChannel>1</SubChannel>
<TranStatus>1</TranStatus>
<RespCode>AAAAAAA</RespCode>
<RespMessage>成功</RespMessage>
</Transaction>
</Data>
</out>
application/json:
schema:
$ref: '../components/schemas.yaml#/components/schemas/BillPayResponse'
example:
Version: "1.0.1"
InstId: "00001"
TranCode: "PayRes"
TranDate: "20240101"
TranSeq: "123456789012"
RespCode: "AAAAAAA"
RespMessage: "缴费成功"
Data:
Transaction:
TranSeq: "TXN123456789012"
BillKey: "123456"
CompanyId: "654321"
TranCode: "Pay"
PayAmount: 150.00
PayDate: "2024-01-01T12:00:00.000Z"
SubChannel: 1
TranStatus: 1
RespCode: "AAAAAAA"
RespMessage: "成功"
'400':
$ref: '../components/responses.yaml#/components/responses/BusinessError'
'500':
$ref: '../components/responses.yaml#/components/responses/SystemError'
'401':
$ref: '../components/responses.yaml#/components/responses/SecurityError'
'408':
$ref: '../components/responses.yaml#/components/responses/NetworkError'
security:
- ApiKeyAuth: []
- EncryptedData: []