Skip to main content

Storefront API — Getting Started

The Quark Commerce Storefront API is a RESTful API designed for building customer-facing e-commerce experiences — whether web, mobile, or any other platform. All endpoints are prefixed with /api/storefront/.

Base URL

EnvironmentURL
Local developmenthttp://localhost:8080
Productionhttps://quarkapi.yourdomain.com

Quick Start

1. Get store configuration

curl -H "X-Store-Code: us-store" \
http://localhost:8080/api/storefront/store-config

This returns the store's supported languages, currencies, and default settings.

2. Browse categories

curl -H "X-Store-Code: us-store" \
-H "X-Language-Code: en" \
http://localhost:8080/api/storefront/categories

3. Get products by category

curl -H "X-Store-Code: us-store" \
-H "X-Language-Code: en" \
-H "X-Currency-Code: USD" \
http://localhost:8080/api/storefront/products/category/{categoryId}?page=1&pageSize=20

4. Add to basket

curl -X POST \
-H "Content-Type: application/json" \
http://localhost:8080/api/storefront/basket/{basketId}/items \
-d '{"productVariantId": "...", "quantity": 1}'

5. Checkout

curl -X POST \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
http://localhost:8080/api/storefront/checkout/session \
-d '{"basketId": "...", "shippingAddress": {...}}'

Required Headers

Every storefront request should include context headers:

HeaderRequiredDescription
X-Store-CodeYesStore identifier (e.g., us-store, tr-store)
X-Language-CodeYesContent language (e.g., en, tr)
X-Currency-CodeRecommendedPricing currency (e.g., USD, TRY)
AuthorizationFor auth endpointsBearer <jwt-token>

See Store Context for details on how these headers work.

Endpoint Overview

ControllerBase RouteDescription
StoreConfig/api/storefront/store-configStore settings, languages, currencies
Categories/api/storefront/categoriesCategory tree and details
Products/api/storefront/productsProduct listing, detail, search
Brands/api/storefront/brandsBrand listing
Basket/api/storefront/basketShopping basket CRUD
Checkout/api/storefront/checkoutCheckout session management
Orders/api/storefront/ordersOrder history and details
Payments/api/storefront/paymentsPayment processing callbacks
Shipping/api/storefront/shippingShipping method calculation
Availability/api/storefront/availabilityStock availability checks
Auth/api/authLogin, register, password reset
Profile/api/storefront/profileUser profile management
Addresses/api/storefront/addressesAddress book
Slugs/api/storefront/slugsSEO slug resolution
Navigation/api/storefront/navigationNavigation menus
Pages/api/storefront/pagesCMS pages and content blocks
Documents/api/storefront/documentsLegal documents
GDPR/api/storefront/gdprData export and deletion
Countries/api/storefront/countriesCountry/region listing
Verification/api/storefront/verificationPhone/email verification

Swagger

Interactive API documentation is available at:

http://localhost:8080/swagger
tip

While Swagger shows all endpoints and their request/response shapes, this documentation explains the relationships between entities, required flows (e.g., the checkout sequence), and design decisions that are not visible in Swagger alone.