<a name="menu">目录</a>
1. [查看商户抬头信息详情](#queryInvoiceTitleAndAddr)
1. [商户抬头信息列表](#merchantTitleAddrPage)
1. [更新或保存抬头地址信息](#updateOrSaveTitleAndAddr)
1. [发票申请列表](#applyPage)
1. [发票申请-审核](#audit)
1. [发票申请-发票开具](#makeout)
1. [发票申请-平台发票申请-抬头&邮寄信息：第一步](#platformTitleInfo)
1. [发票申请-平台发票申请-发票信息填写：第二步](#platformInvoiceInfo)
1. [发票申请-平台发票申请-提交：第三步](#platformInvoiceApply)
1. [平台发票申请列表](#platformApplyPage)
1. [平台发票申请-审核](#platformAudit)
1. [平台发票申请-发票办理](#platformHandle)

1. [发票列表](#invoicePage)


## **<a name="queryInvoiceTitleAndAddr"> 查看商户抬头信息详情</a>**
[返回到目录](#menu)
##### URL
[/web/saas/merchantCtl/queryInvoiceTitleAndAddr]

#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
        "id":"11247613247000394"
    }	

```

#### 返回结果
```javascript

{
    "status": 0,
    "msg": "操作成功",
    "data": {
        "saas_merchant_title": [
            {
                "id": "1311886627000462",
                "saas_merchant_id": "11247613247000394",
                "merchant_name": "舟山兰和有限公司",
                "merchant_credit_code": "KHSDLKFJAFJ",
                "merchant_tax_type": "00",
                "merchant_addr": "河南信阳",
                "merchant_mobile": "18833836395",
                "merchant_bank": "北京银行栓秀支行",
                "merchant_account": "zhousanlanhe",
                "created_at": "2020-04-08T01:44:51.000Z",
                "updated_at": "2020-04-08T01:49:05.000Z",
                "deleted_at": null,
                "version": 0
            }
        ],
        "saas_merchant_addr": [
            {
                "id": "12653007180000140",
                "saas_merchant_id": "11247613247000394",
                "mail_addr": "北京朝阳区国创元",
                "mail_mobile": "010-4525821-44",
                "mail_to": "张娇",
                "created_at": "2020-04-08T01:44:51.000Z",
                "updated_at": "2020-04-08T01:49:05.000Z",
                "deleted_at": null,
                "version": 0
            }
        ]
    },
    "bizmsg": "empty",
    "requestid": "8aa4673f14714bf7adacd04487075e9e"
}


```


## **<a name="merchantTitleAddrPage"> 商户抬头信息列表</a>**
[返回到目录](#menu)
##### URL
[/web/saas/merchantCtl/merchantTitleAddrPage]

#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
        "currentPage":1,
    	"pageSize":10,
    	"merchant_name":"舟山兰和有限公司"       //选填  商户名称
    }	

```

#### 返回结果
```javascript

{
    "status": 0,
    "msg": "success",
    "data": {
        "count": 1,
        "rows": [
            {
                "id": "1311886627000462",
                "saas_merchant_id": "11247613247000394",
                "merchant_name": "舟山兰和有限公司",
                "merchant_credit_code": "KHSDLKFJAFJ",
                "merchant_tax_type": "00",
                "merchant_addr": "河南信阳",
                "merchant_mobile": "18833836395",
                "merchant_bank": "北京银行栓秀支行",
                "merchant_account": "zhousanlanhe",
                "created_at": "2020-04-08 01:44:51",
                "updated_at": "2020-04-08T01:49:05.000Z",
                "deleted_at": null,
                "version": 0
            }
        ]
    },
    "requestid": "b8265578defd4d9983c1fcf5088e3bc2"
}


```

## **<a name="updateOrSaveTitleAndAddr"> 更新或保存抬头地址信息</a>**
[返回到目录](#menu)
##### URL
[/web/saas/merchantCtl/updateOrSaveTitleAndAddr]

#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
        "id":"11247613247000394",                  
    	"merchant_name":"舟山兰和有限公司",          //商户名称
    	"merchant_credit_code":"KHSDLKFJAFJ",      // 统一社会信用代码
    	"merchant_tax_type":"00",                  //纳税人类型
    	"merchant_addr":"河南信阳",                 //地址
    	"merchant_mobile":"18833836395",           //电话
    	"merchant_bank":"北京银行栓秀支行",         //银行
    	"merchant_account":"zhousanlanhe",         //账户
    	"mail_addr":"北京朝阳区国创元",             //邮寄地址
    	"mail_mobile":"010-4525821-44",           //邮寄电话
    	"mail_to":"张娇"                          //邮寄人
    }	

```

#### 返回结果
```javascript

{
    "status": 0,
    "msg": "success",
    "data": {
        "count": 1,
        "rows": [
            {
                "id": "1311886627000462",
                "saas_merchant_id": "11247613247000394",
                "merchant_name": "舟山兰和有限公司",
                "merchant_credit_code": "KHSDLKFJAFJ",
                "merchant_tax_type": "00",
                "merchant_addr": "河南信阳",
                "merchant_mobile": "18833836395",
                "merchant_bank": "北京银行栓秀支行",
                "merchant_account": "zhousanlanhe",
                "created_at": "2020-04-08 01:44:51",
                "updated_at": "2020-04-08T01:49:05.000Z",
                "deleted_at": null,
                "version": 0
            }
        ]
    },
    "requestid": "b8265578defd4d9983c1fcf5088e3bc2"
}


```


## **<a name="applyPage"> 发票申请列表 </a>**　　　　　
[返回到目录](#menu)　　　　　

##### URL
[/web/saas/invoiceCtl/applyPage]
#### 参数格式  `JSON`
#### HTTP请求方式 `POST`
#### 请求参数 `POST`

```javascript
// 1000待审核 1010审核通过 1020审核不通过 1030发票办理 1040发票开具 1050平台办理中 1060办理完成

按钮规则
fee_type == "10" && status == 1000 审核
fee_type == "10" && status == 1010 发票开具
fee_type == "10" && status == 1040 平台发票申请

{
    "currentPage": 1,       
    "pageSize": 10,         
    "apply_no": "",        //发票申请编号
    "begin_time": "",       //开始时间
    "end_time": ""          //结束时间
}

```

**返回结果**   

| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |

**示例**
```javascript
{
    "status": 0,
    "msg": "success",
    "data": {
        "count": 1,
        "rows": [
            {
                "id": "1",
                "saas_id": "1",
                "saas_merchant_id": "11248111258000991",
                "batch_no": "1",
                "owner_type": "商户发票",
                "fee_type": "注册订单费用",
                "invoice_type": "增值税专用发票",  //发票类型
                "status": "1",                  //进度
                "sve_invoice_id": "1",
                "apply_no": "1",            //发票申请编号
                "from_name": "1",           //开票方
                "from_credit_code": "1",
                "from_addr": "1",
                "from_mobile": "1",
                "from_bank": "1",
                "from_account": "1",
                "to_name": "1",           //发票抬头
                "to_credit_code": "1",
                "to_addr": "1",
                "to_mobile": "1",
                "to_bank": "1",
                "to_account": "1",
                "mail_to": "1",
                "mail_mobile": "1",
                "mail_addr": "1",
                "personal_invoice_tax": 1,      //个税
                "additional_tax": 1,
                "value_added_tax": 1,
                "service_tax": 1,
                "created_at": "2020-04-10 22:39:43",    //申请时间
                "updated_at": "2020-04-10 22:39:40",
                "deleted_at": null,
                "version": 0,
                "invoice_join": "",
                "price": 0
            }
        ]
    },
    "requestid": "712c62cc9dfd455b82ae13bf68c882c9"
}

```


## **<a name="audit"> 发票申请审核</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/audit]

#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
        "id": 1,                    // 发票id
        "status": 1,                // 审核状态 0失败 1成功
        "remark": "123123"          // 审核备注 必填
    }

```

#### 返回结果
```javascript

{
    "status": 0,
    "msg": "success",
    "data": null
    "requestid": "b8265578defd4d9983c1fcf5088e3bc2"
}


```


## **<a name="makeout"> 发票申请-发票开具</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/makeout]

#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
        "id": 1,                        // 发票id
        "invoice_no": "1",              // 发票号码
        "invoice_number": "3",          // 发票代码
        "invoice_time": "4",            // 开票时间
        "mail_no": "5",                 // 快递单号
        "invoice_img": "6"              // 发票图片
    }

```

#### 返回结果
```javascript

{
    "status": 0,
    "msg": "success",
    "data": null
    "requestid": "b8265578defd4d9983c1fcf5088e3bc2"
}


```

## **<a name="platformTitleInfo"> 发票申请-平台发票申请-抬头&邮寄信息</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/platformTitleAddr]

#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
        "id": 1,                        // 发票id
    }

```

#### 返回结果
```javascript

{
    "status": 0,
    "msg": "success",
    "data": {
        "title": {
            "merchant_name": "舟山兰和有限公司",        // 商户名称
            "merchant_credit_code": "KHSDLKFJAFJ",     // 信用代码
            "merchant_tax_type": "00",                 // 纳税人类型 00一般纳税人 10小规模纳税人
            "merchant_addr": "河南信阳",                // 商户地址
            "merchant_mobile": "18833836395",          // 商户电话
            "merchant_bank": "北京银行栓秀支行",        // 商户开户行
            "merchant_account": "zhousanlanhe",        // 商户银行账号
        },
        "addr": {
            "mail_addr": "北京朝阳区国创元",                // 邮寄地址
            "mail_mobile": "010-4525821-44",               // 联系电话
            "mail_to": "张娇哒哒哒",                       // 收件人
        }
    }
}

```


## **<a name="platformInvoiceInfo"> 发票申请-平台发票申请-发票信息填写</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/platformInvoiceInfo]

该接口如果失败，多请求几次就可以了，长时间不连接，阿里云经常切断开发服务器与数据库的连接

#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
        "id": 1,                        // 发票id
        "invoice_type": "10"            // 发票类型
    }

```

#### 返回结果
```javascript
{
    "status": 0,
    "msg": "success",
    "data": {
        "tax": {                          // 平台发票申请3中显示
            "additional_tax_total": 5000,         // 附加税
            "personal_invoice_tax_total": 5000,            // 个税
            "value_added_tax_total": 700          // 增值税
        },
        "invoiceList": [                // 平台发票申请3中显示编辑
            {
                "name": "舟山兰和有限公司",         // 个体户名称
                "credit_code": "KHSDLKFJAFJ",      // 统一社会信用代码
                "is_bank": 0,                      // 是否开户 0否 1是
                "invoice_amount": 1000000,        // 开票金额
                "personal_invoice_tax": 3000,     // 个税
                "additional_tax": 5000,           // 增值税
                "service_tax": 5000,              // 服务费
                "value_added_tax": 700,           // 附加费
                "unit": "",           // 单位
                "quantity": 0,        // 数量
                "price": 0,         // 单价
                "remark": ""        // 备注
                "发票内容"          // 暂时不做这个
            },
        ]
    }
}

```

## **<a name="platformInvoiceApply"> 发票申请-平台发票申请-提交：第三步</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/platformInvoiceApply]

#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

   {
        "id": 1,                        // 发票id
        "invoice_type": "10"            // 发票类型
    	"mail_addr":"北京朝阳区国创元",             //邮寄地址
    	"mail_mobile":"010-4525821-44",           //邮寄电话
    	"mail_to":"张娇"                          //邮寄人
       "invoiceList": [
           {
               "name": "舟山兰和有限公司",         // 个体户名称
               "credit_code": "KHSDLKFJAFJ",      // 统一社会信用代码
               "is_bank": 0,                      // 是否开户 0否 1是
               "invoice_amount": 1000000,        // 开票金额
               "personal_invoice_tax": 3000,     // 个税
               "additional_tax": 5000,           // 增值税
               "service_tax": 5000,              // 服务费
               "value_added_tax": 700,           // 附加费
               "unit": "",           // 单位
               "quantity": 0,        // 数量
               "price": 0,         // 单价
               "remark": ""        // 备注
               "发票内容"          // 暂时不做这个
           },
           ...好多
       ]
   }

```

#### 返回结果
```javascript
{
    "status": 0,
    "msg": "success",
    "data": null
}

```

## **<a name="platformApplyPage"> 平台发票申请列表 </a>**　　　　　
[返回到目录](#menu)　　　　　

##### URL
[/web/saas/invoiceCtl/platformApplyPage]
#### 参数格式  `JSON`
#### HTTP请求方式 `POST`
#### 请求参数 `POST`

```javascript

按钮规则
status == 1000 审核
status == 1010 发票办理

{
    "currentPage": 1,       
    "pageSize": 10,         
    "apply_no": "",        //发票申请编号
    "begin_time": "",       //开始时间
    "end_time": ""          //结束时间
}
```

**返回结果**   

| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |

**示例**
```javascript
{
    "status": 0,
    "msg": "success",
    "data": {
        "count": 1,
        "rows": [
            {
                "id": "1",
                "saas_id": "1",
                "saas_merchant_id": "11248111258000991",
                "batch_no": "1",
                "owner_type": "商户发票",
                "fee_type": "注册订单费用",
                "invoice_type": "增值税专用发票",  //发票类型
                "status": "1",                  //进度
                "sve_invoice_id": "1",
                "apply_no": "1",            //发票申请编号
                "from_name": "1",           //开票方
                "from_credit_code": "1",
                "from_addr": "1",
                "from_mobile": "1",
                "from_bank": "1",
                "from_account": "1",
                "to_name": "1",           //发票抬头
                "to_credit_code": "1",
                "to_addr": "1",
                "to_mobile": "1",
                "to_bank": "1",
                "to_account": "1",
                "mail_to": "1",
                "mail_mobile": "1",
                "mail_addr": "1",
                "personal_invoice_tax": 1,      //个税
                "additional_tax": 1,
                "value_added_tax": 1,
                "service_tax": 1,
                "created_at": "2020-04-10 22:39:43",    //申请时间
                "updated_at": "2020-04-10 22:39:40",
                "deleted_at": null,
                "version": 0,
                "invoice_join": "",
                "price": 0
            }
        ]
    },
    "requestid": "712c62cc9dfd455b82ae13bf68c882c9"
}

```

## **<a name="platformAudit"> 平台发票申请-审核</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/platformAudit]

#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
        "id": 1,                    // 发票id
        "status": 1,                // 审核状态 0失败 1成功
        "remark": "123123"          // 审核备注 必填
    }

```

#### 返回结果
```javascript

{
    "status": 0,
    "msg": "success",
    "data": null
    "requestid": "b8265578defd4d9983c1fcf5088e3bc2"
}


```

## **<a name="platformHandle"> 平台发票申请-发票办理</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/platformHandle]

#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
        "id": 1,                    // 发票id
    }

```

#### 返回结果
```javascript

{
    "status": 0,
    "msg": "success",
    "data": null
    "requestid": "b8265578defd4d9983c1fcf5088e3bc2"
}

```

## **<a name="invoicePage"> 发票列表 </a>**　　　　　
[返回到目录](#menu)　　　　　

##### URL
[/web/saas/invoiceCtl/invoicePage]
#### 参数格式  `JSON`
#### HTTP请求方式 `POST`
#### 请求参数 `POST`

```javascript
{
    "currentPage": 1,       
    "pageSize": 10,         
    "apply_no": "",        //发票申请编号
    "saas_merchant_id":""     //商户名称（传商户id）
}
```

**返回结果**   

| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |

**示例**
```javascript
{
    "status": 0,
    "msg": "success",
    "data": {
        "count": 1,
        "rows": [
            {
                "id": "1",
                "saas_id": "saas_id",
                "saas_merchant_id": "11248111258000991",
                "batch_no": "batch_no",
                "owner_type": "00",
                "fee_type": "00",         
                "invoice_type": "10",       //发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
                "province": "province",
                "invoice_join": "10",
                "invoice_no": "invoice_no",         //发票代码
                "invoice_number": "invoice_number", //发票号码
                "invoice_time": "2020-04-09",       //开票日期
                "invoice_amount": 1,                //价税总计
                "sve_invoice_id": "sve_invoice_id",
                "apply_no": "apply_no",             //发票申请编号
                "from_name": "from_name",           //名称
                "from_credit_code": "from_credit_code", //纳税人识别号
                "from_addr": "from_addr",               //地址
                "from_mobile": "from_mobile",           //电话
                "from_bank": "from_bank",               //开户行
                "from_account": "from_account",         //银行账号
                "to_name": "to_name",                   //邮寄名称
                "to_credit_code": "to_credit_code",     
                "to_addr": "to_addr",                   //邮寄地址
                "to_mobile": "to_mobile",               //邮寄电话
                "to_bank": "to_bank",                   //
                "to_account": "to_account",
                "mail_to": "mail_to",
                "mail_mobile": "mail_mobile",
                "mail_addr": "mail_addr",
                "personal_invoice_tax": 10,
                "additional_tax": 1,
                "value_added_tax": 1,
                "service_tax": 1,
                "summary": "summary",
                "created_at": "2020-04-09 21:31:40",
                "updated_at": "2020-04-09 21:31:42",
                "deleted_at": null,
                "version": 0,
                "price": 0
            }
        ]
    },
    "requestid": "2d9c4d82543f49b197e9bc38e1bdc499"
}

```
