API Product

From Spiffy Stores Knowledge Base

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.

title { "title" : "Cute Dog" }

The title of the product.

handle { "handle" : "cute-dog" }

A unique, human-friendly string for the product. Usually, the handle is automatically generated from its title. The handle is used in the product URL to refer to the product, and can also be used access the product from the API and in the store's templates.

body { "body" : "This puppy is very cute." }

The description of the product, without HTML formatting.

body_html { "body_html" : "

This puppy is very cute.

" }

The description of the product, complete with HTML formatting.

shipping_code { "shipping_code" : "BULK" }

If the product requires special shipping, the shipping code is used to determine the specific shipping rate applicable to this product.

created_at { "created_at" : "2007-10-24T18:26:31Z" }

The date and time when the product was created. The timestamp is in ISO 8601 format.

updated_at { "updated_at" : "2014-01-16T05:50:56Z" }

The date and time when the product was last updated. The timestamp is in ISO 8601 format.

tags { "tags" : ["cute", "dog", "puppy", "brown dog"] }

This is a list of tags that are associated with this product. Tags can be used for filtering, searching and building collections of related products.

published { "published" : true }

Indicates whether the product has been published and is visible in the store front.

featured { "featured" : true }

Indicates whether the product is featured which allows it to be promoted to the top of a collection if required.

archived { "archived" : false }

Indicates whether the product is archived. An archived product is automatically hidden when it has sold out.

product_type { "product_type" : "Dogs" }

All products belong to a product type to help categorize and group the store's inventory.

vendor { "vendor" : "Spiffy Stores" }

All products have a vendor or maker which also can be used to help categorize and group the store's inventory.

options


"options":[{"name":"Title","position":1,"product_id":1673}],"custom_options":[]