TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTicketProductUploadRequest req = new AlitripTicketProductUploadRequest();
req.setOutProductId("1111");
req.setNeedEnterDate(1L);
req.setDesc("商品详情描述");
AlitripTicketProductUploadRequest.CodeSendingInfo obj1 = new AlitripTicketProductUploadRequest.CodeSendingInfo();
obj1.setHasEmail(true);
AlitripTicketProductUploadRequest.ItemEleCertInfo obj2 = new AlitripTicketProductUploadRequest.ItemEleCertInfo();
obj2.setExpiryDateType(1L);
obj2.setAutoRefundRate(100L);
obj2.setShopTel("123456");
obj2.setExpiryDays(5L);
obj2.setPackageId(20182296L);
obj2.setExpiredRefundRate(100L);
obj2.setExpiryDateEnd(StringUtils.parseDateTime("2016-08-25 00:00:00"));
obj2.setExpiryDateStart(StringUtils.parseDateTime("2016-05-25 00:00:00"));
obj2.setMerchantName("核销服务提供商");
obj1.setElecInfo(obj2);
obj1.setCodeMode(1L);
req.setCodeSendingInfo(obj1);
req.setPicUrls("商品主图");
req.setTitle("商品标题");
req.setInventoryType(1L);
req.setExpireDate("3");
req.setOutProductName("商户收费项目名称");
req.setReserveLimitType(1L);
req.setReserveLimitRule("1_18_00_3_30");
req.setAliProductId(22L);
req.setUpdateOutProductId("2222");
AlitripTicketProductUploadResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTicketProductUploadRequest req = new AlitripTicketProductUploadRequest();
req.OutProductId = "1111";
req.NeedEnterDate = 1L;
req.Desc = "商品详情描述";
AlitripTicketProductUploadRequest.CodeSendingInfoDomain obj1 = new AlitripTicketProductUploadRequest.CodeSendingInfoDomain();
obj1.HasEmail = true;
AlitripTicketProductUploadRequest.ItemEleCertInfoDomain obj2 = new AlitripTicketProductUploadRequest.ItemEleCertInfoDomain();
obj2.ExpiryDateType = 1L;
obj2.AutoRefundRate = 100L;
obj2.ShopTel = "123456";
obj2.ExpiryDays = 5L;
obj2.PackageId = 20182296L;
obj2.ExpiredRefundRate = 100L;
obj2.ExpiryDateEnd = DateTime.Parse(2016-08-25 00:00:00");
obj2.ExpiryDateStart = DateTime.Parse(2016-05-25 00:00:00");
obj2.MerchantName = "核销服务提供商";
obj1.ElecInfo= obj2;
obj1.CodeMode = 1L;
req.CodeSendingInfo_ = obj1;
req.PicUrls = "商品主图";
req.Title = "商品标题";
req.InventoryType = 1L;
req.ExpireDate = "3";
req.OutProductName = "商户收费项目名称";
req.ReserveLimitType = 1L;
req.ReserveLimitRule = "1_18_00_3_30";
req.AliProductId = 22L;
req.UpdateOutProductId = "2222";
AlitripTicketProductUploadResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTicketProductUploadRequest;
$req->setOutProductId("1111");
$req->setNeedEnterDate("1");
$req->setDesc("商品详情描述");
$code_sending_info = new CodeSendingInfo;
$code_sending_info->has_email="true";
$elec_info = new ItemEleCertInfo;
$elec_info->expiry_date_type="1";
$elec_info->auto_refund_rate="100";
$elec_info->shop_tel="123456";
$elec_info->expiry_days="5";
$elec_info->package_id="20182296";
$elec_info->expired_refund_rate="100";
$elec_info->expiry_date_end="2016-08-25 00:00:00";
$elec_info->expiry_date_start="2016-05-25 00:00:00";
$elec_info->merchant_name="核销服务提供商";
$code_sending_info->elec_info = $elec_info;
$code_sending_info->code_mode="1";
$req->setCodeSendingInfo(json_encode($code_sending_info));
$req->setPicUrls("商品主图");
$req->setTitle("商品标题");
$req->setInventoryType("1");
$req->setExpireDate("3");
$req->setOutProductName("商户收费项目名称");
$req->setReserveLimitType("1");
$req->setReserveLimitRule("1_18_00_3_30");
$req->setAliProductId("22");
$req->setUpdateOutProductId("2222");
$resp = $c->execute($req, $sessionKey);
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=alitrip.ticket.product.upload' \
-d 'partner_id=apidoc' \
-d 'session=45f6c5b9-3a9b-4f5f-bfc8-b571506d8279' \
-d 'sign=698380871668FC57BF59AB2EDBC6499D' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+22%3A30%3A00' \
-d 'v=2.0' \
-d 'ali_product_id=22' \
-d 'code_sending_info=null' \
-d 'desc=%E5%95%86%E5%93%81%E8%AF%A6%E6%83%85%E6%8F%8F%E8%BF%B0' \
-d 'expire_date=3' \
-d 'inventory_type=1' \
-d 'need_enter_date=1' \
-d 'out_product_id=1111' \
-d 'out_product_name=%E5%95%86%E6%88%B7%E6%94%B6%E8%B4%B9%E9%A1%B9%E7%9B%AE%E5%90%8D%E7%A7%B0' \
-d 'pic_urls=%E5%95%86%E5%93%81%E4%B8%BB%E5%9B%BE' \
-d 'reserve_limit_rule=1_18_00_3_30' \
-d 'reserve_limit_type=1' \
-d 'title=%E5%95%86%E5%93%81%E6%A0%87%E9%A2%98' \
-d 'update_out_product_id=2222'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTicketProductUploadRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.out_product_id="1111"
req.need_enter_date=1
req.desc="商品详情描述"
req.code_sending_info=""
req.pic_urls="商品主图"
req.title="商品标题"
req.inventory_type=1
req.expire_date="3"
req.out_product_name="商户收费项目名称"
req.reserve_limit_type=1
req.reserve_limit_rule="1_18_00_3_30"
req.ali_product_id=22
req.update_out_product_id="2222"
try:
resp= req.getResponse(sessionkey)
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,"alitrip.ticket.product.upload");
add_param(pRequest,"out_product_id","1111");
add_param(pRequest,"need_enter_date","1");
add_param(pRequest,"desc","商品详情描述");
add_param(pRequest,"code_sending_info","数据结构JSON示例");
add_param(pRequest,"pic_urls","商品主图");
add_param(pRequest,"title","商品标题");
add_param(pRequest,"inventory_type","1");
add_param(pRequest,"expire_date","3");
add_param(pRequest,"out_product_name","商户收费项目名称");
add_param(pRequest,"reserve_limit_type","1");
add_param(pRequest,"reserve_limit_rule","1_18_00_3_30");
add_param(pRequest,"ali_product_id","22");
add_param(pRequest,"update_out_product_id","2222");
pResponse = top_execute(pClient,pRequest,sessionKey);
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('alitrip.ticket.product.upload', {
'out_product_id':'1111',
'need_enter_date':'1',
'desc':'商品详情描述',
'code_sending_info':'数据结构JSON示例',
'pic_urls':'商品主图',
'title':'商品标题',
'inventory_type':'1',
'expire_date':'3',
'out_product_name':'商户收费项目名称',
'reserve_limit_type':'1',
'reserve_limit_rule':'1_18_00_3_30',
'ali_product_id':'22',
'update_out_product_id':'2222'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})