商家自研ERP发起开票请求,无需授权,API只能使用商家入驻的税号进行开票
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
platform_code | String | 必须 | TM | 电商平台代码。TB=淘宝 、TM=天猫 、JD=京东、DD=当当、PP=拍拍、YX=易讯、EBAY=ebay、QQ=QQ网购、AMAZON=亚马逊、SN=苏宁、GM=国美、WPH=唯品会、JM=聚美、LF=乐蜂、MGJ=蘑菇街、JS=聚尚、PX=拍鞋、YT=银泰、YHD=1号店、VANCL=凡客、YL=邮乐、YG=优购、1688=阿里巴巴、POS=POS门店、OTHER=其他, (只传英文编码) | |
payee_bankaccount | String | 可选 | 92523123213412341234 |
|
开票方银行及 帐号 |
invoice_items | InvoiceItem [] | 必须 |
|
电子发票明细 | |
|
|||||
payee_receiver | String | 可选 | 小张 |
|
收款人 |
payee_operator | String | 必须 | 小张 |
|
开票人 |
invoice_amount | String | 必须 | 1170.00 | 开票金额; 当开红票时,该字段为负数 | |
payee_checker | String | 可选 | 小林 |
|
复核人 |
payer_phone | String | 可选 | 18234561212 |
|
消费者联系电话 |
payer_register_no | String | 可选 | 2015020123123 |
|
付款方税务登记证号。对企业开具电子发票时必填。目前北京地区暂未开放对企业开具电子发票,若北京地区放开后,对于向企业开具的情况,付款方税务登记证号和名称也不能为空 |
payee_phone | String | 可选 | 18234561212 |
|
收款方电话 |
payer_email | String | 可选 | mytest@xxx.com | 消费者电子邮箱 | |
payee_name | String | 必须 | 海尔商城 |
|
开票方名称,公司名(如:XX商城) |
payer_address | String | 可选 | 浙江省杭州市余杭区文一西路xxx号 |
|
消费者地址 |
invoice_memo | String | 可选 | 电子发票测试 |
|
发票备注,有些省市会把此信息打印到PDF中 |
payer_bankaccount | String | 可选 | 123412341234 |
|
付款方开票开户银行及账号 |
sum_price | String | 必须 | 1000.00 | 合计金额(新版中为必传) 当开红票时,该字段为负数 | |
normal_invoice_no | String | 可选 | 00004349 |
|
原发票号码(开红票时传入) |
invoice_type | String | 必须 | blue | 发票(开票)类型,蓝票blue,红票red,默认blue | |
payee_register_no | String | 必须 | 20150201321123 |
|
收款方税务登记证号 |
normal_invoice_code | String | 可选 | 111100000000 |
|
原发票代码(开红票时传入) |
business_type | Number | 必须 | 0 | 默认:0。对于商家对个人开具,为0;对于商家对企业开具,为1; | |
erp_tid | String | 可选 | 123456789 | ERP系统中的单据号。如果没有erp的唯一单据号。建议使用platform_code+”_”+ platform_tid的组合方式 | |
serial_no | String | 必须 | 20141234123412341 |
|
开票流水号,唯一标志开票请求。如果两次请求流水号相同,则表示重复请求。请调用平台统一流水号获取接口,alibaba.einvoice.serialno.generate。 |
platform_tid | String | 必须 | 123412341234 | 电商平台对应的主订单号 | |
payee_address | String | 必须 | 山东省青岛市 |
|
开票方地址(新版中为必传) |
sum_tax | String | 必须 | 170.00 | 合计税额 当开红票时,该字段为负数 | |
payer_name | String | 必须 | 张三 |
|
付款方名称, 对应发票台头 |
apply_id | String | 可选 | 438fjew823kj9 | 开票申请ID,接收了开票申请消息后,需要把apply_id带上 | |
invoice_kind | Number | 可选 | 0 |
|
发票种类,0=电子发票,1=纸质发票,2=专票 |
red_notice_no | String | 可选 | 32342343454 | 红字通知单号,冲红时需要,商家跟税局申请 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
is_success | Boolean | true | 开票信息是否成功接受 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); AlibabaEinvoiceMerchantCreatereqRequest req = new AlibabaEinvoiceMerchantCreatereqRequest(); req.setPlatformCode( "TM" ); req.setPayeeBankaccount( "92523123213412341234" ); List<AlibabaEinvoiceMerchantCreatereqRequest.InvoiceItem> list2 = new ArrayList<AlibabaEinvoiceMerchantCreatereqRequest.InvoiceItem>(); AlibabaEinvoiceMerchantCreatereqRequest.InvoiceItem obj3 = new AlibabaEinvoiceMerchantCreatereqRequest.InvoiceItem(); list2.add(obj3); obj3.setSumPrice( "1000.00" ); obj3.setTax( "170.00" ); obj3.setPrice( "100.00" ); obj3.setItemNo( "123456" ); obj3.setUnit( "台" ); obj3.setItemName( "电视机" ); obj3.setTaxRate( "0.17" ); obj3.setRowType( "0" ); obj3.setQuantity( "10" ); obj3.setSpecification( "X100" ); obj3.setAmount( "1170.00" ); req.setInvoiceItems(list2); req.setPayeeReceiver( "小张" ); req.setPayeeOperator( "小张" ); req.setInvoiceAmount( "1170.00" ); req.setPayeeChecker( "小林" ); req.setPayerPhone( "18234561212" ); req.setPayerRegisterNo( "2015020123123" ); req.setPayeePhone( "18234561212" ); req.setPayerEmail( "mytest@xxx.com" ); req.setPayeeName( "海尔商城" ); req.setPayerAddress( "浙江省杭州市余杭区文一西路xxx号" ); req.setInvoiceMemo( "电子发票测试" ); req.setPayerBankaccount( "123412341234" ); req.setSumPrice( "1000.00" ); req.setNormalInvoiceNo( "00004349" ); req.setInvoiceType( "blue" ); req.setPayeeRegisterNo( "20150201321123" ); req.setNormalInvoiceCode( "111100000000" ); req.setBusinessType(0L); req.setErpTid( "123456789" ); req.setSerialNo( "20141234123412341" ); req.setPlatformTid( "123412341234" ); req.setPayeeAddress( "山东省青岛市" ); req.setSumTax( "170.00" ); req.setPayerName( "张三" ); req.setApplyId( "438fjew823kj9" ); req.setInvoiceKind(0L); req.setRedNoticeNo( "32342343454" ); AlibabaEinvoiceMerchantCreatereqResponse rsp = client.execute(req); System.out.println(rsp.getBody()); |
1 2 3 | < alibaba_einvoice_merchant_createreq_response > < is_success >true</ is_success > </ alibaba_einvoice_merchant_createreq_response > |
1 2 3 4 5 6 | < error_response > < code >50</ code > < msg >Remote service error</ msg > < sub_code >isv.invalid-parameter</ sub_code > < sub_msg >非法参数</ sub_msg > </ error_response > |
错误码 | 错误描述 | 解决方案 |
---|---|---|
isv.invalid-parameter | 参数错误 | 修改参数重新传入 |
isv.invalid-permission | 权限错误 | 检查权限 |
isp.system-error | 系统错误 | 联系小二排查 |