开票接口

## 1.开票信息查询 >d 通过该接口可获取公司的可开发票列表,以及所拥有主体列表,无需频繁请求。请求到之后保存自己库即可。当签署主体信息有变更。或者发票内容有调整重新请求接口即可。 #### 接口地址: /open/api/v1/yns/invoice/queryInvoice #### 请求方式:POST >d 该接口无需参数 #### 响应参数说明: |参数名称| 参数含义|数据类型| 是否必有| 参数备注| |-|-|-|-|-| |companyName| 公司名称| String|是|主公司名称| |name| 主体名称| String|是|主体名称| |mainstayId| 主体ID|Integer| 是|主体ID| |taxRate| 税率|BigDecimal| 是|| |invoiceOpResponseList| 发票列表|List&lt;InvoiceOpResponse&gt;|是|发票列表为List数组 #### InvoiceOpResponse: |参数名称| 参数含义|数据类型| 是否必有| 参数备注| |-|-|-|-|-| |invoiceCode|发票编码|String| 是|invoiceOpResponseList里面属性| |invoiceContent|发票内容|String| 是|invoiceOpResponseList里面属性| |industryName|行业名称|String| 是|invoiceOpResponseList里面属性| |industryCode|行业编码|String| 是|invoiceOpResponseList里面属性| 解密结果示例如下: ```json [ { "invoiceOpResponseList": [ { "invoiceCode": "发票编码", "invoiceContent": "发票内容", "industryName": "行业名称", "industryCode": "行业编码", } ], "mainstayId": 1, "name": "安吉", "taxRate": 0.05 } ] ``` ## 2. 开票申请 #### 接口地址: /open/api/v1/yns/invoice/serviceInvoicesApply #### 请求方式:POST #### 请求参数说明: |参数名称|参数含义|数据类型|是否必填|参数备注| |-|-|-|-|-| |mainstayId|主体id|Integer|是|| |invoiceCode|发票编码|String|是|| |remark|备注|String(640)|否|| #### 接口响应参数data字段解密后的参数说明: |参数名称| 参数含义|数据类型| 是否必有| 参数备注| |-|-|-|-|-| |invoiceBillNo|开票订单号|String|是|| |invoiceAmount|开票金额|BigDecimal|是|| |invoiceStatus|开票状态|Integer|是|[开票状态码](https://easydoc.net/doc/95180784/Ry461Ra3/g5SDIGDl)| |mainstayId|主体id|Integer|是|| |invoiceContent| 发票内容|String|是|| |purchaserInvoiceTitle| 购买方发票抬头 |String|是|| |purchaserTaxNumber| 购买方税号 |String|是|| |purchaserAddressPhone| 购买方地址、电话 |String|是|| |purchaserBankAccount| 购买方开户行及账号 |String|是|| |sellerInvoiceTitle| 销售方发票抬头 |String|是|| |sellerTaxNumber| 销售方税号 |String|是|| |sellerAddressPhone| 销售方地址、电话 |String|是|| |sellerBankAccount| 销售方开户行及账号 |String|是|| |failReason| 失败原因 |String|否|| #### 开票状态说明 |invoiceStatus|说明| |-|-| |-2|待结算证明上传| |0|待审核| ## 3.开票申请(批量订单号) >d 需保证同一批订单号对应订单的“主体”与“开票类目”一致 #### 接口地址: /open/api/v1/yns/invoice/serviceInvoices/applyByBillNo #### 请求方式:POST #### 请求参数说明: |参数名称|参数含义|数据类型|是否必填|参数备注| |-|-|-|-|-| |thirdOrderNos|商户订单号集合|List&lt;String&gt;(50)|是|| |remark|备注|String(640)|否|| #### 接口响应参数data字段解密后的参数说明: |参数名称| 参数含义|数据类型| 是否必有| 参数备注| |-|-|-|-|-| |invoiceBillNo|开票订单号|String|是|| |invoiceAmount|开票金额|BigDecimal|是|| |invoiceStatus|开票状态|Integer|是|[开票状态码](https://easydoc.net/doc/95180784/Ry461Ra3/g5SDIGDl)| |mainstayId|主体id|Integer|是|| |invoiceContent| 发票内容|String|是|| |purchaserInvoiceTitle| 购买方发票抬头 |String|是|| |purchaserTaxNumber| 购买方税号 |String|是|| |purchaserAddressPhone| 购买方地址、电话 |String|是|| |purchaserBankAccount| 购买方开户行及账号 |String|是|| |sellerInvoiceTitle| 销售方发票抬头 |String|是|| |sellerTaxNumber| 销售方税号 |String|是|| |sellerAddressPhone| 销售方地址、电话 |String|是|| |sellerBankAccount| 销售方开户行及账号 |String|是|| |failReason| 失败原因 |String|否|| #### 开票状态说明 |invoiceStatus|说明| |-|-| |-2|待结算证明上传| |0|待审核| ## 4. 开票确认 #### 接口地址: /open/api/v1/yns/invoice/serviceInvoicesApplyConfirm #### 请求方式:POST #### 请求参数说明: |参数名称|参数含义|数据类型|是否必填|参数备注| |-|-|-|-|-| |invoiceBillNo|开票订单编号|String|是|| |settlementCert|证据链url|String|否|url链接,最长640字符| |remark|备注|String|否|| #### 接口响应参数data字段解密后的参数说明: |参数名称| 参数含义|数据类型| 是否必有| 参数备注| |-|-|-|-|-| |invoiceBillNo|开票订单编号|String|是|| |confirmResult|确认结果|Boolean|是|| |failReason|失败原因|String|否|| ## 5. 开票结果查询 #### 接口地址: /open/api/v1/yns/invoice/queryServiceInvoicesResult #### 请求方式:POST #### 请求参数说明: |参数名称|参数含义|数据类型|是否必填|参数备注| |-|-|-|-|-| |invoiceBillNo|开票订单编号|String|否|二选一,必传,都传以发票单号为准| |thirdOrderNo|商户订单号|String|否|二选一,必传,都传以发票单号为准| #### 接口响应参数data字段解密后的参数说明: |参数名称| 参数含义|数据类型| 是否必有| 参数备注| |-|-|-|-|-| |invoiceBillNo|开票订单号|String|是|| |invoiceClassification|开票类型|Integer|是|| |invoiceStatus|开票状态|Integer|是|[开票状态码](https://easydoc.net/doc/95180784/Ry461Ra3/g5SDIGDl)| |mainstayId|主体id|Integer|是|| |invoiceAmount|开票金额|BigDecimal|是|| |invoiceContent| 发票内容|String|是|| |remark| 备注 |String|否|| |purchaserInvoiceTitle| 购买方发票抬头 |String|是|| |purchaserTaxNumber| 购买方税号 |String|是|| |purchaserAddressPhone| 购买方地址、电话 |String|是|| |purchaserBankAccount| 购买方开户行及账号 |String|是|| |addressee| 收件人 |String|是|| |phone| 联系电话 |String|是|| |area| 所在地区 |String|是|| |detailAddress| 详细地址 |String|是|| |sellerInvoiceTitle| 销售方发票抬头 |String|是|| |sellerTaxNumber| 销售方税号 |String|是|| |sellerAddressPhone| 销售方地址、电话 |String|是|| |sellerBankAccount| 销售方开户行及账号 |String|是|| | settlementCertUrl | 结算单证明 | String | 是 | | | settlementCertCustomUrl | 自定义证明 | String | 是 | | | expressCompany | 快递公司 | String | 是 | | | expressNo | 快递单号 | String | 是 | | | postStatus | 邮寄状态 | String | 是 |0:未邮寄 1.已邮寄 | | failReason | 失败原因 | String | 否 | | | haveBusinessDetermination | 业务确认单 | Integer | 否 | 1、存在业务确认单 0、无业务确认单| |billInformation|发票链接|List< String >|否|| #### 开票状态说明 |invoiceStatus|说明| |-|-| |-2|待结算证明上传| |-1|待支付| |0|待审核| |1|待开票| |2|已开票| |3|已拒绝| #### 邮寄状态说明 |postStatus|说明| |-|-| |0|未邮寄| |1|已邮寄| ## 6. 开票回调接口(与查询接口返回结果参数一致) >d 该接口需要第三方自行编写提供接口到发放平台回调成功必须返回success不然会重复回调 #### 请求方式:POST |参数名称| 参数含义|数据类型| 是否必有| 参数备注| |-|-|-|-|-| |callbackType|回调类型|String|是|固定返回:ynsInvoiceResult| |invoiceBillNo|开票订单号|String|是|| |invoiceClassification|开票类型|Integer|是|| |invoiceStatus|开票状态|Integer|是|详情请看【开票状态说明】| |mainstayId|主体id|Integer|是|| |invoiceAmount|开票金额|BigDecimal|是|| |invoiceContent| 发票内容|String|是|| |remark| 备注 |String|否|| |purchaserInvoiceTitle| 购买方发票抬头 |String|是|| |purchaserTaxNumber| 购买方税号 |String|是|| |purchaserAddressPhone| 购买方地址、电话 |String|是|| |purchaserBankAccount| 购买方开户行及账号 |String|是|| |addressee| 收件人 |String|是|| |phone| 联系电话 |String|是|| |area| 所在地区 |String|是|| |detailAddress| 详细地址 |String|是|| |sellerInvoiceTitle| 销售方发票抬头 |String|是|| |sellerTaxNumber| 销售方税号 |String|是|| |sellerAddressPhone| 销售方地址、电话 |String|是|| |sellerBankAccount| 销售方开户行及账号 |String|是|| | settlementCertUrl | 结算单证明 | String | 是 | | | settlementCertCustomUrl | 自定义证明 | String | 是 | | | expressCompany | 快递公司 | String | 是 | | | expressNo | 快递单号 | String | 是 | | | postStatus | 邮寄状态 | String | 是 |详情请看【邮寄状态说明】 | | failReason | 失败原因 | String | 否 | | |billInformation|发票链接|List< String >|否|| #### 开票状态说明 |invoiceStatus|说明| |-|-| |-2|待结算证明上传| |-1|待支付| |0|待审核| |1|待开票| |2|已开票| |3|已拒绝| #### 邮寄状态说明 |postStatus|说明| |-|-| |0|未邮寄| |1|已邮寄| ## 7.业务确认单查询 #### 接口地址: /open/api/v1/yns/zykCompanyTask/queryCompanyTaskDetail #### 请求方式:POST #### 请求参数说明: |参数名称|参数含义|数据类型|是否必填|参数备注| |-|-|-|-|-| |invoiceId|发票单号|Integer|是|| #### 接口响应参数data字段解密后的参数说明: |参数名称|参数含义|数据类型|是否必有|参数备注| |-|-|-|-|-| |taskNo | 服务编号 |string |是| | taskName | 服务名称 | string |是| | result | 服务结果| string |是| | commerceFullName | 支付单位(验收方) |string |是| | mainstayCompanyName |服务单位 | string|是| | invoiceContent | 开票内容| string |是| | totalAmount | 本次验收总金额 |string|是| | startTime |开始日期 |string|是| | taskContent |服务要求 | string | 是| | billNoList | 关联结算订单号 | List<String> |是| | confirmTime | 确认时间 | String| 是| | mobile | 确认手机号|string |是| | companyName | 公司名称 | string |是| | ip | 确认IP地址| string |是| #### 返回报文示例: ```java { "taskNo": "", "taskName": "", "result": "", "commerceFullName": "", "mainstayCompanyName": "", "invoiceContent": "", "totalAmount": "", "startTime": "", "taskContent": "", "billNoList": [ "" ], "confirmTime": "", "mobile": "", "companyName": "", "ip": "" } ```