<a name="menu">目录</a>
1. [费用记录类型](#feeTypeDic)
1. [发票申请-交易信息列表](#platformPage)
1. [发票申请-功能2](#apply2)
1. [商户抬头](#merchantTitle)
1. [商户地址](#merchantAddr)
1. [商户地址编辑](#merchantAddrSave)
1. [发票申请列表](#merchantinvoiceapplyPage)
1. [发票列表](#invoicePage)
1. [平台查询发票详情](#invoiceOrder)
1. [发票申请-功能1-确定个体户开票](#confirmInvoice)
1. [发票申请-功能1-提交申请](#apply1)


## **<a name="feeTypeDic"> 费用记录类型</a>**
[返回到目录](#menu)
##### URL
[/web/saas/merchantCtl/feeTypeDic]

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

``` javascript

{}

```

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

{
    "status": 0,
    "msg": "success",
    "data": [
        {
            "type": "00",
            "name": "注册订单付款"
        },
        {
            "type": "10",
            "name": "转账交易付款"
        }
    ]
}


```

## **<a name="platformPage"> 发票申请-交易信息列表</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/platformPage]

``` javascript

{
    "currentPage": 1,
    "pageSize": 10,
    "fee_type": "00",               // 00 注册订单 10功能2转账交易 20功能3转账交易
    "createBegin": "",              // 创建时间-开始  可以只选开始，也可以只选结束，格式：2020-04-03
    "createEnd": ""                 // 创建时间-结束
}

```

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

fee_type == "10" || fee_type == "20"

{
    "status": 0,
    "msg": "success",
    "data": {
        "feeType": "20",                                 // 00 注册订单 10功能2转账交易 20功能3转账交易
        "count": 1493,
        "rows": [
            {
                "id": "1298463038002876",                 // id
                "trade_no": "T10014949456718",            // 打款编号
                "acc_name": "11",                         // 收款户名
                "acc_no": "3",                            // 收款账号
                "trade_status": "01",                     // 交易状态
                "trade_status_name": "待处理",            // 交易状态名称
                "trade_desc": "",                        // 交易描述
                "trade_receipt": "",                     // 回执图片，判断为空时不显示按钮
                "amt": 131083.32,                         // 商户请求打款金额
                "actual_amt": 131083.32,                  // 实发金额
                "service_tax": 2621.66,                   // 服务费
                "deduct_amt": 128535.56,                  // 总扣款金额
                "credit_code": "92321311MA205KN92J",      // 信用代码
                "out_trade_no": "13695922219233720",      // 商户订单号
                "created_at": "2020-04-03 11:38:19",      // 创建时间


                "order_id": "1298386120003945",           // 订单id
                "open_bank": "4",                         // 开户行全称
                "trade_time": null,                       // 交易时间
                "remark": "6",                            // 打款备注
                "service_rate": 0,                        // 服务费比率     
            }
        ]
    },
    "requestid": "d14ae10263ec45ab8cd3be23ab59faf2"
}

fee_type == "00"

{
    "status": 0,
    "msg": "success",
    "data": {
        "count": 0,
        "rows": [
            {
                "id": "1726724188001516",                   // 订单编号
                "price": 1500,                              // 订单价格
                "pay_voucher_img": "0",                     // 付款凭证
                "audit_remark": "",                         // 审核凭证
                "deliver_man": "",                          // 交付联系人
                "deliver_mobile": "",                       // 交付联系电话
                "deliver_addr": "",                         // 邮寄地址
                "created_at": "2020-03-21 07:45:18",        // 创建时间
                "status": "3030",                           // 订单状态
                "status_name": "已交付"                      // 订单状态名称
                // 订单信息
                "bminfo": {
                    "idcard_front": "11111",                // 身份证正面
                    "idcard_back": "11111",                 // 身份证反面
                    "legal_name": "11111",                  // 法人名称
                    "legal_mobile": "11111",                // 手机号
                    "legal_idno": "11111",                  // 身份证号码
                    "company_names": "11111",               // 个体户名称
                    "bank_front": "11111",                  // 银行卡正面图
                    "bank_back": "11111",                   // 银行卡反面图
                    "bank_name": "11111",                   // 开户行
                    "bank_no": "11111",                     // 银行卡号
                    "bank_mobile": "11111",                 // 预留手机号
                    "domicile_id": "",                      // 注册地id
                    "domicile_name": "",                    // 注册地
                    "business_scope_id": "",                // 经营范围id
                    "business_type": "",                    // 经营范围类型
                    "business_scope": "",                   // 经营范围详情
                }
            }
        ],
        "total": 1
    },
    "requestid": "00521a0a0f094c8d982bf4375fbe91b1"
}

```


## **<a name="merchantTitle"> 商户抬头</a>**
[返回到目录](#menu)
##### URL
[/web/saas/merchantCtl/title]  <a href="/doc/saas/merchant.md#title">【 去接口详情 】</a>

## **<a name="merchantAddr"> 商户地址</a>**
[返回到目录](#menu)
##### URL
[/web/saas/merchantCtl/addr]  <a href="/doc/saas/merchant.md#addr">【 去接口详情 】</a>

## **<a name="merchantAddrSave"> 商户地址编辑</a>**
[返回到目录](#menu)
##### URL
[/web/saas/merchantCtl/addr]  <a href="/doc/saas/merchant.md#saveAddr">【 去接口详情 】</a>

## **<a name="apply2"> 发票申请-功能2</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/apply]

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

``` javascript
{
	"fee_type":"10",                    // 费用类型 00注册订单费用 10平台转账费用 20商户转账费用
    "invoice_type": "10",               // 发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
    "data_ids": [                       // 所选交易列表
        "1",
        "2"
    ],
}

```

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


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

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

```javascript
{
    "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="invoicePage"> 发票列表 </a>**　　　　　
[返回到目录](#menu)　　　　　

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

```javascript
{
    "currentPage": 1,       
    "pageSize": 10,         
    "apply_no": "",        //发票申请编号
    "invoice_no": "",       //发票代码
    "from_name": "",        //开票方名称
    "begin_time": "",       //开始时间
    "end_time": ""          //结束时间
}
```

**返回结果**   

| 参数名|数据类型| 说明 |
|---|:---:|---|
| 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"
}

```

## **<a name="invoiceOrder"> 平台查询发票详情 </a>**　　　　　
[返回到目录](#menu)　　　　　

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

```javascript
{
    "id": "11091789235001142",       
}
```

**返回结果**   

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

**示例**
```javascript
{
    "status": 0,
    "msg": "操作成功",
    "data": {
        "id": "11091789235001142",
        "saas_id": "10000",
        "saas_merchant_id": "11248111258000991",
        "parent_id": "11091769149000453",
        "batch_no": "13295393796003361",
        "owner_type": "10",
        "fee_type": "10",
        "invoice_type": "30",
        "invoice_amount": 200000,                                 //价税合计总额
        "status": "1050",
        "audit_remark": null,
        "sve_invoice_id": "",
        "apply_no": "11874538320003399",                          //发票申请编号
        "from_name": "name4",                                     
        "from_credit_code": "TMAH78917902114178",
        "from_addr": "好的好的和",
        "from_mobile": "18833836395",
        "from_bank": "张哈哈哈",
        "from_account": "1377373",
        "to_name": "name",                                       //抬头名称
        "to_credit_code": "credit_code-1",                       //社会统一信用代码
        "to_addr": "addr-1",                                     //地址
        "to_mobile": "mobile-1",                                 //联系电话
        "to_bank": "bank_name",                                  //银行
        "to_account": "bank_account",                            //账号
        "mail_to": "10",                                         //邮寄人
        "mail_mobile": "10",                                     //邮寄电话
        "mail_addr": "10",                                       //邮寄地址
        "personal_invoice_tax": null,                            //个税
        "additional_tax": null,                                  //附加税
        "value_added_tax": null,                                 //增值税
        "service_tax": null,                                     //服务费
        "unit": null,
        "quantity": null,
        "price": null,
        "remark": null,
        "created_at": "2020-04-12 18:32:50",                    //申请时间
        "updated_at": "2020-04-12 18:32:50",
        "deleted_at": null,
        "version": 0,
        "fee_type_name": "平台转账费用",                          //服务类型
        "saasInvoice": null,
        "invoice_type_name":"普通发票",                           //发票类型
        "saasInvoice": {                                         
            "id": "11091789235001142",
            "saas_id": "saas_id",
            "saas_merchant_id": "11248111258000991",
            "batch_no": "batch_no",
            "owner_type": "10",
            "fee_type": "10",
            "invoice_type": "10",
            "province": "province",
            "invoice_join": "10",
            "invoice_no": "invoice_no",
            "invoice_number": "invoice_number",
            "invoice_time": "2020-04-09T13:32:06.000Z",        
            "invoice_amount": 1,
            "invoice_img": null,                                 //发票图片
            "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",
            "mail_no": null,                                    //快递单号
            "personal_invoice_tax": 10,
            "additional_tax": 1,
            "value_added_tax": 1,
            "service_tax": 1,
            "summary": "summary",
            "created_at": "2020-04-09T13:31:40.000Z",
            "updated_at": "2020-04-09T13:31:42.000Z",
            "deleted_at": null,
            "version": 0
        },
        "tradOrder": [                                           //账单列表
            {
                "id": 1001004,
                "trade_no": "T10010048046185",
                "saas_merchant_id": "11248111258000991",
                "order_id": "1298386418003804",
                "order_type": "10",
                "out_trade_no": "13695998839234974",
                "acc_name": "张王李兆",
                "credit_code": "92321311MA205KN09Y",
                "acc_no": "12314213",
                "open_bank": "12312",
                "amt": 12344500,
                "actual_amt": 12344500,
                "deduct_amt": 12591390,
                "service_tax": 246890,
                "trade_status": "01",
                "trade_time": null,
                "trade_desc": "",
                "trade_receipt": "",
                "remark": "15",
                "saas_id": "10000",
                "saas_invoice_id": "11091789235001142",
                "created_at": "2020-04-03 11:33:21",
                "updated_at": "2020-04-03 11:33:21",
                "deleted_at": null,
                "version": 0
            }
        ]
    },
    "bizmsg": "empty"
}
```

## **<a name="confirmInvoice"> 发票申请-功能1-确定个体户开票</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/confirmInvoice]

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

``` javascript
{
	"fee_type":"10",                    // 费用类型 00注册订单费用 10平台转账费用 20商户转账费用
    "invoice_type": "10",               // 发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
    "data_ids": [                       // 所选交易列表
        "1",
        "2"
    ],
}

```

#### 返回结果
```javascript
{
    "status": 0,
    "msg": "success",
    "data": {
        // 金额总计，第三页显示
        "tax": {
            "additional_tax_total": 1294.37,            // 附加税
            "personal_invoice_tax_total": 733.92,       // 个税
            "value_added_tax_total": 10786.46,          // 增值税
            "service_tax_total": 1561.48,               // 服务费
            "pay_total": 14376.23                       // 总付款金额（付款信息处使用）
        },

        // 付款账户信息 
        "main": {
            "bank_account": "bank_account",             // 账户名称
            "bank_name": "bank_name",                   // 开户行
            "bank_no": "bank_no",                       // 银行卡号
        },
        
        // 第二页使用，确定个体户开票信息
        "invoiceList": [
            {
                "name": "name4",                        // 个体户名称
                "credit_code": "ZJFMC1231231231231",    // 统一社会信用代码
                "is_bank": 1,                 
                "is_bank_name": "已开户",               // 开户状态
                "invoice_amount": 17436.58,            // 开票金额
                "personal_invoice_tax": 0,             // 个税
                "additional_tax": 0,                   // 附加税
                "value_added_tax": 0,                  // 增值税
                "service_tax": 174.37,                 // 服务费
                "unit": "",                            // 单位
                "quantity": "",                        // 数量
                "price": "",                           // 单价
                "remark": "",                          // 备注
                "data_ids": "1001579,1001582"          // 不用管，但是后面要带着这个
            },
        ]
    }
}
```


1. [发票申请-功能1-提交申请](#apply1)

## **<a name="#apply1"> 发票申请-功能2</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/apply]

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

``` javascript
{
	"fee_type":"10",                    // 费用类型 00注册订单费用 10平台转账费用 20商户转账费用
    "invoice_type": "10",               // 发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
    "pay_voucher": "https//1112321",    // 付款凭证 第三页上传的

    // 发票信息，确定个体户开票结果中的invoiceList，其中unit, quantity, price, remark跟随页面联动
    "invoiceList": [
        {
            "name": "name4",
            "credit_code": "ZJFMC1231231231231",
            "is_bank_name": "未开户",
            "invoice_amount": 17436.58,
            "service_tax": 174.37,
            "personal_invoice_tax": 0,
            "additional_tax": 0,
            "value_added_tax": 0,
            "unit": "11",
            "quantity": "12",
            "price": "13",
            "remark": "14",
            "data_ids": "1001579,1001582"
        },
    ]
}

```

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