追踪号码未提交给Shopify的订单履行

时间:2012-10-26 20:39:39

标签: shopify

在一些中间件上处理完成周期并且在开始自动执行订单之后,我注意到没有一个订单具有与履行相关联的透视跟踪编号。 我有以下提交履行请求的PHP代码:

$options = array(CURLOPT_URL => 'https://'.$this->config->item('api_key').':'.$this->config->item('api_pass').'@'.$this->config->item('api_domain').'/admin/orders/'.$order['order_id'].'/fulfillments.json',
            CURLOPT_HEADER => true,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_POST => true,
            CURLOPT_MAXREDIRS => 3,
            CURLOPT_SSL_VERIFYPEER => true,
            CURLOPT_SSL_VERIFYHOST => 2,
            CURLOPT_USERAGENT => 'HAC',
            CURLOPT_CONNECTTIMEOUT =>30,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_POSTFIELDS => $fulfill_json
            );
        if($send == true){
            $ch = curl_init();
            curl_setopt_array($ch, $options);
            $response = curl_exec($ch);
            $response_header = curl_getinfo($ch, CURLINFO_HTTP_CODE);
            curl_close($ch);
            if($response_header == 201){
                //success

            }else{
                //error

            }
        }

以下是我发送的$ fulfill_json示例:

{"fulfilment":{"tracking_number":"1Z6V66666666666666","notify_customer":true,"line_items":[{"id":111111111}]}}

{"fulfilment":{"tracking_number":"1Z6V66666666666666","notify_customer":true,"line_items":[{"id":111111111},{"id":111111111},{"id":111111111}]}}

对我来说,它看起来像是正确提交的JSON,不确定它是否有任何其他错误。

1 个答案:

答案 0 :(得分:1)

我尝试改变的第一件事是你的拼写:

履行而非履行