Backend API

Fields
idobjectId

Unique identifier for the product.

namestringrequired

Human-friendly name of the product.

activeboolean

Indicates whether the product is active and available in the storefront.

purchase_optionsobject

Configuration of one or more purchase options for the product. Can be standard for one-time purchases or subscription for a subscription plan. Products can support both purchase options simultaneously.

attributesobject

An object containing custom attribute values, keyed by each attribute's id. A value can be a single value or an array.

bundleboolean

Indicates whether the product is a bundle of other products.

bundle_itemsarray of object

List of products sold as a bundle. Applicable only when bundle=true.

categoryCategory

Expandable link to the primary category.

category_idobjectId

Primary category, commonly used as a navigation anchor.

categoriesCategory

Expandable link to all related product categories.

category_indexobject

Index of categories used for fast lookup operations.

codestring

Unique code to identify the gift card product.

costcurrency

Cost of goods (COGS) used to calculate gross margins.

cross_sellsarray of object

List of products to display as cross-sells on a shopping cart page.

currencystring

Three-letter ISO currency code in uppercase. Defaults to your store's base currency.

customizableboolean

Indicates whether the product has custom options enabled.

date_createddateauto

Date and time the product was created.

date_updateddateauto

Date and time the product was last updated.

deliveryenumauto

Method of fulfillment automatically assigned based on type:

  • shipment means the product will be physically shipped to a customer.
  • subscription means the product will be fulfilled as a subscription when an order is placed. giftcard delivery means the product will be fulfilled as a gift card when an order is placed.
  • null means the product will not be fulfilled by one of the above methods.

Note: A bundle has its child products fulfilled individually; each product in the bundle must have its own fulfillment method.

Possible enum values:

shipmentsubscriptiongiftcard
descriptionstring

A long-form description of the product. May contain HTML or other markup languages.

discontinuedboolean

Indicates whether the product has been discontinued.

imagesarray of object

List of images depicting the bundle.

meta_titlestring

Page title used to override product name in storefronts.

meta_keywordsstring

Page keywords used for search engine optimization purposes.

meta_descriptionstring

Page description used for search engine optimization purposes.

optionsarray of object

Options that allow for variations of the base product. If the option is part of a variant or required=true, an option value must be set for the product to be added to a cart.

orig_pricecurrency

Reflects the non-sale price of the product

pricecurrency

List price used when sale=false or sale_price is not defined. This value is intended for use via the frontend. See the purchase_options array to manage a product's price.

pricesarray of price

Price rules determined by cart quantity or customer account group. Overrides price and sale_price when conditions match.

quantity_minint

Minimum quantity of the product that can be sold at once.

quantity_incint

Specifies a quantify multiple the product must be sold in.

related_product_idsarray of child_scalar

Array of related product IDs.

saleboolean

Indicates whether the product is on sale. If true, the sale_price will be used by default when the product is added to a cart.

sale_pricecurrency

Sale price used to override list price when sale=true.

shipment_dimensionsobject

Product dimensions when packed for shipping. Typically used by third-party carriers in box packing algorithms to optimize shipping costs.

shipment_locationstring

ID of location from /settings/shipping/locations. If specified, shipping is calculated from this location. Otherwise, the store's default location will be used.

shipment_package_quantityfloat

If specified, shipping is calculated using this as the maximum number of items per package. Otherwise, Swell assumes any quantity fits into a single package.

shipment_pricesarray of object

Product shipping price rules to override default shipping rules.

shipment_weightfloat

If specified, shipping is calculated using this weight. Otherwise, Swell assumes 1 lb/oz/kg—depending on the store's default weight unit.

subscription_intervalenum

The default billing interval when this product is used as a subscription plan. Can be monthly, yearly, weekly, or daily.

Possible enum values:

monthlydailyweeklyyearly
subscription_interval_countint

Multiplier when combined with subscription_interval. For example, to make a subscription bill every two weeks, set subscription_interval=weekly and subscription_interval_count=2.

subscription_trial_daysint

Number of days offered as a free trial before the customer is billed. If a subscription is canceled by the last day of the trial period, an invoice won't be issued.

skustring

Stock keeping unit (SKU) used to track inventory in a warehouse.

slugstringrequired

Lowercase, hyphenated identifier typically used in URLs. When creating a product, a slug will be generated automatically from the name. Maximum length of 1,000 characters.

stockarray of Stock

Expandable list of stock adjustments for the product.

stock_backorderboolean

Indicates whether the product can be backordered if out of stock.

stock_levelintauto

Quantity of the product currently in stock (including all variants), based on the sum of the stock entries. Includes positive quantities, excluding variants that have negative stock values.

stock_level_in_locationsint

Quantity of the product in stock across inventory locations, if the product has no variants.

stock_level_minintauto

Minimum stock value including all variants. May represent negative variant stock levels.

stock_level_totalintauto

Sum total of all product stock values.

stock_locationsobject

Stock distributed over inventory locations, if multi-location inventory is enabled.

available_locationsarray of location

List of custom inventory locations for this product.

stock_preorderboolean

Indicates whether the product can be purchased as a preorder.

stock_purchasableboolean

Indicates whether the product's stock is purchasable.

stock_statusenumauto

String indicating the product's stock status for the purpose of ordering. When stock_purchasable=true, an order can be placed for this product regardless of current stock status. Otherwise an order submission will be blocked unless stock status is available, preorder, or backorder.

Possible enum values:

discontinuedpreorderbackorderout_of_stockin_stock
stock_trackingboolean

Indicates whether the product has stock tracking enabled.

summarystring

A brief product summary.

tagsarray of child_scalar

Array of searchable tags to aid in search discoverability.

tax_classstring

Indicates the tax class for the product.

tax_codestring

Product tax code for tracking with Avalara, TaxJar, etc.

theme_templatestring

ID of an alternate theme template used to render this product in a storefront, if applicable.

typestring

Implies the ordering and fulfillment options available for the product. Can be standard, subscription, bundle, or giftcard. A standard product is a physical item that will be shipped to a customer.

up_sellsarray of object

List of products to display as up-sells on a product detail page.

variableboolean

Indicates whether the product has variant generation enabled.

variantsarray of Variants

Expandable list of variants representing unique variations of the product. Each variant is a combination of one or more options. For example, Size and Color.

virtualboolean

Indicates whether the product is virtual.

The product model
{
  "name": "Iron dagger",
  "sku": "00090616",
  "active": true,
  "purchase_options": {
    "standard": {
      "active": true,
      "price": 10,
      "sale_price": null,
      "sale": false,
      "prices": []
    },
    "subscription": {
      "active": true,
      "plans": [
        {
          "name": "Monthly",
          "description": "1 dagger/month",
          "price": 9,
          "billing_schedule": {
            "interval": "monthly",
            "interval_count": 1,
            "limit": null,
            "trial_days": 14
          },
          "id": "627c6f180d375a001296b593",
          "active": true
        }
      ]
    }
  },
  "variable": true,
  "description": "<h3>Damage: 7</h3><h3>Weight: 8</h3><h3>Health: 98</h3><h3>Speed: 1.4</h3><h3>Reach: 0.6</h3>",
  "tags": [],
  "meta_title": null,
  "meta_description": null,
  "slug": "iron-dagger",
  "attributes": {
    "blade": "",
    "dagger": "",
    "type": [
      "Fine",
      "Rusty"
    ]
  },
  "delivery": "shipment",
  "bundle": null,
  "price": 10,
  "stock_tracking": false,
  "options": [
    {
      "id": "627c6e36e80393798c171670",
      "values": [
        {
          "id": "627c6f18e80393798c171673",
          "name": "Fine",
          "price": null,
          "shipment_weight": null,
          "description": "A better-than-usual iron dagger"
        },
        {
          "id": "627c6f18e80393798c171674",
          "name": "Rusty",
          "price": 0,
          "shipment_weight": null,
          "description": "This dagger's seen better days"
        }
      ],
      "name": "Type",
      "active": true,
      "input_type": "select",
      "variant": true,
      "description": null,
      "required": true,
      "attribute_id": "type"
    }
  ],
  "currency": "USD",
  "sale": false,
  "sale_price": null,
  "prices": [],
  "type": "standard",
  "tax_class": "standard",
  "date_created": "2022-05-12T02:21:12.534Z",
  "stock_status": null,
  "date_updated": "2022-05-12T02:37:45.666Z",
  "category_index": {
    "sort": {
      "627c6db5632818001272f8ed": 0,
      "627c6dc30d375a001296a8b7": 0
    },
    "id": [
      "627c6db5632818001272f8ed",
      "627c6dc30d375a001296a8b7"
    ]
  },
  "cross_sells": [],
  "up_sells": [
    {
      "id": "627c7225e80393798c17167b",
      "product_id": "627c715e632818001274ebd8"
    }
  ],
  "id": "627c6f180d375a001296b580"