Spree Storefront API
Storefront API is a modern REST API based on the [JSON API spec](https://jsonapi.org/) which provides you with all the necessary endpoints to build amazing…
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
Storefront API is a modern REST API based on the JSON API spec which provides you with all the necessary endpoints to build amazing user interfaces either in JavaScript frameworks or native mobile libraries.
Import to Postman
Endpoints 74
Account
- GETRetrieve an Account
/api/v2/storefront/accountReturns the current user details. - POSTCreate an Account
/api/v2/storefront/accountCreates a new account - PATCHUpdate an Account
/api/v2/storefront/accountUpdates the users account details
Account / Address
- GETList all Addresses
/api/v2/storefront/account/addressesReturns a list of addresses for the current user. - POSTCreate an Address
/api/v2/storefront/account/addressesCreates a new address for the current user. - DELETERemove an Address
/api/v2/storefront/account/addresses/:idThis endpoint removes the specified address for the current user. It uses a soft delete to retain address information for pre-existing orders. - PATCHUpdate an Address
/api/v2/storefront/account/addresses/:idUpdates the specified address for the current user.
Account / Credit Cards
- GETList all Credit Cards
/api/v2/storefront/account/credit_cardsReturns a list of credit cards for the current user. - DELETERemove a Credit Card
/api/v2/storefront/account/credit_cards/:idRemoves a specified credit card for the current user with a soft delete to retain payment information for any pre-existing orders. - GETRetrieve the default Credit Card
/api/v2/storefront/account/credit_cards/defaultReturns the current user's default credit card.
Account / Orders
- GETList all Orders
/api/v2/storefront/account/ordersReturns all completed orders placed by the current user in the current store. - GETRetrieve an Order
/api/v2/storefront/account/orders/:order_numberReturns a completed order for the current user within the scope of the current store.
Cart
- GETRetrieve a Cart
/api/v2/storefront/cartReturns the cart for the current user. - POSTCreate a Cart
/api/v2/storefront/cartCreates a new cart. Please be aware; The token value found in the response body is used to authorize all future operations on this cart through the Auth API… - DELETEDelete a Cart
/api/v2/storefront/cartDeletes a specified cart. When this endpoint is successfully executed, all shipments are cancelled, payments are voided, then line items, shipments & payments…
Cart / Line Items
- POSTAdd an Item to Cart
/api/v2/storefront/cart/add_itemAdds a variant to the current cart by creating a line item. Each line item represents a specified variant and the desired quantity. - PATCHSet Line Item Quantity
/api/v2/storefront/cart/set_quantitySets the quantity of a specified line item. - DELETERemove a Line Item
/api/v2/storefront/cart/remove_line_item/:idRemoves a line item from the cart by deleting the line item. After deleting the line item, the system will re-calculate taxes, promotions, shipments etc.
Cart / Coupons
- PATCHApply a Coupon Code / Gift Card
/api/v2/storefront/cart/apply_coupon_codeApplies a coupon code or gift card code to the current cart. - DELETERemove a Coupon / Gift Card
/api/v2/storefront/cart/remove_coupon_code/:coupon_codeRemoves a specified coupon code or gift card code from the current cart. - DELETERemove all Coupons
/api/v2/storefront/cart/remove_coupon_codeRemoves all coupons that have been applied to the current cart.
Cart / Other
- PATCHEmpty the Cart
/api/v2/storefront/cart/emptyThis endpoint removed all line items from the cart. Inventory that was previously taken by this order will be re-stocked. - GETList Estimated Shipping Rates
/api/v2/storefront/cart/estimate_shipping_rates?country_iso=USAReturns a list of shipping rates for the current cart. The rates given are only estimates and can vary from the final shipping rates. - PATCHAssociate a Cart with a User
/api/v2/storefront/cart/associate?guest_order_token=bd7SHdOAQqTsQHsjnhoWIw1633364692479Associates a guest cart with the currently signed in user. - PATCHChange Cart Currency
/api/v2/storefront/cart/change_currency?new_currency=USDChanges the cart currency and recalculates the cart values.
Checkout
- PATCHUpdate Checkout
/api/v2/storefront/checkoutThe Update Checkout endpoint allows you to manage the typical stages of an e-commerce checkout system. - POSTValidate order payment
/api/v2/storefront/checkout/validate_order_for_paymentValidate an order before placing it. It will respond with an error when: cart was changed any order item is out of stock any order item is discontinued
Checkout / State
- PATCHNext Checkout Step
/api/v2/storefront/checkout/nextGoes to the next checkout step. - PATCHAdvance Checkout
/api/v2/storefront/checkout/advanceAdvances the checkout to the furthest checkout step validation allows, up until the completed step. - PATCHComplete Checkout
/api/v2/storefront/checkout/completeCompletes the checkout by marking the order as complete. Please be aware; Once a checkout is marked as complete it is considered a completed order, the Cart…
Checkout / Shipments
- PATCHSelects shipping method for shipment(s)
/api/v2/storefront/checkout/select_shipping_methodSelects shipping method for Shipment(s). To generate shipments you first need to fetch shipping rates via Get Shipping Rates endpoint - GETList Shipping Rates
/api/v2/storefront/checkout/shipping_ratesReturns a list of available shipping rates for the checkout. Shipping rates are grouped against shipments. Each checkout can have multiple shipments. Some…
Checkout / Payments
- POSTCreate new Payment
/api/v2/storefront/checkout/create_paymentCreates new Payment for the current checkout. You can either create new payment source (eg. a Credit Card) or use an existing (for signed in users only).… - GETList Payment Methods
/api/v2/storefront/checkout/payment_methodsReturns a list of available payment methods for this checkout.
Checkout / Store Credit
- POSTAdd Store Credit
/api/v2/storefront/checkout/add_store_creditThe Add Store Credit endpoint takes the users existing store credit from their account and adds a set amount of this store credit to the current cart. In… - POSTRemove Store Credit
/api/v2/storefront/checkout/remove_store_creditRemoves store credit from the cart if any had previously been applied.
Stripe
- POSTCreate a Stripe Payment Intent
/api/v2/storefront/stripe/payment_intentsCreate a Stripe Payment Intent using provided payment method. It creates a Stripe customer if not exists. - GETReturn a Stripe Payment Intent
/api/v2/storefront/stripe/payment_intents/:idReturns the Payment Intent information - PATCHUpdates Stripe Payment Intent
/api/v2/storefront/stripe/payment_intents/:idUpdates the payment intent with new amount and stripe_payment_method_id - PATCHMark the payment intent as confirmed, and move the order to the complete state
/api/v2/storefront/stripe/payment_intents/:id/confirmThis endpoint is used to complete the order with succeeded payment intent. First it will check if the payment intent has status succeeded, if yes, then it… - POSTCreate a Stripe Setup Intent
/api/v2/storefront/stripe/setup_intentsFirst, this endpoint creates a customer in Stripe (if it doesn't already exist), then it creates an Ephemeral Key for the customer, and finally, it creates a…
Adyen
- POSTCreate an Adyen Payment Session
/api/v2/storefront/adyen/payment_sessionsCreate a new Adyen payment session with the specified amount. Adyen support is currently in private beta. Please contact us to get access. - POSTComplete an Adyen payment session and order
/api/v2/storefront/adyen/payment_sessions/:id/completeComplete an Adyen payment session and order. Adyen support is currently in private beta. Please contact us to get access. - GETGet Adyen Payment Session
/api/v2/storefront/adyen/payment_sessions/:idRetrieve An Adyen payment session information. Adyen support is currently in private beta. Please contact us to get access.
Countries
- GETList all Countries
/api/v2/storefront/countriesReturns a list of all countries. - GETRetrieve a Country
/api/v2/storefront/countries/:isoReturns the details of a specific country. - GETGet Default Country
/api/v2/storefront/countries/defaultReturns the default country for the current store. By default this will be the US.
Digital Downloads
- GETDownload a Digital Asset
/api/v2/storefront/digitals/:tokenThis endpoint allows you to download a digital item using the unique digital_link token. The digital_link token value can be found by including…
Order Status
- GETRetrieve an Order Status
/api/v2/storefront/order_status/:order_numberReturns completed order information. This endpoint is useful when fetching orders placed by a guest user, allowing customers without an account to check the…
Products
- GETList all Products
/api/v2/storefront/productsReturns a list of products for the current Store. - GETRetrieve a Product
/api/v2/storefront/products/:product_slugReturns Product details. You can use product permalink: GET /api/v2/storefront/products/knitted-high-neck-sweater Or Product ID: GET…
Variants
- GETList all Product Variants
/api/v2/storefront/products/:product_slug/variantsReturns a list of product variants. You can use product permalink: GET /api/v2/storefront/products/knitted-high-neck-sweater/variants Or Product ID: GET…
Stores
- GETReturn the current Store
/api/v2/storefront/storeReturns the current Store. Read more about Stores
Policies
- GETList all Store Policies
/api/v2/storefront/policiesReturns a list of Store Policies. This endpoint is only available in Spree 5.2 or later. - GETRetrieve a Policy
/api/v2/storefront/policies/:policy_slugReturns the details of a specified Policy. This endpoint is only available in Spree 5.2 or later.
Taxons
- GETList all Taxons
/api/v2/storefront/taxonsReturns a list of Taxons. Read more about Taxons - GETRetrieve a Taxon
/api/v2/storefront/taxons/:taxon_permalinkReturns the details of a specified taxon.
Vendors
- GETList all Vendors
/api/v2/storefront/vendorsReturns a list of Vendors. Only available in Enterprise Edition - GETRetrieve a Vendor
/api/v2/storefront/vendors/:vendor_slugReturns the details of a specified Vendor. Only available in Enterprise Edition
Wishlists
- GETList all Wishlists
/api/v2/storefront/wishlistsReturns all wishlists available to the current user, in the current store. - POSTCreate a Wishlist
/api/v2/storefront/wishlistsCreates a new wishlist for the current user in the current store. - GETRetrieve a Wishlist
/api/v2/storefront/wishlists/:tokenRetrieves a wishlist using the wishlist token. If the wishlist is publicly viewable, the endpoint will return the requested wishlist regardless of the user.… - DELETEDelete a Wishlist
/api/v2/storefront/wishlists/:tokenThis operation deletes the wishlist identified in the URI token. - PATCHUpdate a Wishlist
/api/v2/storefront/wishlists/:tokenUpdates the specific Wishlist by setting the values passed in the request body. Any parameters not provided will be left unchanged. - GETRetrieve the default Wishlist
/api/v2/storefront/wishlists/defaultReturns the default wishlist for the current user, in the current store. If the user does not have a default wishlist in the current store one will be created.
Wishlists / Wished Items
- POSTAdd Item to Wishlist
/api/v2/storefront/wishlists/:token/add_itemThe Add Item to Wishlist endpoint adds a variant to an existing wishlist by creating a new wished_item. A wished item in a wishlist is comparable to a line… - POSTAdd Items to Wishlist
/api/v2/storefront/wishlists/:token/add_itemsThe Add Items to Wishlist endpoint adds variants to an existing wishlist by creating a new wished_item objects. A wished item in a wishlist is comparable to a… - PATCHSet Wished Item Quantity
/api/v2/storefront/wishlists/:token/set_item_quantity/:item_idThis endpoint sets the wished item quantity. - DELETEDelete Item from Wishlist
/api/v2/storefront/wishlists/:token/remove_item/:item_idRemoves a wished item from a wishlist. - DELETEDelete Items from Wishlist
/api/v2/storefront/wishlists/:token/remove_itemsRemoves wished items from a wishlist.
Posts
- GETList all Posts
/api/v2/storefront/postsReturns a list of published Posts. This endpoint is only available in Spree 5.2 or later. - GETRetrieve a Post
/api/v2/storefront/posts/:idReturns the details of a specified Post. You can use either the post slug or ID. This endpoint is only available in Spree 5.2 or later.
Post Categories
- GETList all Post Categories
/api/v2/storefront/post_categoriesReturns a list of Post Categories. This endpoint is only available in Spree 5.2 or later. - GETRetrieve a Post Category
/api/v2/storefront/post_categories/:idReturns the details of a specified Post Category, including related posts. You can use either the category slug or ID. This endpoint is only available in…
API details
- Base URL
https://demo.spreecommerce.orghttp://localhost:3000- Authentication
- A bearer token in the Authorization header
An API key in the X-Spree-Order-Token header - Operations
- 74 operations on 64 pathsGET 34PATCH 16POST 15DELETE 9
- Main resources
- Wishlists 6Stripe 5Wishlists / Wished Items 5Account / Address 4Cart / Other 4Account 3Account / Credit Cards 3Adyen 3Cart 3Cart / Coupons 3
- Response formats
application/jsonimage/gifimage/jpegimage/svg+xml- Description format
- OpenAPI 3.0.3, API version
2.0.0 - Links
- OpenAPI document · Support
- Listed from
- Spree Commerce's published OpenAPI description (spree/spree) (BSD-3-Clause)
How to test the Spree Storefront API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Spree Storefront API collection, without the publisher's secrets.
- Add your credentialsThis API uses A bearer token in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Retrieve an Account” (GET /api/v2/storefront/account), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Spree Storefront API?
Storefront API is a modern REST API based on the [JSON API spec](https://jsonapi.org/) which provides you with all the necessary endpoints to build amazing… It is listed under E-commerce and has 74 endpoints.
Who publishes the Spree Storefront API?
It is listed from Spree Commerce's public API description (an OpenAPI document), not published by Spree Commerce on Swastik Codes. Anyone who controls spreecommerce.org can claim the profile by adding a DNS TXT record.
What is the base URL of the Spree Storefront API?
Its description lists 2 base URLs: https://demo.spreecommerce.org, http://localhost:3000. The first is the usual one; the others are typically sandbox or regional servers.
How do I authenticate with the Spree Storefront API?
It accepts 2 methods: A bearer token in the Authorization header; an API key in the X-Spree-Order-Token header.
How many endpoints does the Spree Storefront API have?
74 operations on 64 paths (34 GET, 16 PATCH, 15 POST, 9 DELETE). The largest groups are Wishlists, Stripe, Wishlists / Wished Items, Account / Address.
Is forking the Spree Storefront API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.