TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaTaxInvoiceSyncLedgerRequest req = new AlibabaTaxInvoiceSyncLedgerRequest();
AlibabaTaxInvoiceSyncLedgerRequest.SyncLedgerInvoiceRequest obj1 = new AlibabaTaxInvoiceSyncLedgerRequest.SyncLedgerInvoiceRequest();
obj1.setAmount("1");
obj1.setCertifyDate(StringUtils.parseDateTime("2019-07-23 10:00:00"));
obj1.setCertifyFlag("1");
obj1.setCheckSum("222222");
obj1.setCheckCertifyTime(StringUtils.parseDateTime("2019-09-01 00:00:00"));
obj1.setCipherText("cdgdfsd");
obj1.setExcludingTaxAmount("1");
List<AlibabaTaxInvoiceSyncLedgerRequest.InputInvoiceLineLedgerDto> list3 = new ArrayList<AlibabaTaxInvoiceSyncLedgerRequest.InputInvoiceLineLedgerDto>();
AlibabaTaxInvoiceSyncLedgerRequest.InputInvoiceLineLedgerDto obj4 = new AlibabaTaxInvoiceSyncLedgerRequest.InputInvoiceLineLedgerDto();
list3.add(obj4);
obj4.setAmount("1");
obj4.setExcludingTaxAmount("1");
obj4.setGoodsDesc("货物名称");
obj4.setModel("规格型号");
obj4.setQuantity("1");
obj4.setQuantityUnit("个");
obj4.setTaxAmount("1");
obj4.setUnitPrice("1");
obj4.setTaxRate("6");
obj1.setInputInvoiceLineDTOList(list3);
obj1.setInvoiceCode("2132232322");
obj1.setInvoiceDate(StringUtils.parseDateTime("2019-07-23 10:00:00"));
obj1.setInvoiceNo("20190723");
obj1.setInvoiceStatus("1");
obj1.setInvoiceType("s");
obj1.setCheckCertifyStatus("B1");
obj1.setMachineCode("机器编码");
obj1.setPurchaserBankInfo("购方银行信息");
obj1.setPurchaserContactInfo("购方联系方式");
obj1.setPurchaserName("购方名称");
obj1.setPurchaserTaxNo("购方税号");
obj1.setRemark("备注");
obj1.setSellerBankInfo("销方银行信息");
obj1.setSellerContactInfo("销方联系人信息");
obj1.setSellerName("销方名称");
obj1.setSellerTaxNo("销方税号");
obj1.setTaxAmount("10");
obj1.setTaxPeriod("201907");
obj1.setEffectiveTaxAmount("10.0");
obj1.setTaxDeductFag("1");
req.setParamSyncLedgerInvoiceRequest(obj1);
AlibabaTaxInvoiceSyncLedgerResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaTaxInvoiceSyncLedgerRequest req = new AlibabaTaxInvoiceSyncLedgerRequest();
AlibabaTaxInvoiceSyncLedgerRequest.SyncLedgerInvoiceRequestDomain obj1 = new AlibabaTaxInvoiceSyncLedgerRequest.SyncLedgerInvoiceRequestDomain();
obj1.Amount = "1";
obj1.CertifyDate = DateTime.Parse(2019-07-23 10:00:00");
obj1.CertifyFlag = "1";
obj1.CheckSum = "222222";
obj1.CheckCertifyTime = DateTime.Parse(2019-09-01 00:00:00");
obj1.CipherText = "cdgdfsd";
obj1.ExcludingTaxAmount = "1";
List<AlibabaTaxInvoiceSyncLedgerRequest.InputInvoiceLineLedgerDtoDomain> list3 = new List<AlibabaTaxInvoiceSyncLedgerRequest.InputInvoiceLineLedgerDtoDomain>();
AlibabaTaxInvoiceSyncLedgerRequest.InputInvoiceLineLedgerDtoDomain obj4 = new AlibabaTaxInvoiceSyncLedgerRequest.InputInvoiceLineLedgerDtoDomain();
list3.Add(obj4);
obj4.Amount = "1";
obj4.ExcludingTaxAmount = "1";
obj4.GoodsDesc = "货物名称";
obj4.Model = "规格型号";
obj4.Quantity = "1";
obj4.QuantityUnit = "个";
obj4.TaxAmount = "1";
obj4.UnitPrice = "1";
obj4.TaxRate = "6";
obj1.InputInvoiceLineDTOList= list3;
obj1.InvoiceCode = "2132232322";
obj1.InvoiceDate = DateTime.Parse(2019-07-23 10:00:00");
obj1.InvoiceNo = "20190723";
obj1.InvoiceStatus = "1";
obj1.InvoiceType = "s";
obj1.CheckCertifyStatus = "B1";
obj1.MachineCode = "机器编码";
obj1.PurchaserBankInfo = "购方银行信息";
obj1.PurchaserContactInfo = "购方联系方式";
obj1.PurchaserName = "购方名称";
obj1.PurchaserTaxNo = "购方税号";
obj1.Remark = "备注";
obj1.SellerBankInfo = "销方银行信息";
obj1.SellerContactInfo = "销方联系人信息";
obj1.SellerName = "销方名称";
obj1.SellerTaxNo = "销方税号";
obj1.TaxAmount = "10";
obj1.TaxPeriod = "201907";
obj1.EffectiveTaxAmount = "10.0";
obj1.TaxDeductFag = "1";
req.ParamSyncLedgerInvoiceRequest_ = obj1;
AlibabaTaxInvoiceSyncLedgerResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaTaxInvoiceSyncLedgerRequest;
$param_sync_ledger_invoice_request = new SyncLedgerInvoiceRequest;
$param_sync_ledger_invoice_request->amount="1";
$param_sync_ledger_invoice_request->certify_date="2019-07-23 10:00:00";
$param_sync_ledger_invoice_request->certify_flag="1";
$param_sync_ledger_invoice_request->check_sum="222222";
$param_sync_ledger_invoice_request->check_certify_time="2019-09-01 00:00:00";
$param_sync_ledger_invoice_request->cipher_text="cdgdfsd";
$param_sync_ledger_invoice_request->excluding_tax_amount="1";
$input_invoice_line_d_t_o_list = new InputInvoiceLineLedgerDto;
$input_invoice_line_d_t_o_list->amount="1";
$input_invoice_line_d_t_o_list->excluding_tax_amount="1";
$input_invoice_line_d_t_o_list->goods_desc="货物名称";
$input_invoice_line_d_t_o_list->model="规格型号";
$input_invoice_line_d_t_o_list->quantity="1";
$input_invoice_line_d_t_o_list->quantity_unit="个";
$input_invoice_line_d_t_o_list->tax_amount="1";
$input_invoice_line_d_t_o_list->unit_price="1";
$input_invoice_line_d_t_o_list->tax_rate="6";
$param_sync_ledger_invoice_request->input_invoice_line_d_t_o_list = $input_invoice_line_d_t_o_list;
$param_sync_ledger_invoice_request->invoice_code="2132232322";
$param_sync_ledger_invoice_request->invoice_date="2019-07-23 10:00:00";
$param_sync_ledger_invoice_request->invoice_no="20190723";
$param_sync_ledger_invoice_request->invoice_status="1";
$param_sync_ledger_invoice_request->invoice_type="s";
$param_sync_ledger_invoice_request->check_certify_status="B1";
$param_sync_ledger_invoice_request->machine_code="机器编码";
$param_sync_ledger_invoice_request->purchaser_bank_info="购方银行信息";
$param_sync_ledger_invoice_request->purchaser_contact_info="购方联系方式";
$param_sync_ledger_invoice_request->purchaser_name="购方名称";
$param_sync_ledger_invoice_request->purchaser_tax_no="购方税号";
$param_sync_ledger_invoice_request->remark="备注";
$param_sync_ledger_invoice_request->seller_bank_info="销方银行信息";
$param_sync_ledger_invoice_request->seller_contact_info="销方联系人信息";
$param_sync_ledger_invoice_request->seller_name="销方名称";
$param_sync_ledger_invoice_request->seller_tax_no="销方税号";
$param_sync_ledger_invoice_request->tax_amount="10";
$param_sync_ledger_invoice_request->tax_period="201907";
$param_sync_ledger_invoice_request->effective_tax_amount="10.0";
$param_sync_ledger_invoice_request->tax_deduct_fag="1";
$req->setParamSyncLedgerInvoiceRequest(json_encode($param_sync_ledger_invoice_request));
$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.tax.invoice.sync.ledger' \
-d 'partner_id=apidoc' \
-d 'sign=3788A44D7CDA64475E5125AE9E42E6AD' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-25+15%3A56%3A10' \
-d 'v=2.0' \
-d 'param_sync_ledger_invoice_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaTaxInvoiceSyncLedgerRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_sync_ledger_invoice_request=""
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.tax.invoice.sync.ledger");
add_param(pRequest,"param_sync_ledger_invoice_request","数据结构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.tax.invoice.sync.ledger', {
'param_sync_ledger_invoice_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})