TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
FreshxPromotionCouponCreateRequest req = new FreshxPromotionCouponCreateRequest();
FreshxPromotionCouponCreateRequest.CreateCouponDo obj1 = new FreshxPromotionCouponCreateRequest.CreateCouponDo();
obj1.setSpreadEndTime(StringUtils.parseDateTime("2021-03-01 00:00:00"));
obj1.setOnlyNewUser(false);
obj1.setEffectiveEndTime(StringUtils.parseDateTime("2021-03-01 00:00:00"));
obj1.setStoreId(1L);
obj1.setTitle("满3减2");
obj1.setTotalCount(100L);
obj1.setType(1L);
obj1.setEffectiveStartTime(StringUtils.parseDateTime("2021-03-01 00:00:00"));
obj1.setDecreaseMoney(200L);
obj1.setEffectiveTimeMode("1");
obj1.setItemId(1L);
obj1.setEffectiveStartInterval(100000L);
FreshxPromotionCouponCreateRequest.User obj2 = new FreshxPromotionCouponCreateRequest.User();
obj2.setUserNick("菜菜");
obj2.setClientIp("127.0.1");
obj2.setUserId("11");
obj1.setCreatorUser(obj2);
obj1.setInstruction("满3元可用");
obj1.setEffectiveInterval(100000L);
obj1.setStartFee(300L);
obj1.setPersonLimitCount(10L);
obj1.setCategoryList(new Long[] { 1,2,3 };
);
obj1.setOuterId("1111");
obj1.setSpreadStartTime(StringUtils.parseDateTime("2021-03-01 00:00:00"));
FreshxPromotionCouponCreateRequest.User obj3 = new FreshxPromotionCouponCreateRequest.User();
obj3.setUserNick("菜菜");
obj3.setClientIp("127.0.0.1");
obj3.setUserId("1");
obj1.setModifierUser(obj3);
List<FreshxPromotionCouponCreateRequest.CrowdDO> list5 = new ArrayList<FreshxPromotionCouponCreateRequest.CrowdDO>();
FreshxPromotionCouponCreateRequest.CrowdDO obj6 = new FreshxPromotionCouponCreateRequest.CrowdDO();
list5.add(obj6);
obj6.setExtra("无");
obj6.setCrowdId("12312");
obj6.setType(1L);
obj1.setCrowdList(list5);
req.setParam(obj1);
FreshxPromotionCouponCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
FreshxPromotionCouponCreateRequest req = new FreshxPromotionCouponCreateRequest();
FreshxPromotionCouponCreateRequest.CreateCouponDoDomain obj1 = new FreshxPromotionCouponCreateRequest.CreateCouponDoDomain();
obj1.SpreadEndTime = DateTime.Parse(2021-03-01 00:00:00");
obj1.OnlyNewUser = false;
obj1.EffectiveEndTime = DateTime.Parse(2021-03-01 00:00:00");
obj1.StoreId = 1L;
obj1.Title = "满3减2";
obj1.TotalCount = 100L;
obj1.Type = 1L;
obj1.EffectiveStartTime = DateTime.Parse(2021-03-01 00:00:00");
obj1.DecreaseMoney = 200L;
obj1.EffectiveTimeMode = "1";
obj1.ItemId = 1L;
obj1.EffectiveStartInterval = 100000L;
FreshxPromotionCouponCreateRequest.UserDomain obj2 = new FreshxPromotionCouponCreateRequest.UserDomain();
obj2.UserNick = "菜菜";
obj2.ClientIp = "127.0.1";
obj2.UserId = "11";
obj1.CreatorUser= obj2;
obj1.Instruction = "满3元可用";
obj1.EffectiveInterval = 100000L;
obj1.StartFee = 300L;
obj1.PersonLimitCount = 10L;
obj1.CategoryList = new long[] { 1,2,3 };
;
obj1.OuterId = "1111";
obj1.SpreadStartTime = DateTime.Parse(2021-03-01 00:00:00");
FreshxPromotionCouponCreateRequest.UserDomain obj3 = new FreshxPromotionCouponCreateRequest.UserDomain();
obj3.UserNick = "菜菜";
obj3.ClientIp = "127.0.0.1";
obj3.UserId = "1";
obj1.ModifierUser= obj3;
List<FreshxPromotionCouponCreateRequest.CrowdDODomain> list5 = new List<FreshxPromotionCouponCreateRequest.CrowdDODomain>();
FreshxPromotionCouponCreateRequest.CrowdDODomain obj6 = new FreshxPromotionCouponCreateRequest.CrowdDODomain();
list5.Add(obj6);
obj6.Extra = "无";
obj6.CrowdId = "12312";
obj6.Type = 1L;
obj1.CrowdList= list5;
req.Param_ = obj1;
FreshxPromotionCouponCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new FreshxPromotionCouponCreateRequest;
$param = new CreateCouponDo;
$param->spread_end_time="2021-03-01 00:00:00";
$param->only_new_user="false";
$param->effective_end_time="2021-03-01 00:00:00";
$param->store_id="1";
$param->title="满3减2";
$param->total_count="100";
$param->type="1";
$param->effective_start_time="2021-03-01 00:00:00";
$param->decrease_money="200";
$param->effective_time_mode="1";
$param->item_id="1";
$param->effective_start_interval="100000";
$creator_user = new User;
$creator_user->user_nick="菜菜";
$creator_user->client_ip="127.0.1";
$creator_user->user_id="11";
$param->creator_user = $creator_user;
$param->instruction="满3元可用";
$param->effective_interval="100000";
$param->start_fee="300";
$param->person_limit_count="10";
$param->category_list="[1,2,3]";
$param->outer_id="1111";
$param->spread_start_time="2021-03-01 00:00:00";
$modifier_user = new User;
$modifier_user->user_nick="菜菜";
$modifier_user->client_ip="127.0.0.1";
$modifier_user->user_id="1";
$param->modifier_user = $modifier_user;
$crowd_list = new CrowdDO;
$crowd_list->extra="无";
$crowd_list->crowd_id="12312";
$crowd_list->type="1";
$param->crowd_list = $crowd_list;
$req->setParam(json_encode($param));
$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=taobao.freshx.promotion.coupon.create' \
-d 'partner_id=apidoc' \
-d 'session=47ff96f6-1274-41eb-a4f5-df0c13f30e75' \
-d 'sign=FA48AD6522EB0B9E46FAEB169662909A' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-06+11%3A12%3A04' \
-d 'v=2.0' \
-d 'param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.FreshxPromotionCouponCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param=""
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,"taobao.freshx.promotion.coupon.create");
add_param(pRequest,"param","数据结构JSON示例");
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('taobao.freshx.promotion.coupon.create', {
'param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})