{"id":26336947,"url":"https://github.com/dspacelabs/shopify-client","last_synced_at":"2025-03-16T02:16:51.666Z","repository":{"id":56972900,"uuid":"47804135","full_name":"dSpaceLabs/shopify-client","owner":"dSpaceLabs","description":"Shopify PHP SDK","archived":false,"fork":false,"pushed_at":"2017-07-11T00:01:12.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-21T09:49:10.109Z","etag":null,"topics":["php","php-client","shopify","shopify-client"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dSpaceLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-11T04:02:09.000Z","updated_at":"2022-01-29T01:42:55.000Z","dependencies_parsed_at":"2022-08-21T10:20:49.930Z","dependency_job_id":null,"html_url":"https://github.com/dSpaceLabs/shopify-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dSpaceLabs%2Fshopify-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dSpaceLabs%2Fshopify-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dSpaceLabs%2Fshopify-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dSpaceLabs%2Fshopify-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dSpaceLabs","download_url":"https://codeload.github.com/dSpaceLabs/shopify-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814895,"owners_count":20352038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","php-client","shopify","shopify-client"],"created_at":"2025-03-16T02:16:50.886Z","updated_at":"2025-03-16T02:16:51.660Z","avatar_url":"https://github.com/dSpaceLabs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Shopify Client [![Build Status](https://travis-ci.org/dSpaceLabs/Shopify.svg?branch=master)](https://travis-ci.org/dSpaceLabs/Shopify)\n==============\n\nPHP Shopify Client for easy integration into your projects and apps\n\n- PHP Client for working with the Shopify API\n- Source code is well documented\n- Heavily tested and maintained\n- Production Shopify Apps are using\n- Maintain a high standard of code quality [![Code Climate](https://codeclimate.com/github/dSpaceLabs/Shopify/badges/gpa.svg)](https://codeclimate.com/github/dSpaceLabs/Shopify)\n- Private apps support\n\n## Requirements\n\n- PHP cURL extension\n- PHP \u003e= 5.4\n  - See [Travis CI](https://travis-ci.org/dSpaceLabs/Shopify) for builds of each\n    version\n- [Shopify Partner Account](https://developers.shopify.com/?ref=dspace)\n\n## Installation\n\n```bash\ncomposer require \"dspacelabs/shopify:^1.0@dev\"\n```\n\n## Usage\n\n### Redirect user to Shopify to authorize your application\n\n```php\n\u003c?php\n\nuse Dspacelabs\\Component\\Shopify\\Client;\n\n$client = new Client($accessKey, $secretKey);\n$client-\u003esetShop('example.myshopify.com');\n// This is the same thing as doing the entire domain\n//$client-\u003esetShop('example');\n\n// List of scopes can be in the Client class\n$client-\u003esetScopes(\n    array(\n        Client::SCOPE_WRITE_CUSTOMERS,\n        Client::SCOPE_READ_CUSTOMERS\n    )\n);\n\n$nonce = time(); // Save in session, used in callback action\n\n$authorizationUri = $client-\u003egetAuthorizationUrl('https://example.com/shopify/callback', $nonce);\n// redirect user to $authorizationUri\n```\n\n### Shopify redirects user back to your callback url\n\n```php\n\u003c?php\n\nuse Dspacelabs\\Component\\Shopify\\Client;\n\nif (!$session-\u003ehas('nonce')) {\n    throw new AccessedDeniedError();\n}\n\n$client = new Client($accessKey, $secretKey);\n$client-\u003esetShop('example.myshopify.com');\n\n// `isValid` takes array of query parameters, think $_GET, $_POST, etc.\n// This example is using a Request object from the symfony/http-foundation\n// library\nif (!$client-\u003eisValid($request-\u003equery-\u003eall())) {\n    throw new \\AccessDeniedError();\n}\n\n// Persist access token in database\n$accessToken = $client-\u003egetAccessToken($request-\u003equery-\u003eget('code'));\n```\n\n### Making requests to Shopify\n\n```php\n\u003c?php\n\nuse Dspacelabs\\Component\\Shopify\\Client;\n\n$client = new Client($accessKey, $secretKey):\n$client\n    -\u003esetShop('example.myshopify.com')\n    -\u003esetAccessToken($accessToken);\n\n$result = $client-\u003ecall('GET', '/admin/customers.json');\n\n// Process $result\n```\n\n### Recurring application charges\n\n@todo\n\n### Creating and using webhooks\n\n@todo\n\n### Private Apps\n\nSee [Generate private app credentials](https://help.shopify.com/api/guides/api-credentials#generate-private-app-credentials).\n\n```php\n\u003c?php\n\nuse Dspacelabs\\Component\\Shopify\\Client;\n\n/**\n * The API Key and Password are generated for you on Shopify once you create\n * Your private app. Those are the credentials you need here.\n */\n$client = new Client($apiKey, $password):\n$client\n    -\u003esetPrivate(true)\n    -\u003esetShop('example.myshopify.com');\n```\n\n## Applications using this library\n\n- [lvl67](http://www.lvl67.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdspacelabs%2Fshopify-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdspacelabs%2Fshopify-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdspacelabs%2Fshopify-client/lists"}