PHP code example of arindam / shopify-apis

1. Go to this page and download the library: Download arindam/shopify-apis 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/ */

    

arindam / shopify-apis example snippets


Arindam\ShopifyApis\ShopifyApiServiceProvider::class,

'ShopifyApis' => Arindam\ShopifyApis\Shopify\ShopifyClassFacade::class,

php artisan vendor:publish --provider="Arindam\ShopifyApis\ShopifyApiServiceProvider" --force

- OR -

php artisan vendor:publish --tag="shopifyapis:config"


SHOPIFY_STORE_URL=https://{your-store-name}.myshopify.com
SHOPIFY_ACCESS_TOKEN={YOUR_APP_ACCESS_TOKEN}



1.  ShopifyApis::allProducts();
2.  ShopifyApis::allActiveProducts();
3.  ShopifyApis::allDraftProducts();
4.  ShopifyApis::allArchivedProducts();
5.  ShopifyApis::allPublishedProducts();
6.  ShopifyApis::productByIds($productIds); // pass an array of product ids, ex: ['xxx', 'xxx']
7.  ShopifyApis::specificProductById($productId); // pass specific product id as param
8.  ShopifyApis::allActiveProductCount();
9.  ShopifyApis::allDraftProductCount();
10. ShopifyApis::allProducts();
11. ShopifyApis::productImages($productId); // pass specific product id as param
12. ShopifyApis::productImagesCount($productId); // pass specific product id as param



1.  ShopifyApis::allCollections();
2.  ShopifyApis::specificCollection($collectionId); // pass specific collection id as param
3.  ShopifyApis::allCollectionCount();
4.  ShopifyApis::collectionInfoById($collectionId); // pass specific collection id as param
5.  ShopifyApis::productsOfCollection($collectionId); // pass specific collection id as param



1.  ShopifyApis::allProductVariants($productId); // pass specific product id as param
2.  ShopifyApis::variantInfo($variantId); // pass specific variant id as param
3.  ShopifyApis::productVariantCount($productId); // pass specific product id as param



1.  ShopifyApis::allOrders();
2.  ShopifyApis::allOpenOrders();
3.  ShopifyApis::allClosedOrders();
4.  ShopifyApis::allCancelledOrders();
5.  ShopifyApis::allAuthorizedOrders();
6.  ShopifyApis::allPendingOrders();
7.  ShopifyApis::allPaidOrders();
8.  ShopifyApis::allUnPaidOrders();
9.  ShopifyApis::allPartialPaidOrders();
10.  ShopifyApis::allRefundOrders();
11.  ShopifyApis::allPartiallyRefundOrders();
12.  ShopifyApis::allVoidOrders();
13.  ShopifyApis::specificOrder($orderId); // pass specific order id as param
14.  ShopifyApis::ordersByIds($orderIds); // pass an array of order ids, ex: ['xxx', 'xxx']