I am using Shopify API to create products and orders. But I can't find a way to checkout my order through api call.
$request = new CURLCall();
$line_items = array("line_items" =>
array(array(
"variant_id" => 123456789,
"quantity" => 5))
);
$data = json_encode(array("checkout" => $line_items));
$url = "https://{API_KEY}:{Password}@shop.myshopify.com/admin/checkouts.json";
// Initialize CURL for PHP
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data),
'Accept: application/json')
);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($curl);
print_r($response);
Code above returns this message,
{"errors":"Not Found"}
Thank you.