四、开票接口
## 开票申请接口
#### 接口地址:
/open/api/v1/lw/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|否||
## 开票结果查询
#### 接口地址:
/open/api/v1/lw/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 | 否 | |
|billInformation|发票链接|List< String >|否||
## 开票结果回调
#### 回调类型:lwInvoiceResult
#### 响应参数说明:
|参数名称| 参数含义|数据类型| 是否必有| 参数备注|
|-|-|-|-|-|
|callbackType|回调类型|String|是|固定返回:qsInvoiceResult|
|invoiceBillNo|开票订单编号|String| 是|示例:"2020091720135423517696"|
|invoiceClassification| 开票类型|Integer| 是|0.普票 1.专票|
|invoiceStatus|开票状态|Integer| 是|参看[开票状态码](https://easydoc.net/doc/95180784/Ry461Ra3/g5SDIGDl)|
|mainstayId|主体id|Integer| 是|示例:1|
|invoiceAmount|开票金额|BigDecimal| 是|示例:11.05|
|invoiceContent|发票内容|String| 是|示例:"信息技术服务*技术服务费"|
|expressCompany|快递公司|String| 是|示例:"xx物流有限公司"|
|expressNo|快递单号|String| 是|示例:"2020221993XXXX1278"|
|postStatus|邮寄状态0:未邮寄 1.已邮寄|Integer| 是|示例:1|
|failReason|失败原因|String| 否|示例:"xx"|
|invoiceDetailList|发票明细列表|List<InvoiceDetail>| 否|注意:已发票审核状态变为:(已开票)后的发票订单明细详情为准|
|billInformation|发票链接|List< String >|否||
#### InvoiceDetail发票明细列表字段:
|参数名称| 参数含义|数据类型| 是否必有| 参数备注|
|-|-|-|-|-|
|requestNo|明细订单编号|String| 是|示例:"xx"|
|parentRequestNo|关联作废订单的明细编号|String| 否|只有在有已作废订单时才会有|
|invoiceCode|发票代码|String| 否|示例:"xx"|
|invoiceNumber|发票号码|String| 否|示例:"xx"|
|billingTime|开票时间|Date| 是|示例:"yyyy-MM-dd HH:mm:ss"|
|invoiceAmount|汇总开票金额(含税金额)|BigDecimal| 是|示例:101|
|totalAmount|不含税金额|BigDecimal| 是|示例:100|
|taxRate|税率|BigDecimal| 是|示例:0.1|
|taxAmount|税额|BigDecimal| 是|示例:1|
|invoiceStatus|发票状态 -1:已作废 0:未开票 1:已开票|Integer| 是|示例:"xx"|
|invoiceContent|开票内容|String| 是|示例:"xx"|
|purchaserInvoiceTitle|购买方发票抬头|String| 是|示例:"xx"|
|purchaserTaxNumber|购买方税号|String| 是|示例:"xx"|
|purchaserAddressPhone|购买方地址、电话|String| 是|示例:"xx"|
|purchaserBankAccount|购买方开户行及账号|String| 是|示例:"xx"|
|sellerInvoiceTitle|销售方发票抬头|String| 是|示例:"xx"|
|sellerTaxNumber|销售方税号|String| 是|示例:"xx"|
|sellerAddressPhone|销售方地址、电话|String| 是|示例:"xx"|
|sellerBankAccount|销售方开户行及账号|String| 是|示例:"xx"|