TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AliexpressLogisticsBuyerFreightCalculateRequest req = new AliexpressLogisticsBuyerFreightCalculateRequest();
AliexpressLogisticsBuyerFreightCalculateRequest.AeopFreightCalculateForBuyerDto obj1 = new AliexpressLogisticsBuyerFreightCalculateRequest.AeopFreightCalculateForBuyerDto();
obj1.setCityCode("99988777");
obj1.setCountryCode("RU");
obj1.setProductId(777777L);
obj1.setProductNum(1L);
obj1.setProvinceCode("888777");
obj1.setSendGoodsCountryCode("CN");
obj1.setPrice("1.89");
obj1.setPriceCurrency("USD");
req.setParamAeopFreightCalculateForBuyerDTO(obj1);
AliexpressLogisticsBuyerFreightCalculateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AliexpressLogisticsBuyerFreightCalculateRequest req = new AliexpressLogisticsBuyerFreightCalculateRequest();
AliexpressLogisticsBuyerFreightCalculateRequest.AeopFreightCalculateForBuyerDtoDomain obj1 = new AliexpressLogisticsBuyerFreightCalculateRequest.AeopFreightCalculateForBuyerDtoDomain();
obj1.CityCode = "99988777";
obj1.CountryCode = "RU";
obj1.ProductId = 777777L;
obj1.ProductNum = 1L;
obj1.ProvinceCode = "888777";
obj1.SendGoodsCountryCode = "CN";
obj1.Price = "1.89";
obj1.PriceCurrency = "USD";
req.ParamAeopFreightCalculateForBuyerDTO_ = obj1;
AliexpressLogisticsBuyerFreightCalculateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AliexpressLogisticsBuyerFreightCalculateRequest;
$param_aeop_freight_calculate_for_buyer_d_t_o = new AeopFreightCalculateForBuyerDto;
$param_aeop_freight_calculate_for_buyer_d_t_o->city_code="99988777";
$param_aeop_freight_calculate_for_buyer_d_t_o->country_code="RU";
$param_aeop_freight_calculate_for_buyer_d_t_o->product_id="777777";
$param_aeop_freight_calculate_for_buyer_d_t_o->product_num="1";
$param_aeop_freight_calculate_for_buyer_d_t_o->province_code="888777";
$param_aeop_freight_calculate_for_buyer_d_t_o->send_goods_country_code="CN";
$param_aeop_freight_calculate_for_buyer_d_t_o->price="1.89";
$param_aeop_freight_calculate_for_buyer_d_t_o->price_currency="USD";
$req->setParamAeopFreightCalculateForBuyerDTO(json_encode($param_aeop_freight_calculate_for_buyer_d_t_o));
$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.logistics.buyer.freight.calculate' \
-d 'partner_id=apidoc' \
-d 'session=ec62c3f2-1ade-4e03-8afb-65e41cdcaf9e' \
-d 'sign=41484D2379C7C104EACA628488942909' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-28+20%3A33%3A44' \
-d 'v=2.0' \
-d 'param_aeop_freight_calculate_for_buyer_d_t_o=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AliexpressLogisticsBuyerFreightCalculateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_aeop_freight_calculate_for_buyer_d_t_o=""
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.logistics.buyer.freight.calculate");
add_param(pRequest,"param_aeop_freight_calculate_for_buyer_d_t_o","数据结构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('aliexpress.logistics.buyer.freight.calculate', {
'param_aeop_freight_calculate_for_buyer_d_t_o':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})