Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
this is the code
$url = "https://api:pass@somesite.myshopify.com/admin/api/2020-04/checkouts/c8d2de24488fb55a7f28ab8fdf05156c.json";
$shopcurl = curl_init();
curl_setopt($shopcurl, CURLOPT_URL, $url);
curl_setopt($shopcurl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($shopcurl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($shopcurl, CURLOPT_VERBOSE, 0);
//curl_setopt($shopcurl, CURLOPT_HEADER, 1);
curl_setopt($shopcurl, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($shopcurl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec ($shopcurl);
curl_close ($shopcurl);
print_r($response);
Have you set the right scope? Do you have a request ID from the response headers handy?
Scott | Developer Advocate @ Shopify
nope. i've no idea. i've just found out about shopify cURL in php. i can actually get checkout information from this code, but not orders. but when i open orders url in a regular browser, it gives me the json file that i need. i just couldn't get it through php curl. thanks in advanced for the solution .
You'll want to use the Orders API for order information.
Scott | Developer Advocate @ Shopify