Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Add API Reference page to Spree Guides
Damian Legawiecdb678c2fed90
diff --git a/guides/src/components/Header.js b/guides/src/components/Header.jsindex 4e41550a7f..84b38bf09a 100644--- a/guides/src/components/Header.js+++ b/guides/src/components/Header.js@@ -71,9 +71,7 @@ export default class Header extends React.PureComponent {<DocSearch isOpen={this.state.searchIsOpen} /><nav className="h-100 w-100 tr dn flex-l items-center justify-end">- <NavItem url="https://api.spreecommerce.org/">- API- </NavItem>+ <NavItem text="API" url="/api/" isActive={this.isActive('api')} /><NavItemtext="Developer"isActive={this.isActive('developer')}diff --git a/guides/src/components/Layout.js b/guides/src/components/Layout.jsindex 78cd340a15..3a91e59f58 100644--- a/guides/src/components/Layout.js+++ b/guides/src/components/Layout.js@@ -44,7 +44,7 @@ export default class Layout extends React.Component {/><div className="z-3 relative ph4 items-center mw9 center h-100">- {this.props.nav && (+ {this.props.nav && this.props.activeSection != 'api' && (<Sidebarnav={this.props.nav}activeSection={this.props.activeSection}diff --git a/guides/src/content/api/index.md b/guides/src/content/api/index.mdindex db14eef039..7539acc21a 100644--- a/guides/src/content/api/index.md+++ b/guides/src/content/api/index.md@@ -1,9 +1,22 @@----title: REST API v1 guide+title: Spree API reference----This site covers the inner working of Spree\'s RESTful API. It assumes a basic understanding of the principles of REST.+Currently Spree has two REST APIs and in the future we will add GraphQL as well.-The REST API is designed to give developers a convenient way to access data contained within Spree. With a standard read/write interface to store data, it is now very simple to write third party applications (eg. iPhone) that can talk to your Spree store. It is also possible to build sophisticated middleware applications that can serve as a bridge between Spree and a warehouse or inventory system.+## [REST API v2](https://api.spreecommerce.org/docs/api-v2/api/docs/v2/storefront/index.yaml)++* Modern lightweight REST API based on JSON API schema built+* OAuth 2.0 authentication+* Recommended for building Storefronts and mobile apps+* [JavaScript / TypeScript SDK](https://github.com/spree/spree-storefront-api-v2-js-sdk) available++## [REST API v1](/api/v1/summary.html)++* Older REST API that requires API key authentication for access+* Full feature set of Admin Panel+* Recommended for building System integrations++## GraphQL+GraphQL support is coming soon!-For a comprehensive list of API functions, start browsing the resources in the above diagram.diff --git a/guides/src/content/api/addresses.md b/guides/src/content/api/v1/addresses.mdsimilarity index 100%rename from guides/src/content/api/addresses.mdrename to guides/src/content/api/v1/addresses.mddiff --git a/guides/src/content/api/checkouts.md b/guides/src/content/api/v1/checkouts.mdsimilarity index 100%rename from guides/src/content/api/checkouts.mdrename to guides/src/content/api/v1/checkouts.mddiff --git a/guides/src/content/api/countries.md b/guides/src/content/api/v1/countries.mdsimilarity index 100%rename from guides/src/content/api/countries.mdrename to guides/src/content/api/v1/countries.mddiff --git a/guides/src/content/api/customer_returns.md b/guides/src/content/api/v1/customer_returns.mdsimilarity index 100%rename from guides/src/content/api/customer_returns.mdrename to guides/src/content/api/v1/customer_returns.mddiff --git a/guides/src/content/api/line_items.md b/guides/src/content/api/v1/line_items.mdsimilarity index 100%rename from guides/src/content/api/line_items.mdrename to guides/src/content/api/v1/line_items.mddiff --git a/guides/src/content/api/option_types.md b/guides/src/content/api/v1/option_types.mdsimilarity index 100%rename from guides/src/content/api/option_types.mdrename to guides/src/content/api/v1/option_types.mddiff --git a/guides/src/content/api/option_values.md b/guides/src/content/api/v1/option_values.mdsimilarity index 100%rename from guides/src/content/api/option_values.mdrename to guides/src/content/api/v1/option_values.mddiff --git a/guides/src/content/api/orders.md b/guides/src/content/api/v1/orders.mdsimilarity index 100%rename from guides/src/content/api/orders.mdrename to guides/src/content/api/v1/orders.mddiff --git a/guides/src/content/api/payments.md b/guides/src/content/api/v1/payments.mdsimilarity index 100%rename from guides/src/content/api/payments.mdrename to guides/src/content/api/v1/payments.mddiff --git a/guides/src/content/api/product_images.md b/guides/src/content/api/v1/product_images.mdsimilarity index 100%rename from guides/src/content/api/product_images.mdrename to guides/src/content/api/v1/product_images.mddiff --git a/guides/src/content/api/product_properties.md b/guides/src/content/api/v1/product_properties.mdsimilarity index 100%rename from guides/src/content/api/product_properties.mdrename to guides/src/content/api/v1/product_properties.mddiff --git a/guides/src/content/api/products.md b/guides/src/content/api/v1/products.mdsimilarity index 100%rename from guides/src/content/api/products.mdrename to guides/src/content/api/v1/products.mddiff --git a/guides/src/content/api/return_authorizations.md b/guides/src/content/api/v1/return_authorizations.mdsimilarity index 100%rename from guides/src/content/api/return_authorizations.mdrename to guides/src/content/api/v1/return_authorizations.mddiff --git a/guides/src/content/api/shipments.md b/guides/src/content/api/v1/shipments.mdsimilarity index 100%rename from guides/src/content/api/shipments.mdrename to guides/src/content/api/v1/shipments.mddiff --git a/guides/src/content/api/states.md b/guides/src/content/api/v1/states.mdsimilarity index 100%rename from guides/src/content/api/states.mdrename to guides/src/content/api/v1/states.mddiff --git a/guides/src/content/api/stock_items.md b/guides/src/content/api/v1/stock_items.mdsimilarity index 100%rename from guides/src/content/api/stock_items.mdrename to guides/src/content/api/v1/stock_items.mddiff --git a/guides/src/content/api/stock_locations.md b/guides/src/content/api/v1/stock_locations.mdsimilarity index 100%rename from guides/src/content/api/stock_locations.mdrename to guides/src/content/api/v1/stock_locations.mddiff --git a/guides/src/content/api/stock_movements.md b/guides/src/content/api/v1/stock_movements.mdsimilarity index 100%rename from guides/src/content/api/stock_movements.mdrename to guides/src/content/api/v1/stock_movements.mddiff --git a/guides/src/content/api/summary.md b/guides/src/content/api/v1/summary.mdsimilarity index 99%rename from guides/src/content/api/summary.mdrename to guides/src/content/api/v1/summary.mdindex ba2fa45d61..7df53cc7fd 100644--- a/guides/src/content/api/summary.md+++ b/guides/src/content/api/v1/summary.md@@ -6,7 +6,7 @@ order: 0## OverviewSpree currently supports RESTful access to the resources listed in the sidebar-on the right »+on the left.This API was built using the great [Rabl](https://github.com/nesquena/rabl) gem.Please consult its documentation if you wish to understand how the templates usediff --git a/guides/src/content/api/taxonomies.md b/guides/src/content/api/v1/taxonomies.mdsimilarity index 100%rename from guides/src/content/api/taxonomies.mdrename to guides/src/content/api/v1/taxonomies.mddiff --git a/guides/src/content/api/users.md b/guides/src/content/api/v1/users.mdsimilarity index 100%rename from guides/src/content/api/users.mdrename to guides/src/content/api/v1/users.mddiff --git a/guides/src/content/api/variants.md b/guides/src/content/api/v1/variants.mdsimilarity index 100%rename from guides/src/content/api/variants.mdrename to guides/src/content/api/v1/variants.mddiff --git a/guides/src/content/api/zones.md b/guides/src/content/api/v1/zones.mdsimilarity index 100%rename from guides/src/content/api/zones.mdrename to guides/src/content/api/v1/zones.mddiff --git a/guides/src/pages/index.js b/guides/src/pages/index.jsindex 38215f7e4d..8e8f96c8a4 100644--- a/guides/src/pages/index.js+++ b/guides/src/pages/index.js@@ -25,12 +25,18 @@ const IndexPage = () => (<div className="mw8 center"><div className="flex flex-column flex-wrap flex-row-ns mv4 w-100">- <Section path="https://api.spreecommerce.org" title="API Guides" className="w-50-ns">- The REST API is designed to give developers a convenient way to- access data contained within Spree. With a standard read/write- interface to store data, it is now very simple to write third party- applications (JavaScript/Mobile/other technologies) that can talk to- your Spree store.+ <Section path="/api/" title="API Reference" className="w-50-ns">+ <p>+ The REST API is designed to give developers a convenient way to+ access data contained within Spree. With a standard read/write+ interface to store data, it is now very simple to write third party+ applications (JavaScript/Mobile/other technologies) that can talk to+ your Spree store.+ </p>+ <ul className="list">+ <li className="dib mr2"><a href="/api/v1/summary.html">REST API v1</a></li>+ <li className="dib mr2"><a href="https://api.spreecommerce.org/docs/api-v2/api/docs/v2/storefront/index.yaml">REST API v2</a></li>+ </ul></Section><Section