Skip to content

Commit

Permalink
Merge pull request #110 from savchukoleksii/feature/storefront-tokens…
Browse files Browse the repository at this point in the history
…-methods

Add storefront access token related methods
  • Loading branch information
bakura10 authored Sep 11, 2020
2 parents b5e1229 + 4bb8f40 commit c614ffb
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [])
Expand Down
73 changes: 73 additions & 0 deletions src/ServiceDescription/Shopify-v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/ShopifyClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit c614ffb

Please sign in to comment.