Skip to content

Commit

Permalink
Merge pull request #68 from chiwek/master
Browse files Browse the repository at this point in the history
Added collection metafield API calls
  • Loading branch information
cargix1 committed Sep 14, 2017
2 parents 893cf91 + 7a142e0 commit 8c3caf7
Showing 1 changed file with 120 additions and 0 deletions.
120 changes: 120 additions & 0 deletions src/resources/metafield.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,53 @@
),



/**
* createCollectionMetafield() method
*
* reference: https://help.shopify.com/api/reference/metafield
*/
"createCollectionMetafield" => array(
"httpMethod" => "POST",
"uri" => "/admin/collections/{id}/metafields.json",
"summary" => "Create a new metafield for a collection",
"responseModel" => "defaultJsonResponse",
"parameters" => array(
"id" => array(
"type" => "number",
"location" => "uri",
"description" => "The ID of the Collection.",
"required" => true
),
"metafield" => array(
"location" => "json",
"parameters" => array(
"namespace" => array(
"type" => "string",
"location" => "json",
"description" => "The Namespace for the Metafield."
),
"key" => array(
"type" => "string",
"location" => "json",
"description" => "The Key for the Metafield."
),
"value" => array(
"type" => "string",
"location" => "json",
"description" => "The Value of the Metafield."
),
"value_type" => array(
"type" => "string",
"location" => "json",
"description" => "The Value Type of the Metafield."
)
)
)
)
),


/**
* createProductMetafield() method
*
Expand Down Expand Up @@ -424,6 +471,54 @@
),



/**
* updateCollectionMetafield() method
*
* reference: https://help.shopify.com/api/reference/metafield
*/
"updateCollectionMetafield" => array(
"httpMethod" => "PUT",
"uri" => "/admin/collections/{id}/metafields/{metafield_id}.json",
"summary" => "Update a Collection Metafield",
"responseModel" => "defaultJsonResponse",
"parameters" => array(
"id" => array(
"type" => "number",
"location" => "uri",
"description" => "The ID of the Collection.",
"required" => true
),
"metafield_id" => array(
"type" => "number",
"location" => "uri",
"description" => "The ID of the Metafield.",
"required" => true
),
"metafield" => array(
"location" => "json",
"parameters" => array(
"metafieldId" => array(
"type" => "number",
"location" => "json",
"description" => "The ID for the Metafield."
),
"value" => array(
"type" => "string",
"location" => "json",
"description" => "The Value of the Metafield."
),
"value_type" => array(
"type" => "string",
"location" => "json",
"description" => "The Value Type of the Metafield."
)
)
)
)
),


/**
* updateProductMetafield() method
*
Expand Down Expand Up @@ -538,6 +633,31 @@
)
),

/**
* deleteCollectionMetafield() method
*
* reference: https://help.shopify.com/api/reference/metafield
*/
"deleteCollectionMetafield" => array(
"httpMethod" => "DELETE",
"uri" => "/admin/collections/{id}/metafields/{metafieldId}.json",
"summary" => "Delete a Collection Metafield",
"responseModel" => "defaultJsonResponse",
"parameters" => array(
"id" => array(
"type" => "number",
"location" => "uri",
"description" => "The ID of the Product.",
"required" => true
),
"metafieldId" => array(
"type" => "number",
"location" => "uri",
"description" => "The ID of the Metafield.",
"required" => true
)
)
),

/**
* deleteProductMetafield() method
Expand Down

0 comments on commit 8c3caf7

Please sign in to comment.