API Variation

From Spiffy Stores Knowledge Base

Revision as of 14:06, 20 November 2014 by Admin (talk | contribs) (Created page with "The Spiffy Stores API Variation object represents a product variation. A variation usually represents some physical version of a product that needs to be represented separatel...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Spiffy Stores API Variation object represents a product variation. A variation usually represents some physical version of a product that needs to be represented separately from other variations. Each product variation can have its inventory tracked separately.

You can view a product's variations, update them, create new ones, and delete them.

Accessing a Product

If you want to refer to a single Product then you will need to use the unique id that has been assigned to that object.

The object ids are internally generated by the software and cannot be created or assigned.

Alternatively, you may specify the object handle in place of the object id when requesting access to the object. The handle is the unique character string that is assigned to every product when it is created. The handle is used in the URL to display the product page.

For example, you may retrieve a product's variations in two ways.

GET /api/products/12345678/variations.json

or

GET /api/products/cute-dog/variations.json

The advantage of using the handle form of the request is that you don't need to search all the products first in order to determine the product id, as you will already know what the handle is. This will reduce the number of API calls that you need to make and greatly simplifies the amount of coding that is needed to manage your products.

Variation Properties