已开具发票上传接口

需授权 预计阅读时间: 37 分钟

测试地址:https://www.chinaeinv.com:943/igs/api/invoiceApi.jspa

生产地址:https://www.chinaeinv.com/igs/api/invoiceApi.jspa

公共参数

名称 说明
appCode 由电子发票平台分配的 appCode
cmdName chinaeinv.api.invoice.v3.upload
sign 数字签名字符串,调用方需要使用电子发票服务平台􏰀供的数字证书对 请求报文进行签名并作 Base64 编码,生成数字签名字符串

请求参数说明

名称 类型 M Len 描述
serialNo String 50 操作流水号。传入重复的操作流水号则认为是重复操作。
postTime String 19 请求发送时间。格式为yyyy-MM-dd HH:mm:ss。
order Object      
 ├orderNo String 50 订单编号。
invoice        
 ├taxpayerName String 100 销货方名称。
 ├taxpayerCode String 20 销货方纳税人识别号。
 ├taxpayerAddress String 79 销货方地址。
 ├taxpayerTel String 20 销货方电话。
 ├taxpayerBankName String 69 销货方开户银行。
 ├taxpayerBankAccount String 30 销货方银行账号。
 ├customerName String 100 购货方名称。
 ├customerCode String 20 购货方纳税人识别号。
 ├customerAddress String 79 购货方地址。
 ├customerTel String 20 购货方电话。
 ├customerBankName String 69 购货方开户银行。
 ├customerBankAccount String 30 购货方银行账号。
 ├code String 20 发票代码+发票号码。
 ├invoiceType String 10 开票类型。p:电子增值税普通发票(默认),ps:电子收购发票,py:成品油
 ├checkCode String 20 校验码。
 ├status String 1 发票状态 1:正常 3:红冲 4:被红冲。
 ├generateTime String 16 开票日期 格式为yyyy-MM-dd HH:mm。
 ├totalAmount String   税价合计金额。
 ├noTaxAmount String   不含税金额。
 ├taxAmount String   税额。
 ├drawer String 8 开票人。
 ├payee String 8 收款人。
 ├reviewer String 8 复核人。
 ├remark String 200 发票备注。
 ├relatedCode String   关联发票编号。如果发票被冲红,则与被冲红发票相互关联。
 ├qrCode String   二维码
 ├taxDeviceNo String   税控设备编号
 ├cipherText String   密文
 ├items Array     发票项目明细列表。
    ├ name String 90 商品名称。
  ├ catalogCode String 19 商品分类编码。
  ├ type String 1 发票行性质 0 正常行、1 折扣行、2 被 折扣行。
  ├ spec String 40 规格型号。
  ├ uom String 20 单位。
  ├ quantity String   数量。(数量和单价,要么全为空,要么全不为空)
  ├ price String   商品单价。(数量和单价,要么全为空,要么全不为空)
  ├ taxRate String 6 税率。
  ├ noTaxAmount String   不含税金额。
  ├ taxAmount String   税额。
  ├ amount String   税价合计金额。
  ├ preferentialPolicyFlg String 1 优惠政策标识。0:不使用,1:使用。
  ├ addedValueTaxFlg String 1 增值税特殊管理。(当优惠政策标识为1时必填)
  └ zeroTaxRateFlg String 1 零税率标识。1:免税,2:不征税,3:普通零税率。税率为零的情况下,如果不传,则默认为3:普通零税率。
notices Array   通知方式列表,最多3条。
 ├ type String   通知类型。短信:sms;电子邮件:email。
 └ value String   通知类型为短信时,必须为手机号码;通知类型为电子邮件时,必须为邮件地址。

返回参数说明

名称 类型 描述
code String 操作流水号。
message String 处理结果
pdfUrl String 上传成功之后发票的pdf下载地址。
viewUrl String 上传成功之后发票的pdf下载地址。

请求报文示例

{
    "serialNo":"20190315204945",
    "postTime":"2019-03-15 20:49:45",
    "order":{
        "orderNo":"03100180041148132057"
    },
    "invoice":{
        "taxpayerCode":"91310110570751949T",
        "taxpayerName":"上海睿齐实业有限公司",
        "taxpayerAddress":"上海市呼兰路799号7号楼1楼716室021-35030503",
        "taxpayerTel":"",
        "taxpayerBankName":"上海银行鞍山支行31664103001547894",
        "taxpayerBankAccount":"",
        "customerCode":"12100000425006176T",
        "customerName":"东华大学",
        "customerAddress":"",
        "customerTel":"",
        "customerBankName":"",
        "customerBankAccount":"",
        "code":"03100180041148132057",
        "checkCode":"49993292203393988828",
        "status":"3",
        "generateTime":"2019-03-13 00:00:00",
        "totalAmount":"-138.00",
        "taxAmount":"-19.03",
        "noTaxAmount":"-118.97",
        "payee":"赵萍",
        "drawer":"赵萍",
        "reviewer":"邓婕",
        "relatedCode":"03100180041148132029",
        "remark":"对应正数发票代码:031001800411号码:48132029 146180T",
        "qrCode":"01,01,031001800411,48132057,-118.97,20190313,49993292203393988828,52CB,",
        "taxDeviceNo":"661561103964",
        "cipherText":"4+9>+<-***********95-5",
        "items":[
            {
                "name":"*塑料制品*进口透析袋35mm(MD55)",
                "catalogCode":"1070601990000000000",
                "type":"0",
                "spec":"35mm(MD55)分子量MW3500",
                "uom":"卷",
                "quantity":"-0.500021",
                "price":"275.98840297",
                "taxRate":"0.16",
                "noTaxAmount":"-118.97",
                "taxAmount":"-19.03",
                "amount":"-138.00",
                "addedValueTaxFlg":"",
                "preferentialPolicyFlg":"0",
                "zeroTaxRateFlg",""
            }
        ]
    },
    "notices":[
        {
            "type":"sms",
            "value":"13710828471"
        },
        {
            "type":"email",
            "value":"wyq532@126.com"
        }
    ]
}

响应报文示例

{
    "code": "处理结果代码",
    "message": "处理结果消息",
    "pdfUrl": "pdf下载地址",
    "viewUrl": "发票查看地址"
}

返回错误说明

代码 说明
0 处理成功。
1 系统内部错误,如出现该错误请及时联系电子发票服务平台。
2 参数校验未通过,详情请参考处理结果消息。
3 appCode不存在或数字证书不可用。
4 数字签名错误,请检查数字证书、字符编码格式等是否正确。
5 重复操作,即serialNo重复。
6 正在处理中。
400 纳税人不存在或不可用,可能是传入的纳税人识别号错误。
401 要冲红或者查询的发票不存在。

发票上传接口