PHP code example of seregatte / shopify-guzzle-api

1. Go to this page and download the library: Download seregatte/shopify-guzzle-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

seregatte / shopify-guzzle-api example snippets



eregatte\ShopifyGuzzleApi;

$shopId = 'shopname.myshopify.com';
$shopToken = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$app_api_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; //App Api Key
$app_credential_secret = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; //App Credential Sets

$client = new ShopifyGuzzleApi\Api(
				$shopId, 
				$app_api_key, 
				$shopToken, 
				$app_credential_secret
		);

$queryParams = ['published_status'=>'published'];

$response = $client->setParams($queryParams)->get('/admin/products.json');

$json = $response->json();

var_dump($json['products'])