TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AliexpressFreightRedefiningCalculatefreightRequest req = new AliexpressFreightRedefiningCalculatefreightRequest();
req.setHeight(1L);
req.setWeight(1L);
req.setPackAddWeight(1L);
req.setCount(1L);
req.setFreightTemplateId(1000L);
req.setPackAddUnit(1L);
req.setIsCustomPackWeight(false);
req.setWidth(1L);
req.setLength(1L);
AliexpressFreightRedefiningCalculatefreightRequest.Money obj1 = new AliexpressFreightRedefiningCalculatefreightRequest.Money();
obj1.setCent(10000L);
obj1.setCurrencyCode("USD");
obj1.setAmount("100.01");
req.setProductPrice(obj1);
req.setPackBaseUnit(1L);
req.setCountry("RU");
AliexpressFreightRedefiningCalculatefreightResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AliexpressFreightRedefiningCalculatefreightRequest req = new AliexpressFreightRedefiningCalculatefreightRequest();
req.Height = 1L;
req.Weight = 1L;
req.PackAddWeight = 1L;
req.Count = 1L;
req.FreightTemplateId = 1000L;
req.PackAddUnit = 1L;
req.IsCustomPackWeight = false;
req.Width = 1L;
req.Length = 1L;
AliexpressFreightRedefiningCalculatefreightRequest.MoneyDomain obj1 = new AliexpressFreightRedefiningCalculatefreightRequest.MoneyDomain();
obj1.Cent = 10000L;
obj1.CurrencyCode = "USD";
obj1.Amount = "100.01";
req.ProductPrice_ = obj1;
req.PackBaseUnit = 1L;
req.Country = "RU";
AliexpressFreightRedefiningCalculatefreightResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AliexpressFreightRedefiningCalculatefreightRequest;
$req->setHeight("1");
$req->setWeight("1");
$req->setPackAddWeight("1");
$req->setCount("1");
$req->setFreightTemplateId("1000");
$req->setPackAddUnit("1");
$req->setIsCustomPackWeight("false");
$req->setWidth("1");
$req->setLength("1");
$product_price = new Money;
$product_price->cent="10000";
$product_price->currency_code="USD";
$product_price->amount="100.01";
$req->setProductPrice(json_encode($product_price));
$req->setPackBaseUnit("1");
$req->setCountry("RU");
$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=aliexpress.freight.redefining.calculatefreight' \
-d 'partner_id=apidoc' \
-d 'session=a4facd06-c2e7-496b-8bb1-22a9815164c7' \
-d 'sign=24BB3A8E607230B0706F48B01AEB067E' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-16+09%3A18%3A47' \
-d 'v=2.0' \
-d 'count=1' \
-d 'country=RU' \
-d 'freight_template_id=1000' \
-d 'height=1' \
-d 'is_custom_pack_weight=false' \
-d 'length=1' \
-d 'pack_add_unit=1' \
-d 'pack_add_weight=1' \
-d 'pack_base_unit=1' \
-d 'product_price=null' \
-d 'weight=1' \
-d 'width=1'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AliexpressFreightRedefiningCalculatefreightRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.height=1
req.weight=1
req.pack_add_weight=1
req.count=1
req.freight_template_id=1000
req.pack_add_unit=1
req.is_custom_pack_weight=false
req.width=1
req.length=1
req.product_price=""
req.pack_base_unit=1
req.country="RU"
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,"aliexpress.freight.redefining.calculatefreight");
add_param(pRequest,"height","1");
add_param(pRequest,"weight","1");
add_param(pRequest,"pack_add_weight","1");
add_param(pRequest,"count","1");
add_param(pRequest,"freight_template_id","1000");
add_param(pRequest,"pack_add_unit","1");
add_param(pRequest,"is_custom_pack_weight","false");
add_param(pRequest,"width","1");
add_param(pRequest,"length","1");
add_param(pRequest,"product_price","数据结构JSON示例");
add_param(pRequest,"pack_base_unit","1");
add_param(pRequest,"country","RU");
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('aliexpress.freight.redefining.calculatefreight', {
'height':'1',
'weight':'1',
'pack_add_weight':'1',
'count':'1',
'freight_template_id':'1000',
'pack_add_unit':'1',
'is_custom_pack_weight':'false',
'width':'1',
'length':'1',
'product_price':'数据结构JSON示例',
'pack_base_unit':'1',
'country':'RU'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})