TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TmallPromotionCouponQueryRequest req = new TmallPromotionCouponQueryRequest();
req.setBizType("suning");
req.setBuyerId("123456");
req.setBuyerNick("我是测试");
req.setExtraString("{\"seller_id\":111111}");
TmallPromotionCouponQueryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TmallPromotionCouponQueryRequest req = new TmallPromotionCouponQueryRequest();
req.BizType = "suning";
req.BuyerId = "123456";
req.BuyerNick = "我是测试";
req.Extra = "{\"seller_id\":111111}";
TmallPromotionCouponQueryResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TmallPromotionCouponQueryRequest;
$req->setBizType("suning");
$req->setBuyerId("123456");
$req->setBuyerNick("我是测试");
$req->setExtra("{\"seller_id\":111111}");
$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=tmall.promotion.coupon.query' \
-d 'partner_id=apidoc' \
-d 'sign=BA72D3DE77BBF0A010FDE17AC0B39FE0' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-25+17%3A35%3A31' \
-d 'v=2.0' \
-d 'biz_type=suning' \
-d 'buyer_id=123456' \
-d 'buyer_nick=%E6%88%91%E6%98%AF%E6%B5%8B%E8%AF%95' \
-d 'extra=%7B%5C%22seller_id%5C%22%3A111111%7D'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TmallPromotionCouponQueryRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.biz_type="suning"
req.buyer_id="123456"
req.buyer_nick="我是测试"
req.extra="{\"seller_id\":111111}"
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,"tmall.promotion.coupon.query");
add_param(pRequest,"biz_type","suning");
add_param(pRequest,"buyer_id","123456");
add_param(pRequest,"buyer_nick","我是测试");
add_param(pRequest,"extra","{\"seller_id\":111111}");
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('tmall.promotion.coupon.query', {
'biz_type':'suning',
'buyer_id':'123456',
'buyer_nick':'我是测试',
'extra':'{\"seller_id\":111111}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})