interface-v2.d.ts 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. /**
  2. * 统一返回格式
  3. */
  4. export interface Output {
  5. status: number;
  6. error?: any;
  7. data?: any;
  8. }
  9. /**
  10. * 发起商家转账零钱
  11. */
  12. export declare namespace BatchesTransfer {
  13. interface TransferDetailList {
  14. /** 商家明细单号 */
  15. out_detail_no: string;
  16. /** 转账金额 */
  17. transfer_amount: number;
  18. /** 转账备注 */
  19. transfer_remark: string;
  20. /** 用户在直连商户应用下的用户标示 */
  21. openid: string;
  22. /** 收款用户姓名 */
  23. user_name?: string;
  24. }
  25. /**
  26. * 发起商家转账API 请求参数
  27. */
  28. interface Input {
  29. /** 直连商户的appid -不传 默认使用初始化数据 */
  30. appid?: string;
  31. /** 商家批次单号 */
  32. out_batch_no: string;
  33. /** 批次名称 */
  34. batch_name: string;
  35. /** 批次备注 */
  36. batch_remark: string;
  37. /** 转账总金额 */
  38. total_amount: number;
  39. /** 转账总笔数 */
  40. total_num: number;
  41. /** 转账明细列表 */
  42. transfer_detail_list: TransferDetailList[];
  43. /** 微信平台证书序列号-Wechatpay-Serial(当有敏感信息加密时,需要当前参数) */
  44. wx_serial_no?: string;
  45. }
  46. interface DataOutput {
  47. out_batch_no: string;
  48. batch_id: string;
  49. create_time: Date;
  50. }
  51. /**
  52. * 发起商家转账API 返回参数
  53. */
  54. interface IOutput extends Output {
  55. data?: DataOutput;
  56. }
  57. /**
  58. * 转账批次单
  59. */
  60. interface QueryTransferBatch {
  61. /** 微信支付分配的商户号 */
  62. mchid: string;
  63. /** 商户系统内部的商家批次单号,在商户系统内部唯一 */
  64. out_batch_no: string;
  65. /** 微信批次单号,微信商家转账系统返回的唯一标识 */
  66. batch_id: string;
  67. /** 申请商户号的appid或商户号绑定的appid(企业号corpid即为此appid) */
  68. appid: string;
  69. /** 批次状态 */
  70. batch_status: string;
  71. /** 批次类型 */
  72. batch_type: string;
  73. /** 该笔批量转账的名称 */
  74. batch_name: string;
  75. /** 转账说明,UTF8编码,最多允许32个字符 */
  76. batch_remark: string;
  77. /** 批次关闭原因 */
  78. close_reason?: string;
  79. /** 转账总金额 */
  80. total_amount: number;
  81. /** 转账总笔数 */
  82. total_num: number;
  83. /** 批次创建时间 */
  84. create_time?: Date;
  85. /** 批次更新时间 */
  86. update_time?: Date;
  87. /** 转账成功金额 */
  88. success_amount?: number;
  89. /** 转账成功笔数 */
  90. success_num?: number;
  91. /** 转账失败金额 */
  92. fail_amount?: number;
  93. /** 转账失败笔数 */
  94. fail_num?: number;
  95. }
  96. /**
  97. * 转账明细单列表
  98. */
  99. interface QueryTransferDetailList {
  100. /** 微信明细单号 */
  101. detail_id: string;
  102. /** 商家明细单号 */
  103. out_detail_no: string;
  104. /** 明细状态 */
  105. detail_status: string;
  106. }
  107. /**
  108. * 商家批次单号查询批次单API
  109. */
  110. namespace QueryBatchesTransferList {
  111. /**
  112. * 商家批次单号查询参数
  113. */
  114. interface Input {
  115. /**商户系统内部的商家批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 */
  116. out_batch_no: string;
  117. /**商户可选择是否查询指定状态的转账明细单,当转账批次单状态为“FINISHED”(已完成)时,才会返回满足条件的转账明细单 */
  118. need_query_detail: boolean;
  119. /**该次请求资源(转账明细单)的起始位置,从0开始,默认值为0 */
  120. offset?: number;
  121. /**该次请求可返回的最大资源(转账明细单)条数,最小20条,最大100条,不传则默认20条。不足20条按实际条数返回 */
  122. limit?: number;
  123. /**查询指定状态的转账明细单,当need_query_detail为true时,该字段必填 */
  124. detail_status?: 'ALL' | 'SUCCESS' | 'FAIL';
  125. }
  126. interface IOutput extends Output {
  127. data?: {
  128. limit: number;
  129. offset: number;
  130. transfer_batch: QueryTransferBatch;
  131. transfer_detail_list: QueryTransferDetailList[];
  132. };
  133. }
  134. }
  135. /**
  136. * 微信批次单号查询批次单API
  137. */
  138. namespace QueryBatchesTransferByWx {
  139. interface Input {
  140. /** 微信批次单号,微信商家转账系统返回的唯一标识 */
  141. batch_id: string;
  142. /**商户可选择是否查询指定状态的转账明细单,当转账批次单状态为“FINISHED”(已完成)时,才会返回满足条件的转账明细单 */
  143. need_query_detail: boolean;
  144. /**该次请求资源(转账明细单)的起始位置,从0开始,默认值为0 */
  145. offset?: number;
  146. /**该次请求可返回的最大资源(转账明细单)条数,最小20条,最大100条,不传则默认20条。不足20条按实际条数返回 */
  147. limit?: number;
  148. /**查询指定状态的转账明细单,当need_query_detail为true时,该字段必填 */
  149. detail_status?: 'ALL' | 'SUCCESS' | 'FAIL';
  150. }
  151. interface IOutput extends Output {
  152. data?: {
  153. limit: number;
  154. offset: number;
  155. transfer_batch: QueryTransferBatch;
  156. transfer_detail_list: QueryTransferDetailList[];
  157. };
  158. }
  159. }
  160. /**
  161. * 微信明细单号查询明细单API
  162. */
  163. namespace QueryBatchesTransferDetailByWx {
  164. interface Input {
  165. /** 微信批次单号 */
  166. batch_id: string;
  167. /** 微信明细单号 */
  168. detail_id: string;
  169. }
  170. interface DetailOutput {
  171. /** 商户号 */
  172. mchid: string;
  173. /** 商家批次单号 */
  174. out_batch_no: string;
  175. /** 微信批次单号 */
  176. batch_id: string;
  177. /** 直连商户的appid */
  178. appid: string;
  179. /** 商家明细单号 */
  180. out_detail_no: string;
  181. /** 微信明细单号 */
  182. detail_id: string;
  183. /** 明细状态 */
  184. detail_status: string;
  185. /** 转账金额 */
  186. transfer_amount: number;
  187. /** 转账备注 */
  188. transfer_remark: string;
  189. /** 明细失败原因 */
  190. fail_reason?: string;
  191. /** 用户在直连商户应用下的用户标示 */
  192. openid: string;
  193. /** 收款用户姓名 */
  194. user_name?: string;
  195. /** 转账发起时间 */
  196. initiate_time: Date;
  197. /** 明细更新时间 */
  198. update_time: Date;
  199. }
  200. interface IOutput extends Output {
  201. data?: DetailOutput;
  202. }
  203. }
  204. /**
  205. * 商家明细单号查询明细单API
  206. */
  207. namespace QueryBatchesTransferDetail {
  208. interface Input {
  209. /** 商家明细单号 */
  210. out_detail_no: string;
  211. /** 商家批次单号 */
  212. out_batch_no: string;
  213. }
  214. interface DetailOutput {
  215. /** 商户号 */
  216. mchid: string;
  217. /** 商家批次单号 */
  218. out_batch_no: string;
  219. /** 微信批次单号 */
  220. batch_id: string;
  221. /** 直连商户的appid */
  222. appid: string;
  223. /** 商家明细单号 */
  224. out_detail_no: string;
  225. /** 微信明细单号 */
  226. detail_id: string;
  227. /** 明细状态 */
  228. detail_status: string;
  229. /** 转账金额 */
  230. transfer_amount: number;
  231. /** 转账备注 */
  232. transfer_remark: string;
  233. /** 明细失败原因 */
  234. fail_reason?: string;
  235. /** 用户在直连商户应用下的用户标示 */
  236. openid: string;
  237. /** 收款用户姓名 */
  238. user_name?: string;
  239. /** 转账发起时间 */
  240. initiate_time: Date;
  241. /** 明细更新时间 */
  242. update_time: Date;
  243. }
  244. interface IOutput extends Output {
  245. data?: DetailOutput;
  246. }
  247. }
  248. }