Definitions

Products and Variants

Products - Products are the items that you sell and are the parent type for variants. Products can be made up of any number of variants.

Variant - Variants represent each distinct version of a product, defined by the options and attributes of a Product. For example, the product “Shirt” would have variants for each possible combination of color and size. Stock in Stitch is tracked at the variant level. While variants are often physical items for sale, they can be used in any case where you need to track detailed availability. Unique combinations of attributes are used to differentiate the variants of a product.

Attributes -
Attributes are the characteristics of a product (e.g., color, size, type, style, flavor, material). A variant can have any number of attributes.

Options - Attributes are characteristics of a product (e.g., size or color) and options are the specific attribute values (e.g., small, medium, large). An attribute can have any number of options.

Bundle - Bundles are a collection of variants grouped together as a single unit. This type of variant that calculates it’s availability based on the availability of it’s multiple component variants.

Component - A variant that is part of a bundle, and may or may not be sold separately.

Read Actions

Products

Product Listing

Retrieves a paginated unfiltered list of all account products

POST https://api-pub.stitchlabs.com/v2/Products
{
  "action": "read"
}

Product Listing Pagination

Retrieves a paginated unfiltered list of all account products beginning at a specified page offset

POST https://api-pub.stitchlabs.com/v2/Products
{
    "action": "read",
    "page_size": 15,
    "page_num": 1
}

Product Listing Sorting

Retrieves a paginated unfiltered list of all account products sorted by a set of request criteria

POST https://api-pub.stitchlabs.com/v2/Products
{
    "action": "read",
    "sort": [
        {
            "created_at": "desc"
        }
    ]
}
Sortable Attributes for Products

Product Listing Filters

Retrieves a paginated list of all account products filtered by a set of request criteria. Applying a filter allows your application to limit listing requests by object values.

POST https://api-pub.stitchlabs.com/v2/Products
{
    "action": "read",
    "filter": {
        "and": [
            {
                "archived": "0"
            },
            {
                "created_at": "2015-01-01",
                "operation": ">="
            }
        ]
    }
}

Note There can only be one filter per request. There should only be at most 2 AND/OR conditionals in each filter statement. Each conditional can have as many sub-filters as necessary.

Filterable Attributes for Products
  • id
  • archived
  • created_at
  • local_id
  • name
  • notes
  • updated_at

Product Detail

Retrieves a detailed product record

POST https://api-pub.stitchlabs.com/v2/Products/detail
{
    "action": "read",
    "Products": [
        {
            "id": 70344144
        }
    ]
}

Variants

Variant Listing

Retrieves a paginated unfiltered list of all account variants

POST https://api-pub.stitchlabs.com/v2/Variants
{
  "action": "read"
}

Variant Listing Pagination

Retrieves a paginated unfiltered list of all account variants beginning at a specified page offset

POST https://api-pub.stitchlabs.com/v2/Variants
{
    "action": "read",
    "page_size": 15,
    "page_num": 1
}

Variant Listing Sorting

Retrieves a paginated unfiltered list of all account variants sorted by a set of request criteria

POST https://api-pub.stitchlabs.com/v2/Variants
{
    "action": "read",
    "sort": [
        {
            "created_at": "desc"
        }
    ]
}
Sortable Attributes for Variants

Variant Listing Filters

Retrieves a paginated list of all account products filtered by a set of request criteria. Applying a filter allows your application to limit listing requests by object values.

POST https://api-pub.stitchlabs.com/v2/Variants
{
    "action": "read",
    "filter": {
        "and": [
            {
                "bundle": "0"
            }
        ]
    }
}

Note There can only be one filter per request. There should only be at most 2 AND/OR conditionals in each filter statement. Each conditional can have as many sub-filters as necessary.

Filterable Attributes for Variants
  • auto_description
  • auto_description_with_option_type
  • available
  • average_cost
  • bundle
  • component
  • consignment
  • created_at
  • description
  • id
  • local_id
  • location_1
  • low_stock_alert
  • notes
  • sku
  • sort_order
  • stock
  • supplier_cost
  • supplier_id
  • upc
  • updated_at
  • weight

Variant Detail

Retrieves a detailed variant record

POST https://api-pub.stitchlabs.com/v2/Variants/detail
{
    "action": "read",
    "Variants": [
        {
            "id": 25379
        }
    ]
}

Write Actions

Creating a Product (without Variants)

Creates a product record for an account with a single attributeless variant

POST https://api-pub.stitchlabs.com/v1/Products/detail
{
  "action": "write",
  "Products": [
    {
      "name": "Product Name",
      "description": "Product Description",
      "links": {
        "Variants": [
          {}
        ]
      }
    }
  ]
}

Creating a Product (with Variants)

Creates a product record for an account with multiple variants

POST https://api-pub.stitchlabs.com/v1/Products/detail
{
    "action": "write",
    "Products": [
        {
            "name": "Product Name",
            "description": "Product Description",
            "links": {
                "Attributes": [
                    {
                        "name": "Color",
                        "order": 0
                    }
                ],
                "Variants": [
                    {
                        "links": {
                            "AttributeOptions": [
                                {
                                    "value": "red",
                                    "order": 0
                                }
                            ]
                        },
                        "quantity": "20",
                        "cost": "10"
                    },
                    {
                        "links": {
                            "AttributeOptions": [
                                {
                                    "value": "green",
                                    "order": 0
                                }
                            ]
                        },
                        "quantity": "5",
                        "cost": "30"
                    }
                ],
                "PricingTiers": [
                    {
                        "id": "1059",
                        "value": "20"
                    },
                    {
                        "name": "new wholesale",
                        "value": "21"
                    }
                ]
            }
        }
    ]
}

Each Product will have it’s own unique set of attribute option pair sets

Editing a Product

Update product record attributes

POST https://api-pub.stitchlabs.com/v1/Products/detail
{
    "action": "write",
    "Products": [
        {
            "id": 70504874,
            "description": "Updated Description"
        }
    ]
}

Archiving Products

Archiving a Product

Archive a product record

POST https://api-pub.stitchlabs.com/v1/Products/detail
{
    "action": "write",
    "Products": [
        {
            "id": 13793,
            "archive": 1
        }
    ]
}
Bulk Product Archiving

Archive multiple product records

POST https://api-pub.stitchlabs.com/v1/Products/detail
{
  "action":"write",
  "bulk_action":{
     "archive":1
  },
  "Products":[
     {
        "id":"42778236"
     },
     {
        "id":"43132140"
     }
  ]
}

Deleting a Product

Mark a product record as deleted

POST https://api-pub.stitchlabs.com/v1/Products/detail
{
    "action": "write",
    "Products": [
        {
            "id": 13793,
            "delete": 1
        }
    ]
}

Creating a Variant

Creates a variant record with under the specified Product

https://api-pub.stitchlabs.com/v1/Variants/detail
{
    "action": "write",
    "Variants": [
        {
            "weight": "1",
            "links": {
                "Products": [
                    {
                        "id": "13660"
                    }
                ]
            }
        }
    ]
}

Creating a Variant with Attributes/Options

Creates a variant record with new attribute / option pair

POST https://api-pub.stitchlabs.com/v1/Variants/detail
{
  "action": "write",
  "Variants": [
    {
      "links": {
        "AttributeOptions": [
          {
            "value": "Blue",
            "links": {
              "Attributes": [
                {
                  "name": "Color"
                }
              ]
            }
          }
        ],
        "Products": [
          {
            "id": "70504874"
          }
        ]
      }
    }
  ]
}

Editing a Variant

Update variant record attributes

POST https://api-pub.stitchlabs.com/v1/Variants/detail
{
    "action": "write",
    "Variants": [
        {
            "id": 25820,
            "weight": "1"
        }
    ]
}

Deleting a Variant

Mark a variant record as deleted

POST https://api-pub.stitchlabs.com/v1/Variants/detail
{
    "action": "write",
    "Variants": [
        {
            "id": 25379,
            "delete": 1
        }
    ]
}

Product Files

Product File Listing

Retrieves a paginated list of all account product files

POST https://api-pub.stitchlabs.com/v2/ProductFiles
{
  "action": "read"
}

Product File Detail

Retrieves a detailed product file record

POST https://api-pub.stitchlabs.com/v2/ProductFiles/detail
{
  "action": "read",
  "ProductFiles":[
    {
      "id": "1"
    }
  ]
}

Create a Product File

Creates a product file record

POST https://api-pub.stitchlabs.com/v1/ProductFiles
{
  "json": "{\"action\":\"write\",\"ProductFiles\":[{\"links\":{\"Products\":[{\"id\":\"1982\"}]}}]}",
  "action": "write",
  "file": {}
}

Delete a Product File

Mark a product file record as deleted

POST https://api-pub.stitchlabs.com/v1/ProductFiles
{
    "action": "write",
    "ProductFiles": [
        {
            "id": "3213",
            "delete": "1"
        }
    ]
}

Product Tags

Tagging is a great way to categorize and organize your records in Stitch. By creating a tag, you can search for all items associated with the tag, run reports, and automate your API workflows

Product Tag Listing

Retrieves a paginated list of all account product tags

POST https://api-pub.stitchlabs.com/v2/ProductTags
{
  "action": "read"
}

Product Tag Detail

Retrieves a detailed product tag record

POST https://api-pub.stitchlabs.com/v1/ProductTags/detail
{
    "action": "read",
    "ProductTags": [
        {
            "id": 370
        }
    ]
}

Creating a Product Tag

Creates a product tag record

POST https://api-pub.stitchlabs.com/v1/ProductTags/detail
{
    "action": "write",
    "ProductTags": [
        {
            "name": "Product Tag"
        }
    ]
}

Tagging a Product

Apply a product tag to a product and/or Generate a product tag in a product update request

POST https://api-pub.stitchlabs.com/v1/Products/detail
{
    "action": "write",
    "Products": [
        {
            "id": 7652,
            "links": {
                "ProductTags": [
                    {
                        "id": 6098
                    },
                    {
                        "name": "New Tag"
                    }
                ]
            }
        }
    ]
}

Bulk Tagging a Product

Apply a collection of product tags to a collection of products

POST https://api-pub.stitchlabs.com/v1/Products/detail
{
  "action":"write",
  "bulk_action":{
     "Tags":[
        {
           "id":"5204096",
           "assign":1
        }
     ]
  },
  "Products":[
     {
        "id":"42778236"
     },
     {
        "id":"43132140"
     }
  ]
}

Delete a Product Tag

Mark a product tag record as deleted

POST https://api-pub.stitchlabs.com/v1/ProductTags/detail
{
    "action": "write",
    "ProductTags": [
        {
            "id": 1441,
            "delete": 1
        }
    ]
}