Skip to main content
GET
/
api
/
v2
/
storefront
/
products
List all Products
curl --request GET \
  --url https://demo.spreecommerce.org/api/v2/storefront/products
{
  "data": [
    {
      "id": "1",
      "type": "product",
      "attributes": {
        "name": "Example product",
        "description": "Example description",
        "available_on": "2012-10-17T03:43:57Z",
        "slug": "example-product",
        "price": "15.99",
        "currency": "USD",
        "display_price": "$15.99",
        "purchasable": true,
        "in_stock": true,
        "backorderable": true,
        "meta_description": "Example product",
        "meta_keywords": "example, product",
        "updated_at": "2020-02-16T07:14:54.617Z",
        "sku": "9238-WS",
        "available": true,
        "compare_at_price": "49.99",
        "display_compare_at_price": "$49.99",
        "localized_slugs": {},
        "tags": [
          "<string>"
        ],
        "labels": [
          "<string>"
        ]
      },
      "relationships": {
        "variants": {
          "data": [
            {
              "id": "<string>",
              "type": "<string>"
            }
          ]
        },
        "option_types": {
          "data": [
            {
              "id": "<string>",
              "type": "<string>"
            }
          ]
        },
        "product_properties": {
          "data": [
            {
              "id": "<string>",
              "type": "<string>"
            }
          ]
        },
        "taxons": {
          "data": [
            {
              "id": "<string>",
              "type": "<string>"
            }
          ]
        },
        "images": {
          "data": [
            {
              "id": "<string>",
              "type": "<string>"
            }
          ]
        },
        "default_variant": {
          "data": {
            "id": "<string>",
            "type": "<string>"
          }
        },
        "primary_variant": {
          "data": {
            "id": "<string>",
            "type": "<string>"
          }
        }
      }
    }
  ],
  "meta": {
    "count": 7,
    "total_count": 145,
    "total_pages": 10
  },
  "links": {
    "self": "<string>",
    "next": "<string>",
    "prev": "<string>",
    "last": "<string>",
    "first": "<string>"
  },
  "included": [
    {
      "id": "1",
      "type": "payment_method",
      "attributes": {
        "type": "Spree::Gateway::StripeGateway",
        "name": "Stripe",
        "description": "Stripe Payments",
        "preferences": {}
      }
    }
  ]
}

Query Parameters

filter[ids]
string

Fetch only resources with corresponding IDs

filter[skus]
string

Fetch only resources with corresponding SKUs

filter[price]
string

Filter Products based on price (minimum, maximum range)

filter[taxons]
string

Filter Products based on taxons (IDs of categories, brands, etc)

filter[vendor_ids]
string

Fetch products from specified Vendors (Sellers) - only available in Enterprise Edition

filter[name]
string

Find Products with matching name (supports wild-card, partial-word match search)

filter[options][tshirt-color]
string

Find Products with Variants that have the specified option (eg. color, size) and value (eg. red, XS)

filter[properties][brand-name]
string

Find Products with Property Brand Name with value Alpha

filter[show_deleted]
boolean

Returns also deleted products

filter[show_discontinued]
boolean

Returns also discontinued products

filter[in_stock]
boolean

Returns only in stock products

filter[backorderable]
boolean

Returns only backorderable products

filter[purchasable]
boolean

Returns only in stock or backorderable products

sort
string

Sort products based on:

  • name (ascending/descending)
  • price (ascending/descending)
  • available_on (ascending/descending)
  • created_at (ascending/descending)
  • updated_at (ascending/descending)
  • sku (ascending/descending)
Use - sign to set descending sort, eg. -updated_at
page
integer

Number of requested page when paginating collection

per_page
integer

Number of requested records per page when paginating collection

include
string

Specify what related resources (relationships) you would like to receive in the response body. Eg.

default_variant,variants,option_types,product_properties,taxons,images,primary_variant

More information

fields[product]
string

Specify the fields you would like returned in the response body. More information.

image_transformation[size]
string

Specifies dimensions for included images at transformed_url attribute.

image_transformation[quality]
string

Specifies quality for included images at transformed_url attribute

Response

200 - application/vnd.api+json

200 Success - Returns an array of product objects.

data
Product · object[]
required
meta
Pagination Meta · object
required
included
Credit Card Includes · object[]