提交开票申请,如果商户授权自动开票则自动转开票,否则等待商户审核。
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
param_invoice_apply_dto | InvoiceApplyDto | 必须 | 申请开票请求 | ||
|
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
result | ServiceResult | alinkappserver系统返回的通用结果类 | |
|
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); AlibabaEinvoiceProdApplyRequest req = new AlibabaEinvoiceProdApplyRequest(); AlibabaEinvoiceProdApplyRequest.InvoiceApplyDto obj1 = new AlibabaEinvoiceProdApplyRequest.InvoiceApplyDto(); obj1.setApplyAmount( "100.00" ); obj1.setApplyMode( "normal" ); obj1.setApplySource( "order" ); obj1.setAutoCreateInvoice( true ); obj1.setBusinessType(1L); AlibabaEinvoiceProdApplyRequest.InvoiceCreatePayeeInfoDto obj2 = new AlibabaEinvoiceProdApplyRequest.InvoiceCreatePayeeInfoDto(); obj2.setPayeeAddress( "杭州市西溪路" ); obj2.setPayeeBankAccountId( "1234567890123456" ); obj2.setPayeeBankName( "招商银行" ); obj2.setPayeeChecker( "李四" ); obj2.setPayeeName( "阿里巴巴测试企业" ); obj2.setPayeeOperator( "张三" ); obj2.setPayeePhone( "18899999999" ); obj2.setPayeeReceiver( "王五" ); obj2.setPayeeRegisterNo( "QWERTY123456789" ); obj1.setCreateInvPayeeInfo(obj2); obj1.setDeviceId( "001" ); List<AlibabaEinvoiceProdApplyRequest.InvoiceApplyItemsDto> list4 = new ArrayList<AlibabaEinvoiceProdApplyRequest.InvoiceApplyItemsDto>(); AlibabaEinvoiceProdApplyRequest.InvoiceApplyItemsDto obj5 = new AlibabaEinvoiceProdApplyRequest.InvoiceApplyItemsDto(); list4.add(obj5); obj5.setAmount( "1170.00" ); obj5.setBizMemo( "明细备注" ); obj5.setDiscount( "0" ); obj5.setItemId( "123456" ); obj5.setItemName( "电视机" ); obj5.setItemNo( "1010101010000000000" ); obj5.setItemType( "新零售" ); obj5.setQuantity( "1" ); obj5.setSpecification( "X100" ); obj5.setTaxPrice( "100.00" ); obj5.setTaxRate( "0.17" ); obj5.setUnit( "台" ); obj5.setZeroRateFlag( "1" ); obj1.setInvoiceItems(list4); obj1.setInvoiceKind(0L); obj1.setInvoiceMemo( "备注下" ); obj1.setInvoiceType( "blue" ); obj1.setLevyType(0L); obj1.setNormalInvoiceCode( "111100000000" ); obj1.setNormalInvoiceNo( "00004349" ); obj1.setOuterId( "10001" ); obj1.setPayeeRegisterNo( "QWERT1234567890987" ); obj1.setPayerAddress( "浙江省杭州市余杭区文一西路xxx号" ); obj1.setPayerBankAccountId( "123412341234" ); obj1.setPayerBankName( "招商银行" ); obj1.setPayerEmail( "mytest@xxx.com" ); AlibabaEinvoiceProdApplyRequest.PayerLogisticsInfoDto obj6 = new AlibabaEinvoiceProdApplyRequest.PayerLogisticsInfoDto(); obj6.setContactAddr( "浙江省xxx" ); obj6.setContactMobile( "13888889999" ); obj6.setContactName( "李四" ); obj1.setPayerLogisticsInfo(obj6); obj1.setPayerMemo( "测试" ); obj1.setPayerName( "张三" ); obj1.setPayerPhone( "18234561212" ); obj1.setPayerRegisterNo( "2015020123123" ); obj1.setPayerUid( "123456" ); obj1.setPhoneNumber( "18234561212" ); obj1.setPlatformBizFlag( "1,2" ); obj1.setPlatformCode( "TB" ); obj1.setPlatformTid( "100011101" ); obj1.setPlatformUserId( "12345678" ); obj1.setRedNoticeNo( "12312312" ); obj1.setSourceFlag( "12312312" ); obj1.setSourcePlatformCode( "TB,TM" ); obj1.setSpecialFlag( "02" ); obj1.setTradeTime(StringUtils.parseDateTime( "2020-01-01 00:00:00" )); req.setParamInvoiceApplyDto(obj1); AlibabaEinvoiceProdApplyResponse rsp = client.execute(req); System.out.println(rsp.getBody()); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | < alibaba_einvoice_prod_apply_response > < result > < apply_result_dto > < apply_id >123456</ apply_id > < apply_status >applying</ apply_status > < create_inv_result_list > < invoice_create_simple_result_dto > < biz_error_code >demo</ biz_error_code > < biz_error_msg >demo</ biz_error_msg > < create_status >waitting</ create_status > < error_type >demo</ error_type > < invoice_amount >100</ invoice_amount > < payee_name >test</ payee_name > < payee_register_no >123123</ payee_register_no > < product_code >UKEY</ product_code > < single_serial_no >123123</ single_serial_no > < sum_price >100</ sum_price > < sum_tax >0</ sum_tax > </ invoice_create_simple_result_dto > </ create_inv_result_list > </ apply_result_dto > </ result > </ alibaba_einvoice_prod_apply_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 > |
错误码 | 错误描述 | 解决方案 |
---|