TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaMosinvoiceInfoSendRequest req = new AlibabaMosinvoiceInfoSendRequest();
AlibabaMosinvoiceInfoSendRequest.InvoiceInfoSendDto obj1 = new AlibabaMosinvoiceInfoSendRequest.InvoiceInfoSendDto();
obj1.setInvoiceContentType(0L);
obj1.setSellerBank("中国建设银行浙江省分行营业部");
obj1.setSellerName("浙江银泰百货有限公司");
obj1.setInvoiceTaxAmount("1.00");
obj1.setInvoiceAmount("10.00");
obj1.setSellerAddress("杭州延安路530号");
obj1.setInvoiceExcludingTaxAmount("9.00");
obj1.setInvoiceMaterialType(1L);
obj1.setPurchaserAddress("杭州延安路530号");
obj1.setTicketNo("MJ017122222");
obj1.setInvoiceType(1L);
obj1.setInvoiceNo("12345");
obj1.setInvoiceRequestId("12345");
obj1.setPurchaserBank("中国建设银行浙江省分行营业部");
obj1.setInvoiceIssueType(0L);
obj1.setSellerPhone("0571-850698");
obj1.setInvoiceDate(StringUtils.parseDateTime("2015-05-21 12:00:00"));
obj1.setInvoiceCode("12345");
obj1.setApplyId(12345L);
obj1.setPurchaserName("个人");
obj1.setSellerTaxNo("234354354555543");
obj1.setPurchaserTaxNo("91330212668458134W");
List<AlibabaMosinvoiceInfoSendRequest.InvoiceLineDto> list3 = new ArrayList<AlibabaMosinvoiceInfoSendRequest.InvoiceLineDto>();
AlibabaMosinvoiceInfoSendRequest.InvoiceLineDto obj4 = new AlibabaMosinvoiceInfoSendRequest.InvoiceLineDto();
list3.add(obj4);
obj4.setUnitPrice("1.00");
obj4.setAmount("10.00");
obj4.setQuantity("10.00");
obj4.setItemTaxNo("1060512990000000000");
obj4.setInvoiceLineId(1L);
obj4.setQuantityUnit("件");
obj4.setTax("0.13");
obj4.setTaxAmount("1.30");
obj4.setExcludingTaxAmount("8.70");
obj4.setGoodsDesc("服装");
obj1.setInvoiceLineDTOList(list3);
obj1.setSellerBankAccount("33001613535053");
obj1.setPurchaserType(1L);
obj1.setOssFilePath("http://demo.pdf");
obj1.setStoreNo("HZ01");
req.setSendDTO(obj1);
AlibabaMosinvoiceInfoSendResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaMosinvoiceInfoSendRequest req = new AlibabaMosinvoiceInfoSendRequest();
AlibabaMosinvoiceInfoSendRequest.InvoiceInfoSendDtoDomain obj1 = new AlibabaMosinvoiceInfoSendRequest.InvoiceInfoSendDtoDomain();
obj1.InvoiceContentType = 0L;
obj1.SellerBank = "中国建设银行浙江省分行营业部";
obj1.SellerName = "浙江银泰百货有限公司";
obj1.InvoiceTaxAmount = "1.00";
obj1.InvoiceAmount = "10.00";
obj1.SellerAddress = "杭州延安路530号";
obj1.InvoiceExcludingTaxAmount = "9.00";
obj1.InvoiceMaterialType = 1L;
obj1.PurchaserAddress = "杭州延安路530号";
obj1.TicketNo = "MJ017122222";
obj1.InvoiceType = 1L;
obj1.InvoiceNo = "12345";
obj1.InvoiceRequestId = "12345";
obj1.PurchaserBank = "中国建设银行浙江省分行营业部";
obj1.InvoiceIssueType = 0L;
obj1.SellerPhone = "0571-850698";
obj1.InvoiceDate = DateTime.Parse(2015-05-21 12:00:00");
obj1.InvoiceCode = "12345";
obj1.ApplyId = 12345L;
obj1.PurchaserName = "个人";
obj1.SellerTaxNo = "234354354555543";
obj1.PurchaserTaxNo = "91330212668458134W";
List<AlibabaMosinvoiceInfoSendRequest.InvoiceLineDtoDomain> list3 = new List<AlibabaMosinvoiceInfoSendRequest.InvoiceLineDtoDomain>();
AlibabaMosinvoiceInfoSendRequest.InvoiceLineDtoDomain obj4 = new AlibabaMosinvoiceInfoSendRequest.InvoiceLineDtoDomain();
list3.Add(obj4);
obj4.UnitPrice = "1.00";
obj4.Amount = "10.00";
obj4.Quantity = "10.00";
obj4.ItemTaxNo = "1060512990000000000";
obj4.InvoiceLineId = 1L;
obj4.QuantityUnit = "件";
obj4.Tax = "0.13";
obj4.TaxAmount = "1.30";
obj4.ExcludingTaxAmount = "8.70";
obj4.GoodsDesc = "服装";
obj1.InvoiceLineDTOList= list3;
obj1.SellerBankAccount = "33001613535053";
obj1.PurchaserType = 1L;
obj1.OssFilePath = "http://demo.pdf";
obj1.StoreNo = "HZ01";
req.SendDTO_ = obj1;
AlibabaMosinvoiceInfoSendResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaMosinvoiceInfoSendRequest;
$send_d_t_o = new InvoiceInfoSendDto;
$send_d_t_o->invoice_content_type="0";
$send_d_t_o->seller_bank="中国建设银行浙江省分行营业部";
$send_d_t_o->seller_name="浙江银泰百货有限公司";
$send_d_t_o->invoice_tax_amount="1.00";
$send_d_t_o->invoice_amount="10.00";
$send_d_t_o->seller_address="杭州延安路530号";
$send_d_t_o->invoice_excluding_tax_amount="9.00";
$send_d_t_o->invoice_material_type="1";
$send_d_t_o->purchaser_address="杭州延安路530号";
$send_d_t_o->ticket_no="MJ017122222";
$send_d_t_o->invoice_type="1";
$send_d_t_o->invoice_no="12345";
$send_d_t_o->invoice_request_id="12345";
$send_d_t_o->purchaser_bank="中国建设银行浙江省分行营业部";
$send_d_t_o->invoice_issue_type="0";
$send_d_t_o->seller_phone="0571-850698";
$send_d_t_o->invoice_date="2015-05-21 12:00:00";
$send_d_t_o->invoice_code="12345";
$send_d_t_o->apply_id="12345";
$send_d_t_o->purchaser_name="个人";
$send_d_t_o->seller_tax_no="234354354555543";
$send_d_t_o->purchaser_tax_no="91330212668458134W";
$invoice_line_d_t_o_list = new InvoiceLineDto;
$invoice_line_d_t_o_list->unit_price="1.00";
$invoice_line_d_t_o_list->amount="10.00";
$invoice_line_d_t_o_list->quantity="10.00";
$invoice_line_d_t_o_list->item_tax_no="1060512990000000000";
$invoice_line_d_t_o_list->invoice_line_id="1";
$invoice_line_d_t_o_list->quantity_unit="件";
$invoice_line_d_t_o_list->tax="0.13";
$invoice_line_d_t_o_list->tax_amount="1.30";
$invoice_line_d_t_o_list->excluding_tax_amount="8.70";
$invoice_line_d_t_o_list->goods_desc="服装";
$send_d_t_o->invoice_line_d_t_o_list = $invoice_line_d_t_o_list;
$send_d_t_o->seller_bank_account="33001613535053";
$send_d_t_o->purchaser_type="1";
$send_d_t_o->oss_file_path="http://demo.pdf";
$send_d_t_o->store_no="HZ01";
$req->setSendDTO(json_encode($send_d_t_o));
$resp = $c->execute($req);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=alibaba.mosinvoice.info.send' \
-d 'partner_id=apidoc' \
-d 'sign=33C08DCB69F1D55BDCBEE2ABFA4B5DCC' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-23+17%3A25%3A29' \
-d 'v=2.0' \
-d 'send_d_t_o=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaMosinvoiceInfoSendRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.send_d_t_o=""
try:
resp= req.getResponse()
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"alibaba.mosinvoice.info.send");
add_param(pRequest,"send_d_t_o","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('alibaba.mosinvoice.info.send', {
'send_d_t_o':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})