发票四要素查验接口

请求说明

HTTP请求方式:POST

base_url:

https://www.feeclouds.com

API:

/api/v2/invoice/check

请求参数格式:

form-data

注意事项:

1. 调用超时时间,建议设置为300s。

2. 随着业务升级,接口返回字段会增加,但不会删减,请做好技术准备。

发票说明

查验发票类型说明:

增值税专用发票:符合发票代码规则的10位发票代码,第8位为1、2、5、7时,为增值税专用发票;符合发票代码规则的12位发票代码,第1位为0,第11、12位为13,为增值税专用发票
增值税普通发票:符合发票代码规则的10位发票代码,第8位为3、6时,为增值税普通发票;符合发票代码规则的12位发票代码,第1位为0,第11、12位为04、05、06、07、11、12,为增值税普通发票
机动车销售统一发票:符合发票代码规则的12位发票代码,第1位为1,第8位为2,为机动车销售统一发票
二手车销售统一发票:符合发票代码规则的12位发票代码,第1位为0,第11、12位为17,为二手车销售统一发票
货物运输业增值税专用发票:暂不支持(已在2016年7月1日停止使用,不支持查询超1年以上的发票)
电子发票(数电票):全面数字化的电子发票,发票号码为20位

content字段说明:

示例:01,04,4403162320,33903671,1165.05,20170803,81171643890998027896,27E4,
格式说明:01,04,4403162320(发票代码),33903671(发票号码),1165.05(税前金额/不含税价),20170803(开票日期),81171643890998027896(20位校验码),27E4,
示例为发票二维码扫描信息,可以直接使用,参数不足时可为空,如,,4403162320,33903671,1165.05,20170803,,

发票content字段必填项说明:

增值税专用发票:按照content格式  ,,(发票代码),(发票号码),(税前金额),(开票日期),,,
增值税普通发票:按照content格式  ,,(发票代码),(发票号码),,(开票日期),(20位校验码/后6位校验码),,
机动车销售统一发票:按照content格式  ,,(发票代码),(发票号码),(不含税价),(开票日期),,,
二手车销售发票:按照content格式  ,,(发票代码),(发票号码),(车价合计),(开票日期),,,
数电票(发票种类0910、0920):按照content格式  ,,,(发票号码),(价税合计),(开票日期),,,
数电票平台开具的纸质发票(0901、0904):按增值税专用发票、增值税普通发票的四要素查验
注意:数电平台开具的纸质普通发票,票面如果没有校验码,则使用密码区数电票号码的后六位,作为校验码

参数说明

参数 参数类型 必须 说明
company_key str 费耘系统提供的企业company_key
nonce_str str 6位随机字符串
sign str 根据签名生成规则生成的签名
content str 发票查验字符串,详见发票说明
check_only str 查验后是否提交到费耘系统
0-提交;1-不提交
不传该参数时,默认为0
department_id str 获取部门信息接口中 is_branch=1的子公司对应的id
user_id str 发票归属人的id
memo str 其他备注,可以为发票添加自定义备注

返回结果

返回成功json示例(增值税普通发票、增值税专用发票、增值税电子普通发票、增值税电子专用发票)

{
    "msg": "成功",
    "code": 0,
    "data": {
        "invoice_detail": [
            {
                "dj": "14.030235917952625",
                "tszcbs": " ",
                "ggxh": " ",
                "hwmc": "*服装*婴儿服装",
                "slv": "16",
                "sjsl": " ",
                "sl": "5430",
                "dw": "件",
                "je": "76184.18",
                "se": "12189.47",
                "sjse": " "
            }
        ],
        "forbidens": [
            false,
            false,
            false,
            false,
            false
        ],
        "invoice": {
            "gfdzdh": "北京市顺义区机场西路 010-50207450",
            "fpdm": "3200111130",
            "zfbz": "N",
            "zfbz_new": "N",
            "xfdzdh": "宁波市余杭区解放路 0511-88069911",
            "kprq": "20181211",
            "gfsbh": "911108337151011111",
            "dkbz": " ",
            "title": "江苏增值税专用发票",
            "gfyhzh": "中国建设银行股份有限公司 0114177070017701",
            "content": ",,3200111130,08016326,76184.18,20181211,,",
            "bswj_match":"1",
            "bswj":{
                    "file_type": "ofd",
                    "path": "https://app-fc-hybrid.oss-accelerate.aliyuncs.com/bswj/124/051002000113_15655349.ofd?OSSAccessKeyId=UtsfGjiJTnHhgKLZ&Expires=1620802492&Signature=igEWbqxsaBzhMf5ulKT7u6TOY7Q%3D",
                    "preview_url": "https://app-fc-hybrid.oss-accelerate.aliyuncs.com/bswj/124/051002000113_15655349.jpg?OSSAccessKeyId=UtsfGjiJTnHhgKLZ&Expires=1620802492&Signature=Ex6ACB6dfdwsh1%2BGJ4jewDhHXQw%3D"
                },
            "file_path": null,
            "jqbh": "795966151212",
            "jshj": "88373.65",
            "memo": null,
            "cycs": null,
            "xfsbh": "913211888132116255",
            "je": "76184.18",
            "gfmc": "北京亿达科技股份有限公司",
            "fpzl": "01",
            "bz": " ",
            "fphm": "08016326",
            "xfmc": "宁波运丰服饰有限公司",
            "xfyhzh": "工行皇塘支行1104111123026109444",
            "jym": "64074318847048833333",
            "se": "12189.47",
            "tspzbz": ""
        },
        "invoiceid": "505ba19de4cb9c1ea0770d7043f45664"
    }
}

返回成功json示例(通行费发票)

{
    "msg": "成功",
    "code": 0,
    "data": {
        "invoiceid": "dfab8f0b387c4e618d5c27a753c7eb93",
        "forbidens": [
            false,
            false,
            false,
            false,
            false
        ],
        "invoice": {
            "gfdzdh": " ",
            "txfbz": "Y",
            "cpybz":"N",
            "fpdm": "012001700111",
            "zfbz": "N",
            "zfbz_new": "N",
            "xfdzdh": "天津市南开区建设路30号111室4000077554",
            "kprq": "20181210",
            "gfsbh": "911200007314945234",
            "dkbz": " ",
            "title": "天津增值税电子普通发票",
            "gfyhzh": " ",
            "content": "01,10,012001700111,17513311,1000,20181210,02038360637781832277,DFC2,",
            "bswj_match":"1",
            "bswj":{
                    "file_type": "ofd",
                    "path": "https://app-fc-hybrid.oss-accelerate.aliyuncs.com/bswj/124/051002000113_15655349.ofd?OSSAccessKeyId=UtsfGjiJTnHhgKLZ&Expires=1620802492&Signature=igEWbqxsaBzhMf5ulKT7u6TOY7Q%3D",
                    "preview_url": "https://app-fc-hybrid.oss-accelerate.aliyuncs.com/bswj/124/051002000113_15655349.jpg?OSSAccessKeyId=UtsfGjiJTnHhgKLZ&Expires=1620802492&Signature=Ex6ACB6dfdwsh1%2BGJ4jewDhHXQw%3D"
                },
            "file_path": null,
            "jqbh": "499099653461",
            "jshj": "1000.00",
            "memo": null,
            "cycs": null,
            "xfsbh": "911201015594623423",
            "je": "1000.00",
            "gfmc": "天津丰联食品有限公司",
            "fpzl": "14",
            "bz": " ",
            "fphm": "17513311",
            "xfmc": "天津市高速公路联网收费管理中心",
            "xfyhzh": "农行天津河北支行营业部02-160001040017111",
            "jym": "02081863772233836011",
            "se": "0.00"
        },
        "invoice_detail": [
            {
                "cph": "津123456",
                "hwmc": "*预付卡销售*ETC卡充值费",
                "tszcbs": "1",
                "slv": "不征收",
                "sjsl": " ",
                "txrqz": " ",
                "txrqq": " ",
                "je": "1000.00",
                "lx": " ",
                "se": "***"
                "sjse": " "
            }
        ]
    }

返回成功json示例(机动车销售统一发票)

{
    "msg": "成功",
    "code": 0,
    "data": {
        "invoiceid": "437bcbf0326748be84bf8e8d8be0b8a2",
        "forbidens": [
            false,
            false,
            false,
            false,
            false
        ],
        "invoice": {
            "zh": "201000911326913",
            "memo": null,
            "xcrs": "3",
            "fpdm": "113001720211",
            "zfbz": "N",
            "zfbz_new": "N",
            "kprq": "20181014",
            "gfsbh": "911211823301444423",
            "dkbz": "1",
            "fdjhm": "J4634035",
            "swjg_dm": "150330120",
            "skph": "010021661508",
            "content": "01,03,133260017211,08100811,97241.38,20181014,",
            "bswj_match":"1",
            "bswj":{
                    "file_type": "ofd",
                    "path": "https://app-fc-hybrid.oss-accelerate.aliyuncs.com/bswj/124/051002000113_15655349.ofd?OSSAccessKeyId=UtsfGjiJTnHhgKLZ&Expires=1620802492&Signature=igEWbqxsaBzhMf5ulKT7u6TOY7Q%3D",
                    "preview_url": "https://app-fc-hybrid.oss-accelerate.aliyuncs.com/bswj/124/051002000113_15655349.jpg?OSSAccessKeyId=UtsfGjiJTnHhgKLZ&Expires=1620802492&Signature=Ex6ACB6dfdwsh1%2BGJ4jewDhHXQw%3D"
                },
            "sjdh": "无",
            "title": "浙江机动车销售统一发票",
            "wspzhm": " ",
            "cjfy": "97241.38",
            "file_path": null,
            "jqbh": null,
            "hgzs": "WJ8H020145011C7",
            "jshj": "112800.00",
            "dh": "0571-88817808",
            "cjhm": "LJ180111KBBD9J457",
            "cycs": null,
            "xhdwmc": "杭州顺捷通贸汽车有限公司",
            "dz": "浙江省杭州市西湖区新安镇文明村6幢",
            "cllx": "载货汽车",
            "xfsbh": null,
            "dw": "1.795",
            "cd": "安徽合肥",
            "fpzl": "03",
            "sfzhm": "91332118010531125Y",
            "fphm": "00870011",
            "jkzmsh": "无",
            "khyh": "杭州余杭农村商业银行",
            "swjg_mc": "国家税务总局杭州市余杭区税务局",
            "nsrsbh": "91396490301103658J",
            "zzssl": "16",
            "cpxh": "江淮牌HFP71K1CC101111",
            "zzsse": "15558.62",
            "ghdw": "杭州顺达速递",
            "tszcbs": "1",
            "sjsl": " ",
            "sjse": " ",
            "bbxx":"1"
        },
        "invoice_detail": []
    }
}

返回成功json示例(二手车销售统一发票)

{
    "msg": "成功",
    "code": 0,
    "data": {
        "invoiceid": "e556cfabef3243b88487c4208e9fea01",
        "forbidens": [
            false,
            false,
            false,
            false,
            false
        ],
        "invoice": {
            "xfdh": "16532771096",
            "memo": null,
            "fpdm": "061001800117",
            "zfbz": "N",
            "zfbz_new": "N",
            "jyyhzh": " ",
            "kprq": "20180711",
            "xfdw": "刘亮",
            "gfsbh": null,
            "gfhm": "370105048119880511",
            "jysbh": " ",
            "skph": "920319906525",
            "title": "陕西二手车销售统一发票",
            "scdh": "0916-8389130",
            "scmc": "汉中市汽车服务有限公司",
            "xfhm": "310518241041978026",
            "content": ",,061001800117,02005545,46000.00,20180711,,",
            "bswj_match":"1",
            "bswj":{
                    "file_type": "ofd",
                    "path": "https://app-fc-hybrid.oss-accelerate.aliyuncs.com/bswj/124/051002000113_15655349.ofd?OSSAccessKeyId=UtsfGjiJTnHhgKLZ&Expires=1620802492&Signature=igEWbqxsaBzhMf5ulKT7u6TOY7Q%3D",
                    "preview_url": "https://app-fc-hybrid.oss-accelerate.aliyuncs.com/bswj/124/051002000113_15655349.jpg?OSSAccessKeyId=UtsfGjiJTnHhgKLZ&Expires=1620802492&Signature=Ex6ACB6dfdwsh1%2BGJ4jewDhHXQw%3D"
                },
            "cgsmc": "青岛市车管所",
            "file_path": null,
            "jqbh": null,
            "cjhm": "LNB503SCBAJ8FR401",
            "cjhj": "46000.00",
            "cycs": null,
            "cllx": "小型轿车",
            "xfsbh": null,
            "scyhzh": "建行汉中民主街分理处61050001653500001111",
            "fpzl": "15",
            "bz": " ",
            "jydw": " ",
            "fphm": "02405505",
            "gfdw": "",
            "gfdz": "山东省青岛市市黄岛区泰山东路",
            "xfdz": "山西省大安县大安镇怡红园小区",
            "jydz": " ",
            "scsbh": "91616YN2FEX0702MAW",
            "cpxh": "北京牌",
            "jydh": " ",
            "djzh": "612702000628",
            "gfdh": "13843692512",
            "scdz": "汉中区梨园办事处张家湾村一组",
            "cpzh": "陕122222",
            "dkbz": " ",
            "tszcbs":" ",
            "sjsl":" ",
            "sjse":" "
        },
        "invoice_detail": []
    }
}

返回成功json示例(电子发票(铁路电子客票))

{
    "msg": "成功",
    "code": 0,
    "data": {
        "invoice_detail": [],
        "forbidens": [
            false,
            false,
            false,
            false,
            false
        ],
        "invoiceid": "a7b40e4c857f488393665da395ae7ba4",
        "invoice": {
            "file_path": null,
            "gfmc": "国网内蒙古东部电力有限公司",
            "cycs": "642",
            "memo": null,
            "pz": "",
            "bswj": "",
            "fpzl": "83",
            "title": "电子发票(铁路电子客票)",
            "zfbz_new": "0",
            "content": ",,,22119121152000000001,58,20220609,",
            "bswj_match": "",
            "ywlx": "1",
            "se": "4.79",
            "cfsj": "17:37",
            "kprq": "20220609",
            "kttz": "--",
            "cc": "G2581",
            "gfsbh": "91150100692859595Q",
            "fpdm": "",
            "xb": "二等座",
            "ccrq": "20220609",
            "xm": "杜佳蔚",
            "cx": "04车",
            "cfz": "北京南",
            "dzkph": "211522A086061098164112022",
            "zjh": "211202******052792",
            "jshj": "58.00",
            "je": "53.21",
            "ddz": "天津南",
            "slv": "9",
            "zfbz": "N",
            "fphm": "22119121152000000001",
            "xw": "05A号"
        }
    }
}

返回成功json示例(电子发票(航空运输电子客票行程单))

{
    "msg": "成功",
    "code": 0,
    "data": {
        "invoice_detail": [
            {
                "mdz": "大连-周水子 ",
                "sfz": "北京-首都 T3",
                "qfsj": "16:25",
                "zwdj": "P",
                "cyrq": "2024-04-25",
                "hd": "1",
                "cyr": "国航",
                "hbh": "CA8910",
                "kpjb": "P/CA0T240124"
            }
        ],
        "forbidens": [
            false,
            false,
            false,
            false,
            false
        ],
        "invoiceid": "3c1d14fd6fb84c5c923306c565ef0390",
        "invoice": {
            "file_path": null,
            "gfmc": "业之峰诺华家居装饰集团股份有限公司",
            "cycs": "11",
            "memo": null,
            "bswj": "",
            "fpzl": "61",
            "title": "电子发票(航空运输电子客票行程单)",
            "zfbz_new": "0",
            "content": ",,,24118999111000034772,640.00,20240428,",
            "bswj_match": "",
            "se": "48.71",
            "kprq": "20240428",
            "gngjbs": "国内",
            "gfsbh": "911100006787552715",
            "fpdm": "",
            "gp": "",
            "dkbz": "",
            "xm": "钟云霞",
            "dzkph": "9992355143925",
            "zjh": "429006******162500",
            "jshj": "640.00",
            "zfbz": "N",
            "fphm": "24118999111000034772"
        }
    }
}

返回查无此票json示例

{
    "msg": "查无此票",
    "code": 20413,
    "data": {
        "invoice_detail": [],
        "forbidens": [],
        "invoice": {
            "title": "江苏增值税专用发票",
            "fphm": "01630811",
            "fpzl": "01",
            "kprq": "20181211",
            "fpdm": "3200183111"
        },
        "invoiceid": ""
    }
}

返回国税异常json示例

{
    "msg": "国税异常,请1小时后再尝试扫描",
    "code": 20420,
    "data": {
        "invoice_detail": [],
        "forbidens": [],
        "invoice": {
            "title": "北京增值税电子普通发票",
            "fphm": "49729055",
            "fpzl": "10",
            "kprq": "20181213",
            "fpdm": "011001800095"
        },
        "invoiceid": ""
    }
}

返回不一致json示例

{
    "msg": "不一致",
    "code": 20412,
    "data": {
        "invoice_detail": [],
        "forbidens": [],
        "invoice": {
            "title": "河北增值税专用发票",
            "fphm": "03204959",
            "fpzl": "01",
            "kprq": "20181215",
            "fpdm": "1300183137"
        },
        "invoiceid": ""
    }
}

返回查验信息不规范json示例

{
    "msg": "当前发票信息不规范,请检查发票查验项",
    "code": 20419,
    "data": {
        "invoice_detail": [],
        "forbidens": [],
        "invoice": {
            "title": "广东增值税电子普通发票",
            "fphm": "43423333",
            "fpzl": null,
            "kprq": "20181217",
            "fpdm": "4400174470"
        },
        "invoiceid": ""
    }
}

返回参数说明

参数 参数类型 说明
forbidens list 列表中共有5个对象,依次代表发票抬头或纳税人识别号不一致、重复查验、货物名称黑名单、销售方黑名单、增值税发票四项校验。
1、发票抬头或纳税人识别号不一致
以下两种情况下,对象值为True
a、企业启用发票抬头或纳税人识别号不一致禁止录入时,发票查验结果中的购方名称或纳税人识别号与企业设置的信息不一致(例外:货物属于企业所设置的货物白名单范围时,对象值为False);
b、有集团模式的企业在未上传“department_id”情况下,发票查验结果中的购方不属于任一子公司时,对象值为True;
2、重复查验
当查验发票在公司/集团范围内重复查验时,对象值为True;
3、货物名称黑名单
企业已设置货物名称黑名单,发票查验结果的货物名称包含货物名称黑名单内容时,对象值为True;
4、销售方黑名单
企业已设置企业黑名单,发票查验结果的销方企业属于企业黑名单时,对象值为True;
5、增值税发票四项校验
企业启用增值税发票四项校验,当发票查验结果的地址、电话、开户行、账号存在任一一项与企业信息不一致时,对象值为True。
【注意事项】
当调用接口传参数check_only=1时,费耘依然会校验上述五种情况,如出现上述禁止录入的情况,此时返回code为“20509”,如不需要上述校验,可将code为20509的情况等同于code为0,视为查验成功,仅对发票的结果进行操作。
invoiceid str 该发票在费耘系统中的唯一标识

返回参数(invoice)说明

invoice公共字段详见查验接口invoice公共字段说明

参数 参数类型 说明
file_path str 附件地址,有效时间为10分钟
zfbz_new str Y:作废,N:正常,0:正常,2:作废,3:红冲,7:部分红冲,8:全额红冲

返回参数(invoice_detail)说明

详见查验接口invoice_detail说明

results matching ""

    No results matching ""