【发布时间】:2012-09-27 18:24:34
【问题描述】:
我在 shopify 上有一家测试店。创建订单后,我想通过 PHP API 调用将其履行状态更新为“已履行”。
到目前为止,文档中没有提及更新订单中订单项的履行状态。
有什么办法吗?
【问题讨论】:
标签: php api shopify fulfillment
我在 shopify 上有一家测试店。创建订单后,我想通过 PHP API 调用将其履行状态更新为“已履行”。
到目前为止,文档中没有提及更新订单中订单项的履行状态。
有什么办法吗?
【问题讨论】:
标签: php api shopify fulfillment
是的。 API 实现是可能的:http://api.shopify.com/fulfillment.html
【讨论】:
这就是我现在的工作方式
$data = array( "fulfillment" => array("tracking_number" => "1111111111"));
$data_string = json_encode($data);
$ch = curl_init('https://API:PASS@STORE.myshopify.com/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);
【讨论】: