From 4bb8f40296e97b912114b968f29f8d8df3c50673 Mon Sep 17 00:00:00 2001 From: Oleksii Savchuk Date: Thu, 10 Sep 2020 10:04:22 +0300 Subject: [PATCH] Add storefront access token related methods --- README.md | 8 ++- src/ServiceDescription/Shopify-v1.php | 73 +++++++++++++++++++++++++++ src/ShopifyClient.php | 6 +++ 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f3495c4..7a6c71c 100644 --- a/README.md +++ b/README.md @@ -447,7 +447,13 @@ Here is a list of supported endpoints (more to come in the future): * array getAccessScopes(array $args = []) -** APPLICATION CHARGE RELATED METHODS:** +**ACCESS SCOPE RELATED METHODS:** + +* array getStorefrontAccessTokens(array $args = []) +* array createStorefrontAccessToken(array $args = []) +* array deleteStorefrontAccessToken(array $args = []) + +**STOREFRONT ACCESS TOKEN RELATED METHODS:** * array getApplicationCharges(array $args = []) * array getApplicationCharge(array $args = []) diff --git a/src/ServiceDescription/Shopify-v1.php b/src/ServiceDescription/Shopify-v1.php index 2675fbb..bcb00d9 100644 --- a/src/ServiceDescription/Shopify-v1.php +++ b/src/ServiceDescription/Shopify-v1.php @@ -39,6 +39,79 @@ ], ], + /** + * -------------------------------------------------------------------------------- + * STOREFRONT RELATED METHODS + * + * DOC: https://shopify.dev/docs/admin-api/rest/reference/access/storefrontaccesstoken + * -------------------------------------------------------------------------------- + */ + + 'GetStorefrontAccessTokens' => [ + 'httpMethod' => 'GET', + 'uri' => 'admin/api/{version}/storefront_access_tokens.json', + 'responseModel' => 'GenericModel', + 'summary' => 'Retrieve a list of storefront access tokens', + 'data' => ['root_key' => 'storefront_access_tokens'], + 'parameters' => [ + 'version' => [ + 'description' => 'API version', + 'location' => 'uri', + 'type' => 'string', + 'required' => true + ], + ], + 'additionalParameters' => [ + 'location' => 'query', + ], + ], + + 'CreateStorefrontAccessToken' => [ + 'httpMethod' => 'POST', + 'uri' => 'admin/api/{version}/storefront_access_tokens.json', + 'responseModel' => 'GenericModel', + 'summary' => 'Create a new storefront token', + 'data' => ['root_key' => 'article'], + 'parameters' => [ + 'version' => [ + 'description' => 'API version', + 'location' => 'uri', + 'type' => 'string', + 'required' => true + ], + 'title' => [ + 'description' => 'StorefrontAccessToken title', + 'location' => 'json', + 'type' => 'string', + 'required' => true + ], + ], + 'additionalParameters' => [ + 'location' => 'json', + ], + ], + + 'DeleteStorefrontAccessToken' => [ + 'httpMethod' => 'DELETE', + 'uri' => 'admin/api/{version}/storefront_access_tokens/{id}.json', + 'responseModel' => 'GenericModel', + 'summary' => 'Delete an existing storefront access token', + 'parameters' => [ + 'version' => [ + 'description' => 'API version', + 'location' => 'uri', + 'type' => 'string', + 'required' => true + ], + 'id' => [ + 'description' => 'StorefrontAccessToken ID', + 'location' => 'uri', + 'type' => 'integer', + 'required' => true + ] + ] + ], + /** * -------------------------------------------------------------------------------- * APPLICATION CHARGES RELATED METHODS diff --git a/src/ShopifyClient.php b/src/ShopifyClient.php index cb5f516..a9b4e01 100644 --- a/src/ShopifyClient.php +++ b/src/ShopifyClient.php @@ -50,6 +50,12 @@ * * @method array getAccessScopes(array $args = []) {@command Shopify GetAccessScopes} * + * STOREFRONT ACCESS TOKEN METHODS: + * + * @method array getStorefrontAccessTokens(array $args = []) {@command Shopify GetStorefrontAccessTokens} + * @method array createStorefrontAccessToken(array $args = []) {@command Shopify CreateStorefrontAccessToken} + * @method array deleteStorefrontAccessToken(array $args = []) {@command Shopify DeleteStorefrontAccessToken} + * * APPLICATION CHARGE RELATED METHODS: * * @method array getApplicationCharges(array $args = []) {@command Shopify GetApplicationCharges}