简体   繁体   English

通过shopify API履行订单

[英]fulfillment of orders via shopify API

i have a test shop on shopify. 我有shopify的测试店。 When the orders are created I want to update their fulfilment status to "Fulfilled" via PHP API calls. 创建订单时,我想通过PHP API调用将其履行状态更新为“已实现”。

So far nothing is mentioned in the documentation to update the fulfilment status of the line items in the order. 到目前为止,文档中没有提及更新订单中订单项的履行状态。

Is there any way to do so? 有没有办法这样做?

Yes. 是。 API Fulfillment is possible: http://api.shopify.com/fulfillment.html API履行是可能的: http//api.shopify.com/fulfillment.html

This is how I have it working now 这就是我现在的工作方式

$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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM