Difference between revisions of "API Metafield"

From Spiffy Stores Knowledge Base

m
m
Line 3: Line 3:
 
In this context, metadata represents any sort of data that can be represented by a ''key/value'' structure and can be associated with one of the following types of store objects.
 
In this context, metadata represents any sort of data that can be represented by a ''key/value'' structure and can be associated with one of the following types of store objects.
  
 +
* Store
 
* Product
 
* Product
 
* Variation
 
* Variation
Line 29: Line 30:
  
 
Metafields have many uses. For example, they allow you to store additional information about a product, that is specific to a certain type of product. You could use Metafields to associate products to a specific set of accessories for that product. Metafields provide a generic customization capabilities that allow you to organize your store's products, customers, orders and other content in any way that suits your particular needs.
 
Metafields have many uses. For example, they allow you to store additional information about a product, that is specific to a certain type of product. You could use Metafields to associate products to a specific set of accessories for that product. Metafields provide a generic customization capabilities that allow you to organize your store's products, customers, orders and other content in any way that suits your particular needs.
 +
 +
=== Accessing a Metafield ===
 +
 +
Metafields can be created and associated with your Store. These sort of Metafields are global as only one instance of a store exists.
 +
 +
You can manage these sort of Metafields using the following types of API calls -
 +
 +
<pre>
 +
GET /api/metafields.json
 +
GET /api/metafields/12345.json
 +
 +
and so on&hellip;
 +
</pre>

Revision as of 14:14, 18 February 2015

The Spiffy Stores API Metafield object allows you to attach metadata to a number of your Store's objects.

In this context, metadata represents any sort of data that can be represented by a key/value structure and can be associated with one of the following types of store objects.

  • Store
  • Product
  • Variation
  • Page
  • Blog
  • Standard Collection
  • Super Collection
  • Customer
  • Order

A Metafield has the following properties:

  • Namespace
  • Key
  • Value
  • Value Type (integer or string)
  • Description (Optional)

The Namespace allows you to group a number of related keys together.

Within a Namespace, there will be one or more unique Keys.

Each Key within the Namespace will have a Value which may be either an integer or string value.

Finally, for documentation purposes, an optional Description may also be added when the Metafield is created.

Metafields have many uses. For example, they allow you to store additional information about a product, that is specific to a certain type of product. You could use Metafields to associate products to a specific set of accessories for that product. Metafields provide a generic customization capabilities that allow you to organize your store's products, customers, orders and other content in any way that suits your particular needs.

Accessing a Metafield

Metafields can be created and associated with your Store. These sort of Metafields are global as only one instance of a store exists.

You can manage these sort of Metafields using the following types of API calls -

GET /api/metafields.json
GET /api/metafields/12345.json

and so on…