diff --git a/composer.json b/composer.json index 777c2a4..ceaa705 100644 --- a/composer.json +++ b/composer.json @@ -17,8 +17,8 @@ "require": { "php": ">=5.4", "guzzlehttp/guzzle": "~5.3|~6.0", - "guzzlehttp/guzzle-services": "0.5.0", - "guzzlehttp/command": "0.7.0" + "guzzlehttp/guzzle-services": "0.5.0|0.6.0", + "guzzlehttp/command": "0.7.0|0.7.1" }, "autoload": { "psr-4": { diff --git a/src/resources/gift-card-adjustment.php b/src/resources/gift-card-adjustment.php new file mode 100644 index 0000000..9f362b8 --- /dev/null +++ b/src/resources/gift-card-adjustment.php @@ -0,0 +1,107 @@ + array( + + /** + * getGiftCardAdjustments() method + * + * reference: https://help.shopify.com/api/reference/gift_card_adjustment + */ + "getGiftCardAdjustments" => array( + "httpMethod" => "GET", + "uri" => "/admin/gift_cards/{id}/adjustments.json", + "summary" => "Retrieve a list of all Gift Cards Adjustments for a Gift Card", + "responseModel" => "defaultJsonResponse", + "parameters" => array( + "id" => array( + "type" => "number", + "location" => "uri", + "description" => "The ID of the Gift Card.", + "required" => true + ), + "limit" => array( + "type" => "integer", + "location" => "query", + "description" => "Amount of results (default: 50) (maximum: 250)" + ), + "page" => array( + "type" => "integer", + "location" => "query", + "description" => "Page to show (default: 1)" + ), + "fields" => array( + "type" => "string", + "location" => "query", + "description" => "comma-separated list of fields to include in the response" + ) + ) + ), + + /** + * createGiftCardAdjustment() method + * + * reference: https://help.shopify.com/api/reference/gift_card_adjustment + */ + "createGiftCardAdjustment" => array( + "httpMethod" => "POST", + "uri" => "/admin/gift_cards/{id}/adjustments.json", + "summary" => "Create a new Gift Card Adjustment.", + "responseModel" => "defaultJsonResponse", + "parameters" => array( + "id" => array( + "type" => "number", + "location" => "uri", + "description" => "The ID of the Gift Card this adjustment should apply to.", + "required" => true + ), + "adjustment" => array( + "location" => "json", + "parameters" => array( + "amount" => array( + "type" => "string", + "location" => "json", + "description" => "Amount to change the giftcard value by" + ), + "note" => array( + "type" => "string", + "location" => "json", + "description" => "The description of the gift card adjustment." + ), + "processed_at" => array( + "type" => "string", + "location" => "json", + "description" => "The date and time when this adjustment should have been actioned" + ) + ) + ) + ) + ), + + ), + + /* + |-------------------------------------------------------------------------- + | Models + |-------------------------------------------------------------------------- + | + | This array of models is specifications to returning the response + | from the operation methods. + | + */ + + "models" => array( + + ), +); diff --git a/src/resources/inventory-level.php b/src/resources/inventory-level.php new file mode 100644 index 0000000..7ea711e --- /dev/null +++ b/src/resources/inventory-level.php @@ -0,0 +1,123 @@ + array( + + /** + * getGiftCardAdjustments() method + * + * reference: https://help.shopify.com/api/reference/gift_card_adjustment + */ + "getInventoryLevels" => array( + "httpMethod" => "GET", + "uri" => "/admin/inventory_levels.json", + "summary" => "Retrieve a list of all inventory levels for the given inventory item ids", + "responseModel" => "defaultJsonResponse", + "parameters" => array( + "inventory_item_ids" => array( + "type" => "string", + "location" => "query", + "description" => "comma-separated list of inventory-item-ids" + ), + "page" => array( + "type" => "integer", + "location" => "query", + "description" => "Page to show (default: 1)" + ), + ) + ), + + "adjustInventoryLevels" => array( + "httpMethod" => "POST", + "uri" => "/admin/inventory_levels/adjust.json", + "summary" => "Adjust an inventory level", + "responseModel" => "defaultJsonResponse", + "parameters" => array( + "location_id" => array( + "type" => "string", + "location" => "json", + "description" => "the location id" + ), + "inventory_item_id" => array( + "type" => "string", + "location" => "json", + "description" => "the inventory item id" + ), + "available_adjustment" => array( + "type" => "string", + "location" => "json", + "description" => "the amount to change the inventory level by" + ), + ) + ), + + "setInventoryLevels" => array( + "httpMethod" => "POST", + "uri" => "/admin/inventory_levels/set.json", + "summary" => "set an inventory level", + "responseModel" => "defaultJsonResponse", + "parameters" => array( + "location_id" => array( + "type" => "string", + "location" => "json", + "description" => "the location id" + ), + "inventory_item_id" => array( + "type" => "string", + "location" => "json", + "description" => "the inventory item id" + ), + "available" => array( + "type" => "string", + "location" => "json", + "description" => "the amount to set the inventory level to" + ), + ) + ), + + "connectInventoryLevels" => array( + "httpMethod" => "POST", + "uri" => "/admin/inventory_levels/connect.json", + "summary" => "Connect a location to an inventory level", + "responseModel" => "defaultJsonResponse", + "parameters" => array( + "location_id" => array( + "type" => "string", + "location" => "json", + "description" => "the location id" + ), + "inventory_item_id" => array( + "type" => "string", + "location" => "json", + "description" => "the inventory item id" + ), + ) + ), + + ), + + /* + |-------------------------------------------------------------------------- + | Models + |-------------------------------------------------------------------------- + | + | This array of models is specifications to returning the response + | from the operation methods. + | + */ + + "models" => array( + + ), +); diff --git a/src/resources/service-config.php b/src/resources/service-config.php index dd76efe..899b243 100644 --- a/src/resources/service-config.php +++ b/src/resources/service-config.php @@ -53,6 +53,9 @@ "fulfillment", "fulfillment-service", "gift-card", + "gift-card-adjustment", + /* "inventory-item", */ + "inventory-level", "location", "metafield", "order",