I have a partner account and created a store to do some testing. Made a private app, generated the necessary keys etc to get started. I know how to use the REST requests together with curl and it works fine. But now I’d like to use the (official) PHP client library, which I installed with composer. I find alot of tutorials and explanations about authentication, but it seems hard to find actual sample code on how to do this. This is what I have so far (I found this online), but of course it returns errors about vars not found (cfr headers and such).
include('vendor/autoload.php');
use Shopify\Clients\Rest;
$session = Shopify\Utils::loadCurrentSession($headers, $cookies, $isOnline);
$client = new Rest($session->getShop(), $session->getAccessToken());
$response = $client->get('shop');
Once authenticated I’ll know my way around; but I don’t seem to get beyond this point …
Any sample code with (fake) credentials and such would be much appreciated.
Thnx in advance.