shopify / shopify-php
PHP library for the Shopify API
Installs: 13 897
Dependents: 0
Suggesters: 0
Security: 0
Stars: 44
Watchers: 136
Forks: 18
Open Issues: 10
Requires
- php: >=5.5.9
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: 4.8.*
- squizlabs/php_codesniffer: 2.8.1
This package is not auto-updated.
Last update: 2019-02-20 19:41:33 UTC
README
Getting started
<?php require 'vendor/autoload.php'; use Shopify\ShopifyClient; $client = new ShopifyClient($access_token, "yourshop.myshopify.com"); $products = $client->products->readList();
Creating orders
$newOrder = ['line_items' => [['title' => 'cool', 'price' => 4]]]; $response = $client->orders->create($newOrder);
Reading orders
$response = $client->orders->read($orderId); $object = $response->parsedResponse();
$orders = $client->orders->readList(); foreach ($order in $orders->parsedResponse()) { var_dump($order->id); }
Updating orders
$response = $client->orders->update($orderId, ["note" => "cool order"]);
Counting open orders
$response = $client->orders->readCount(["status" => "open"]);
Deleting orders
$response = $client->orders->delete($orderId);
Testing phpunit
phpunit
Running PHP CodeSniffer
./vendor/bin/phpcs ./src/ --standard=PSR2 ./vendor/bin/phpcs ./test/ --standard=PSR2