Making Requests
Once a client has been initialized, you may make requests to Shopify using the available methods.
Let's take a look at a couple of examples:
$shopify = \Pactode\Shopify\Factory::fromConfig();
// Paginate products
$cursor = $shopify->paginateProducts(); // returns a Cursor
// Get products count
$count = $shopify->getProductsCount(); // returns an integer
// Get products
$products = $shopify->getProducts(); // returns a Collection of ProductResource
// Create a product
$product = $shopify->createProduct([
'title' => 'Adidas Shoe, Pink',
]); // returns a ProductResource
// Get a specific product
$product = $shopify->getProduct($productId); // returns a ProductResource
// Update a product
$product = $shopify->updateProduct($productId, [
'title' => 'Adidas Shoe, Rose',
]); // returns a ProductResource
// Deleting a product
$shopify->deleteProduct($productId);
Last updated