Difference between revisions of "API Product"

From Spiffy Stores Knowledge Base

Line 24: Line 24:
  
 
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.
 
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.
 +
 +
== Product Properties ==
 +
 +
<html>
 +
  <style type="text/css">
 +
  table.wikitable td { padding: 10px 20px !important; text-align: left; vertical-align: middle; }
 +
  </style>
 +
</html>
 +
{| class="wikitable" style="width: 100%"
 +
|style="width: 30%"|id
 +
|<code>{ "id" : 123456789 }</code><br/>
 +
A unique numeric identifier for the product.
 +
|}

Revision as of 09:55, 19 November 2014

The Spiffy Stores API Product object represents an individual item for sale in a store. Anything that can be sold is regarded as a product in your store, even if it's not a physical item. For example, any sort of service or customization that you perform counts as a product.

You can view your products, update them, create new ones, and delete them.

A product will have a least one Variation and may also have one or more Images. A Product may also belong to a StandardCollection or a SuperCollection.

Accessing a Product

If you want to refer to a single Product, then you will need to use the unique product id that has been assigned to that product. These product ids are returned when you request a list of the products that belong to your store.

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

Alternatively, you may specify the product handle in place of the product id when requesting access to a product. The product 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 in two ways.

GET /api/products/12345678.json

or

GET /api/products/cute-dog.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.

Product Properties

id { "id" : 123456789 }

A unique numeric identifier for the product.