The REST Admin API lets you build apps and other integrations for the Shopify admin.\nIf you want to create Shopify-powered storefronts for platforms outside of the Shopify admin, including websites,\nmobile apps, and game development engines, then see the Storefront API instead.
The documentation provided as part of this Postman collection is for convenience and does not include\ncomplete, up-to-date information about the REST Admin API. For the complete documentation, see https://help.shopify.com/api/reference.
- Create store
- Create App in the stores
- Copy API Key, API Secret, Access Token
- Click on notification
- Select shopify event and add webhook URL
define('CLIENT_SECRET', '709edeb8d0cc81ca976dba7d55063591'); function verify_webhook($data, $hmac_header) { $calculated_hmac = base64_encode(hash_hmac('sha256', $data, CLIENT_SECRET, true)); return hash_equals($hmac_header, $calculated_hmac); } $hmac_header = $_SERVER['HTTP_X_SHOPIFY_HMAC_SHA256']; $data = file_get_contents('php://input'); $verified = verify_webhook($data, $hmac_header); error_log('Webhook verified: ' . var_export($verified, true)); // Check error.log to see the result $res = $data; // if ($verified) { // $res = $data; // } else { // $res = 'there maybe something wrong..'; // } $log = fopen('product.json', 'w') or die('cant open the file');
fwrite($log, $res); fclose($log);