2012-09-27 89 views
0

我有一家shopify測試店。訂單創建後,我想通過PHP API調用將其履行狀態更新爲「履行」。通過shopify API完成訂單

到目前爲止,在文檔中沒有提到更新訂單中訂單項的履行狀態。

有沒有辦法做到這一點?

回答

0

這是我有現在的工作

$data = array("fulfillment" => array("tracking_number" => "1111111111")); 

$data_string = json_encode($data);                     

$ch = curl_init('https://API:[email protected]/admin/orders/ORDER_ID/fulfillments.json'); 
curl_setopt($ch, CURLOPT_HTTPHEADER, array(                   
    'Content-Type: application/json',                     
    'Content-Length: ' . strlen($data_string))                  
); 

curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 

$result = curl_exec($ch); 
print_r($result);