No release in over 3 years
Legacy API v2 endpoints for Spree Commerce.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

Runtime

~> 43.0
>= 5.4.0.alpha
 Project Readme

Spree Legacy API v2

⚠️ DEPRECATED: This gem provides the legacy API v2 endpoints for Spree Commerce. We recommend using API v3.

Overview

This gem contains the legacy Storefront API v2 and Platform API v2 endpoints that were previously part of spree_api. These APIs are now deprecated in favor of the new API v3, which is much simpler, faster and more secure.

Installation

Add this line to your application's Gemfile:

gem 'spree_legacy_api_v2'

And run the following command:

bundle exec rake spree_legacy_api_v2:install

This will install the database migrations and run them.

Migration Guide

Storefront API

The new Store API v3 provides similar functionality with improved consistency:

Legacy v2 Endpoint New v3 Endpoint
GET /api/v2/storefront/products GET /api/v3/store/products
GET /api/v2/storefront/cart GET /api/v3/store/orders/:id
POST /api/v2/storefront/cart/add_item POST /api/v3/store/orders/:id/line_items
GET /api/v2/storefront/account GET /api/v3/store/customers

Key Differences

  1. Serialization: API v3 uses Alba serializers (faster, simpler) instead of JSONAPI::Serializer
  2. Response Format: API v3 returns simple JSON objects instead of JSONAPI format
  3. Authentication: API v3 requires publishable key authentication for Store API and uses JWT tokens for user authentication
  4. TypeScript Types: API v3 automatically generates TypeScript types via Typelizer

License

Spree is released under the AGPL-3.0-or-later and BSD-3-Clause licenses.