Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 1 | components: |
| 2 | schemas: |
| 3 | AccountQueryRequest: |
| 4 | type: object |
| 5 | title: 账户查询请求 |
| 6 | required: |
| 7 | - userid |
| 8 | properties: |
| 9 | userid: |
| 10 | title: 用户ID |
| 11 | type: string |
| 12 | subaccounts: |
| 13 | title: 子账户列表 |
| 14 | type: array |
| 15 | items: |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 16 | description: | |
| 17 | 需要查询的子账户名,如果查询所有子账户可以用 ['*'] 来查询 |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 18 | type: string |
| 19 | title: 子账户ID |
| 20 | AccountQueryResponse: |
| 21 | type: object |
| 22 | title: 账户查询应答 |
| 23 | properties: |
| 24 | userid: |
| 25 | title: 用户ID |
| 26 | type: string |
| 27 | username: |
| 28 | title: 用户名 |
| 29 | type: string |
| 30 | status: |
| 31 | title: 账户状态 |
| 32 | $ref: 'definitions.yaml#/components/schemas/UserStatus' |
| 33 | balance: |
| 34 | title: 总余额(分) |
| 35 | type: integer |
| 36 | frozenbal: |
| 37 | title: 冻结金额(分) |
| 38 | type: integer |
| 39 | subaccountList: |
| 40 | type: array |
| 41 | title: 子账户列表 |
| 42 | items: |
| 43 | title: 子账户属性 |
Tang Cheng | d500f8b | 2020-03-24 11:33:30 +0800 | [diff] [blame^] | 44 | $ref: 'definitions.yaml#/components/schemas/SubAccountBalance' |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 45 | PreAuthorizedDebitRequest: |
| 46 | type: object |
| 47 | title: 预授权交易请求 |
| 48 | required: |
| 49 | - userid |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 50 | - preAuthorizedAmount |
| 51 | - shopaccno |
| 52 | - transDate |
| 53 | - transTime |
| 54 | properties: |
| 55 | billno: |
| 56 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 57 | userid: |
| 58 | title: 用户ID |
| 59 | type: string |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 60 | accountName: |
| 61 | title: 账户名 |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 62 | type: string |
| 63 | preAuthorizedAmount: |
| 64 | title: 预授权金额(分) |
| 65 | type: integer |
| 66 | shopaccno: |
| 67 | $ref: 'definitions.yaml#/components/schemas/ShopAccNo' |
| 68 | transDate: |
| 69 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 70 | transTime: |
| 71 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 72 | PreAuthorizedDebitResponse: |
| 73 | type: object |
| 74 | title: 预授权交易应答 |
| 75 | properties: |
| 76 | refno: |
| 77 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 78 | result: |
| 79 | $ref: 'definitions.yaml#/components/schemas/TransResult' |
| 80 | message: |
| 81 | type: string |
| 82 | title: 预授权交易信息 |
| 83 | PreAuthorizedSettleRequest: |
| 84 | type: object |
| 85 | title: 预授权交易清算 |
| 86 | required: |
| 87 | - refno |
| 88 | - billno |
| 89 | - transTime |
| 90 | - transTime |
| 91 | - amount |
| 92 | properties: |
| 93 | refno: |
| 94 | title: 预授权交易系统交易参考号 |
| 95 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 96 | billno: |
| 97 | title: 预授权交易清算订单号 |
| 98 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 99 | transDate: |
| 100 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 101 | transTime: |
| 102 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 103 | amount: |
| 104 | title: 清算金额, 小于等于预授权金额(分) |
| 105 | type: integer |
| 106 | PreAuthorizedSettleResponse: |
| 107 | type: object |
| 108 | title: 预授权交易清算结果 |
| 109 | properties: |
| 110 | refno: |
| 111 | title: 预授权交易清算交易系统交易参考号 |
| 112 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 113 | leftPreAuthorizedAmount: |
| 114 | title: 清算后剩余预授权金额 |
| 115 | type: integer |
| 116 | AccountPayRequest: |
| 117 | type: object |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 118 | title: 主账户余额扣款交易 |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 119 | required: |
| 120 | - billno |
| 121 | - shopaccno |
| 122 | - transTime |
| 123 | - transDate |
| 124 | - userid |
| 125 | - amount |
| 126 | - dtltype |
| 127 | properties: |
| 128 | billno: |
| 129 | title: 交易订单号 |
| 130 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 131 | shopaccno: |
| 132 | $ref: 'definitions.yaml#/components/schemas/ShopAccNo' |
| 133 | transDate: |
| 134 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 135 | transTime: |
| 136 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 137 | userid: |
| 138 | title: 用户ID |
| 139 | type: string |
| 140 | amount: |
| 141 | title: 扣款金额(分) |
| 142 | type: integer |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 143 | accountName: |
| 144 | title: 账户名 |
| 145 | type: string |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 146 | description: |
| 147 | title: 交易描述 |
| 148 | type: string |
| 149 | dtltype: |
| 150 | title: 交易类型 |
| 151 | type: string |
| 152 | default: "pos" |
| 153 | AccountPayResponse: |
| 154 | type: object |
| 155 | title: 账户余额扣款交易应答 |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 156 | required: |
| 157 | - refno |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 158 | properties: |
| 159 | refno: |
| 160 | title: 系统交易参考号 |
| 161 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 162 | description: |
| 163 | title: 系统返回交易描述 |
| 164 | type: string |
| 165 | aftbal: |
| 166 | title: 账户余额(分) |
| 167 | type: integer |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 168 | realAmount: |
| 169 | title: 实际扣款金额(分) |
| 170 | type: integer |
Tang Cheng | d500f8b | 2020-03-24 11:33:30 +0800 | [diff] [blame^] | 171 | SubAccountPayRequest: |
| 172 | type: object |
| 173 | description: 子账户消费接口 |
| 174 | required: |
| 175 | - billno |
| 176 | - shopaccno |
| 177 | - transDate |
| 178 | - transTime |
| 179 | - amount |
| 180 | - overdraft |
| 181 | - accountList |
| 182 | properties: |
| 183 | billno: |
| 184 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 185 | shopaccno: |
| 186 | $ref: 'definitions.yaml#/components/schemas/ShopAccNo' |
| 187 | transDate: |
| 188 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 189 | transTime: |
| 190 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 191 | userid: |
| 192 | title: 用户ID |
| 193 | type: string |
| 194 | amount: |
| 195 | title: 扣款金额(分) |
| 196 | type: integer |
| 197 | overdraft: |
| 198 | type: boolean |
| 199 | title: 是否允许主账户透支 |
| 200 | useMainAccount: |
| 201 | type: boolean |
| 202 | title: 是否扣款账户 |
| 203 | accountList: |
| 204 | type: array |
| 205 | description: 按照账户列表顺序扣款 |
| 206 | items: |
| 207 | type: object |
| 208 | description: 扣款账户列表 |
| 209 | properties: |
| 210 | name: |
| 211 | type: string |
| 212 | title: 账户名 |
| 213 | SubAccountPayResponse: |
| 214 | type: object |
| 215 | description: 账户消费应答 |
| 216 | properties: |
| 217 | refno: |
| 218 | $ref: 'definitions.yaml#/components/schemas/Refno' |
| 219 | hostDate: |
| 220 | $ref: 'definitions.yaml#/components/schemas/TransDate' |
| 221 | hostTime: |
| 222 | $ref: 'definitions.yaml#/components/schemas/TransTime' |
| 223 | result: |
| 224 | $ref: 'definitions.yaml#/components/schemas/TransResult' |
| 225 | description: |
| 226 | title: 扣款情况描述 |
| 227 | type: string |
| 228 | accountList: |
| 229 | type: array |
| 230 | description: 账户扣款情况 |
| 231 | items: |
| 232 | type: object |
| 233 | description: 账户结果 |
| 234 | properties: |
| 235 | name: |
| 236 | title: 账户名 |
| 237 | type: string |
| 238 | payAmount: |
| 239 | title: 扣款金额 |
| 240 | type: integer |
| 241 | aftbal: |
| 242 | title: 交易后余额 |
| 243 | type: integer |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 244 | |
| 245 | paths: |
| 246 | accountQuery: |
| 247 | parameters: |
| 248 | - $ref: definitions.yaml#/components/headers/TenantId |
| 249 | post: |
| 250 | tags: |
| 251 | - pos |
| 252 | requestBody: |
| 253 | description: 账户余额查询 |
| 254 | content: |
| 255 | application/json: |
| 256 | schema: |
| 257 | $ref: '#/components/schemas/AccountQueryRequest' |
| 258 | responses: |
| 259 | '200': |
| 260 | description: 查询账户成功 |
| 261 | content: |
| 262 | application/json: |
| 263 | schema: |
| 264 | $ref: '#/components/schemas/AccountQueryResponse' |
| 265 | '404': |
| 266 | description: 指定用户不存在 |
| 267 | content: |
| 268 | application/json: |
| 269 | schema: |
| 270 | $ref: 'definitions.yaml#/components/schemas/ErrorResponse' |
Tang Cheng | d500f8b | 2020-03-24 11:33:30 +0800 | [diff] [blame^] | 271 | '500': |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 272 | $ref: 'definitions.yaml#/components/responses/CommonError' |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 273 | accountPay: |
| 274 | parameters: |
| 275 | - $ref: definitions.yaml#/components/headers/TenantId |
| 276 | post: |
| 277 | tags: |
| 278 | - pos |
Tang Cheng | d500f8b | 2020-03-24 11:33:30 +0800 | [diff] [blame^] | 279 | - pay |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 280 | requestBody: |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 281 | description: 主账户余额消费 |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 282 | content: |
| 283 | application/json: |
| 284 | schema: |
| 285 | $ref: '#/components/schemas/AccountPayRequest' |
| 286 | responses: |
| 287 | '200': |
| 288 | description: 账户消费成功 |
| 289 | content: |
| 290 | application/json: |
| 291 | schema: |
| 292 | $ref: '#/components/schemas/AccountPayResponse' |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 293 | '400': |
| 294 | description: | |
| 295 | 消费失败, code 用于定义错误信息 |
| 296 | * short_of_balance 余额不足 |
| 297 | * account_status_error 账户状态异常 |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 298 | content: |
| 299 | application/json: |
| 300 | schema: |
| 301 | $ref: 'definitions.yaml#/components/schemas/ErrorResponse' |
Tang Cheng | d500f8b | 2020-03-24 11:33:30 +0800 | [diff] [blame^] | 302 | '500': |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 303 | $ref: 'definitions.yaml#/components/responses/CommonError' |
Tang Cheng | d500f8b | 2020-03-24 11:33:30 +0800 | [diff] [blame^] | 304 | subaccPay: |
| 305 | parameters: |
| 306 | - $ref: definitions.yaml#/components/headers/TenantId |
| 307 | post: |
| 308 | tags: |
| 309 | - pay |
| 310 | requestBody: |
| 311 | description: | |
| 312 | 子账户消费, 请求时指定扣款列表,系统安装账户顺序扣款 |
| 313 | content: |
| 314 | application/json: |
| 315 | schema: |
| 316 | $ref: '#/components/schemas/SubAccountPayRequest' |
| 317 | responses: |
| 318 | '200': |
| 319 | description: 扣款成功 |
| 320 | content: |
| 321 | application/json: |
| 322 | schema: |
| 323 | $ref: '#/components/schemas/SubAccountPayResponse' |
| 324 | '400': |
| 325 | description: | |
| 326 | 扣款失败, code 定义错误信息 |
| 327 | * short_of_balance 余额不足 |
| 328 | * account_status_error 账户状态异常 |
| 329 | content: |
| 330 | application/json: |
| 331 | schema: |
| 332 | $ref: 'definitions.yaml#/components/schemas/ErrorResponse' |
| 333 | '500': |
| 334 | $ref: 'definitions.yaml#/components/responses/CommonError' |
| 335 | |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 336 | accountPreAuthorizedDebit: |
| 337 | parameters: |
| 338 | - $ref: definitions.yaml#/components/headers/TenantId |
| 339 | post: |
| 340 | tags: |
| 341 | - pos |
Tang Cheng | d500f8b | 2020-03-24 11:33:30 +0800 | [diff] [blame^] | 342 | - pay |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 343 | requestBody: |
| 344 | description: 账户预授权交易 |
| 345 | content: |
| 346 | application/json: |
| 347 | schema: |
| 348 | $ref: '#/components/schemas/PreAuthorizedDebitRequest' |
| 349 | responses: |
| 350 | '200': |
| 351 | description: 预授权交易成功 |
| 352 | content: |
| 353 | application/json: |
| 354 | schema: |
| 355 | $ref: '#/components/schemas/PreAuthorizedDebitResponse' |
Tang Cheng | d500f8b | 2020-03-24 11:33:30 +0800 | [diff] [blame^] | 356 | '500': |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 357 | $ref: 'definitions.yaml#/components/responses/CommonError' |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 358 | accountPreAuthorizedSettle: |
| 359 | parameters: |
| 360 | - $ref: definitions.yaml#/components/headers/TenantId |
| 361 | post: |
| 362 | tags: |
| 363 | - pos |
Tang Cheng | d500f8b | 2020-03-24 11:33:30 +0800 | [diff] [blame^] | 364 | - pay |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 365 | requestBody: |
| 366 | description: 预授权交易清算 |
| 367 | content: |
| 368 | application/json: |
| 369 | schema: |
| 370 | $ref: '#/components/schemas/PreAuthorizedSettleRequest' |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 371 | responses: |
| 372 | '200': |
| 373 | description: 预授权交易清算成功 |
| 374 | content: |
| 375 | application/json: |
| 376 | schema: |
| 377 | $ref: '#/components/schemas/PreAuthorizedSettleResponse' |
Tang Cheng | d500f8b | 2020-03-24 11:33:30 +0800 | [diff] [blame^] | 378 | '500': |
| 379 | $ref: 'definitions.yaml#/components/responses/CommonError' |
| 380 | querySubAccountMetadata: |
| 381 | parameters: |
| 382 | - $ref: definitions.yaml#/components/headers/TenantId |
| 383 | get: |
| 384 | tags: |
| 385 | - sa |
| 386 | responses: |
| 387 | '200': |
| 388 | description: 子账户元数据信息 |
| 389 | content: |
| 390 | application/json: |
| 391 | schema: |
| 392 | type: array |
| 393 | items: |
| 394 | $ref: 'definitions.yaml#/components/schemas/SubAccountMetadata' |
| 395 | '500': |
Tang Cheng | c1b7658 | 2020-03-20 15:44:40 +0800 | [diff] [blame] | 396 | $ref: 'definitions.yaml#/components/responses/CommonError' |
Tang Cheng | bacb231 | 2020-03-20 09:16:55 +0800 | [diff] [blame] | 397 | |