TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAlihealthSupplierPurchaseConsignRequest req = new AlibabaAlihealthSupplierPurchaseConsignRequest();
AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignDTO obj1 = new AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignDTO();
obj1.setPurchaseOrderNo("PO10000001");
obj1.setActionType(2L);
obj1.setSupplierId(80000001L);
obj1.setDeliveryTime(StringUtils.parseDateTime("2020-02-15 00:00:00"));
List<AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignItemDTO> list3 = new ArrayList<AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignItemDTO>();
AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignItemDTO obj4 = new AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignItemDTO();
list3.add(obj4);
obj4.setProduceDate("2019-01-01");
obj4.setQuantity(10L);
obj4.setScItemName("xxx");
obj4.setBatchCode("201901");
obj4.setDueDate("2019-01-01");
obj4.setScItemId(100001L);
obj4.setRemark("备注");
obj4.setConsignFinish(true);
obj1.setConsignItemList(list3);
obj1.setArrivalTime(StringUtils.parseDateTime("2020-02-15 00:00:00"));
obj1.setRemark("备注");
obj1.setOutOrderNo("xxx");
req.setPurchaseConsignDto(obj1);
AlibabaAlihealthSupplierPurchaseConsignResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAlihealthSupplierPurchaseConsignRequest req = new AlibabaAlihealthSupplierPurchaseConsignRequest();
AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignDTODomain obj1 = new AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignDTODomain();
obj1.PurchaseOrderNo = "PO10000001";
obj1.ActionType = 2L;
obj1.SupplierId = 80000001L;
obj1.DeliveryTime = DateTime.Parse(2020-02-15 00:00:00");
List<AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignItemDTODomain> list3 = new List<AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignItemDTODomain>();
AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignItemDTODomain obj4 = new AlibabaAlihealthSupplierPurchaseConsignRequest.PurchaseConsignItemDTODomain();
list3.Add(obj4);
obj4.ProduceDate = "2019-01-01";
obj4.Quantity = 10L;
obj4.ScItemName = "xxx";
obj4.BatchCode = "201901";
obj4.DueDate = "2019-01-01";
obj4.ScItemId = 100001L;
obj4.Remark = "备注";
obj4.ConsignFinish = true;
obj1.ConsignItemList= list3;
obj1.ArrivalTime = DateTime.Parse(2020-02-15 00:00:00");
obj1.Remark = "备注";
obj1.OutOrderNo = "xxx";
req.PurchaseConsignDto_ = obj1;
AlibabaAlihealthSupplierPurchaseConsignResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAlihealthSupplierPurchaseConsignRequest;
$purchase_consign_dto = new PurchaseConsignDTO;
$purchase_consign_dto->purchase_order_no="PO10000001";
$purchase_consign_dto->action_type="2";
$purchase_consign_dto->supplier_id="80000001";
$purchase_consign_dto->delivery_time="2020-02-15 00:00:00";
$consign_item_list = new PurchaseConsignItemDTO;
$consign_item_list->produce_date="2019-01-01";
$consign_item_list->quantity="10";
$consign_item_list->sc_item_name="xxx";
$consign_item_list->batch_code="201901";
$consign_item_list->due_date="2019-01-01";
$consign_item_list->sc_item_id="100001";
$consign_item_list->remark="备注";
$consign_item_list->consign_finish="true";
$purchase_consign_dto->consign_item_list = $consign_item_list;
$purchase_consign_dto->arrival_time="2020-02-15 00:00:00";
$purchase_consign_dto->remark="备注";
$purchase_consign_dto->out_order_no="xxx";
$req->setPurchaseConsignDto(json_encode($purchase_consign_dto));
$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=alibaba.alihealth.supplier.purchase.consign' \
-d 'partner_id=apidoc' \
-d 'sign=9BFF7C2C8FC12403C8A56029DE62ACF8' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-24+16%3A12%3A20' \
-d 'v=2.0' \
-d 'purchase_consign_dto=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAlihealthSupplierPurchaseConsignRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.purchase_consign_dto="数据结构示例JSON格式"
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,"alibaba.alihealth.supplier.purchase.consign");
add_param(pRequest,"purchase_consign_dto","数据结构JSON示例");
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('alibaba.alihealth.supplier.purchase.consign', {
'purchase_consign_dto':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})