TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TmallServicecenterSpserviceorderCreateRequest req = new TmallServicecenterSpserviceorderCreateRequest();
req.setServiceProductId(2813L);
req.setServiceObjectType("50019790");
req.setServiceObjectName("平板电视");
req.setServiceContent("挂装");
req.setServicePropertiesString("{\"品牌\":\"海尔\",\"sku屏幕尺寸\":\"70\"}");
req.setBrandId(30645L);
TmallServicecenterSpserviceorderCreateRequest.BuyerDTO obj1 = new TmallServicecenterSpserviceorderCreateRequest.BuyerDTO();
obj1.setAddressProvince("浙江省");
obj1.setAddressCity("杭州市");
obj1.setAddressDistrict("余杭区");
obj1.setAddressTown("五常街道");
obj1.setAddressDetail("xxx小区");
obj1.setFullAddress("浙江省杭州市余杭区五常街道xxx小区");
obj1.setLocation(3500L);
obj1.setBuyerName("xx");
obj1.setMobile("177xxxxxxxx");
req.setBuyer(obj1);
TmallServicecenterSpserviceorderCreateRequest.ReservationDTO obj2 = new TmallServicecenterSpserviceorderCreateRequest.ReservationDTO();
obj2.setReserveTimeStart(StringUtils.parseDateTime("2022-05-01 00:00:00"));
obj2.setReserveTimeEnd(StringUtils.parseDateTime("2022-06-01 00:00:00"));
req.setReservation(obj2);
req.setServiceCount(1L);
req.setOutOrderId("test1234");
req.setSource("JD");
req.setExtJsonString("");
req.setMemo("xx");
TmallServicecenterSpserviceorderCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TmallServicecenterSpserviceorderCreateRequest req = new TmallServicecenterSpserviceorderCreateRequest();
req.ServiceProductId = 2813L;
req.ServiceObjectType = "50019790";
req.ServiceObjectName = "平板电视";
req.ServiceContent = "挂装";
req.ServiceProperties = "{\"品牌\":\"海尔\",\"sku屏幕尺寸\":\"70\"}";
req.BrandId = 30645L;
TmallServicecenterSpserviceorderCreateRequest.BuyerDTODomain obj1 = new TmallServicecenterSpserviceorderCreateRequest.BuyerDTODomain();
obj1.AddressProvince = "浙江省";
obj1.AddressCity = "杭州市";
obj1.AddressDistrict = "余杭区";
obj1.AddressTown = "五常街道";
obj1.AddressDetail = "xxx小区";
obj1.FullAddress = "浙江省杭州市余杭区五常街道xxx小区";
obj1.Location = 3500L;
obj1.BuyerName = "xx";
obj1.Mobile = "177xxxxxxxx";
req.Buyer_ = obj1;
TmallServicecenterSpserviceorderCreateRequest.ReservationDTODomain obj2 = new TmallServicecenterSpserviceorderCreateRequest.ReservationDTODomain();
obj2.ReserveTimeStart = DateTime.Parse(2022-05-01 00:00:00");
obj2.ReserveTimeEnd = DateTime.Parse(2022-06-01 00:00:00");
req.Reservation_ = obj2;
req.ServiceCount = 1L;
req.OutOrderId = "test1234";
req.Source = "JD";
req.ExtJson = "";
req.Memo = "xx";
TmallServicecenterSpserviceorderCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TmallServicecenterSpserviceorderCreateRequest;
$req->setServiceProductId("2813");
$req->setServiceObjectType("50019790");
$req->setServiceObjectName("平板电视");
$req->setServiceContent("挂装");
$req->setServiceProperties("{\"品牌\":\"海尔\",\"sku屏幕尺寸\":\"70\"}");
$req->setBrandId("30645");
$buyer = new BuyerDTO;
$buyer->address_province="浙江省";
$buyer->address_city="杭州市";
$buyer->address_district="余杭区";
$buyer->address_town="五常街道";
$buyer->address_detail="xxx小区";
$buyer->full_address="浙江省杭州市余杭区五常街道xxx小区";
$buyer->location="3500";
$buyer->buyer_name="xx";
$buyer->mobile="177xxxxxxxx";
$req->setBuyer(json_encode($buyer));
$reservation = new ReservationDTO;
$reservation->reserve_time_start="2022-05-01 00:00:00";
$reservation->reserve_time_end="2022-06-01 00:00:00";
$req->setReservation(json_encode($reservation));
$req->setServiceCount("1");
$req->setOutOrderId("test1234");
$req->setSource("JD");
$req->setExtJson("");
$req->setMemo("xx");
$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=tmall.servicecenter.spserviceorder.create' \
-d 'partner_id=apidoc' \
-d 'session=1aa32246-cd2c-4c01-8250-8c31ff423e43' \
-d 'sign=88BDAC4C1DFC2C666CCB509170790470' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-29+17%3A43%3A12' \
-d 'v=2.0' \
-d 'brand_id=30645' \
-d 'buyer=null' \
-d 'ext_json=null' \
-d 'memo=xx' \
-d 'out_order_id=test1234' \
-d 'reservation=null' \
-d 'service_content=%E6%8C%82%E8%A3%85' \
-d 'service_count=1' \
-d 'service_object_name=%E5%B9%B3%E6%9D%BF%E7%94%B5%E8%A7%86' \
-d 'service_object_type=50019790' \
-d 'service_product_id=2813' \
-d 'service_properties=%7B%5C%22%E5%93%81%E7%89%8C%5C%22%3A%5C%22%E6%B5%B7%E5%B0%94%5C%22%2C%5C%22sku%E5%B1%8F%E5%B9%95%E5%B0%BA%E5%AF%B8%5C%22%3A%5C%2270%5C%22%7D' \
-d 'source=JD'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TmallServicecenterSpserviceorderCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.service_product_id=2813
req.service_object_type="50019790"
req.service_object_name="平板电视"
req.service_content="挂装"
req.service_properties="{\"品牌\":\"海尔\",\"sku屏幕尺寸\":\"70\"}"
req.brand_id=30645
req.buyer="数据结构示例JSON格式"
req.reservation="数据结构示例JSON格式"
req.service_count=1
req.out_order_id="test1234"
req.source="JD"
req.ext_json=""
req.memo="xx"
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,"tmall.servicecenter.spserviceorder.create");
add_param(pRequest,"service_product_id","2813");
add_param(pRequest,"service_object_type","50019790");
add_param(pRequest,"service_object_name","平板电视");
add_param(pRequest,"service_content","挂装");
add_param(pRequest,"service_properties","{\"品牌\":\"海尔\",\"sku屏幕尺寸\":\"70\"}");
add_param(pRequest,"brand_id","30645");
add_param(pRequest,"buyer","数据结构JSON示例");
add_param(pRequest,"reservation","数据结构JSON示例");
add_param(pRequest,"service_count","1");
add_param(pRequest,"out_order_id","test1234");
add_param(pRequest,"source","JD");
add_param(pRequest,"ext_json","");
add_param(pRequest,"memo","xx");
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('tmall.servicecenter.spserviceorder.create', {
'service_product_id':'2813',
'service_object_type':'50019790',
'service_object_name':'平板电视',
'service_content':'挂装',
'service_properties':'{\"品牌\":\"海尔\",\"sku屏幕尺寸\":\"70\"}',
'brand_id':'30645',
'buyer':'数据结构JSON示例',
'reservation':'数据结构JSON示例',
'service_count':'1',
'out_order_id':'test1234',
'source':'JD',
'ext_json':'',
'memo':'xx'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})