Skip to main content

Migration guide

Introduction

The Storefront API combines the strengths of server-side and client-side GraphQL: giving developers the tools they need to build modern, innovative storefronts, with the help of its clever queries to fetch exactly the data you need. No more, no less.

This means you’re cutting down on resource usage and boosting network speed, making everything run like a well-oiled machine. And with the ability to execute multiple queries or mutations in a single call, you’re looking at seriously enhanced performance. Plus, its strongly typed schema keeps everything reliable and consistent—no surprises here!

Performance isn’t just a feature; it’s at the core of the Storefront API, engineered to accommodate heavy frontend utilization without compromising on response times. This ensures a seamless user experience, even under significant load.

The API offers flexible configuration options, including session and no-session modes. This flexibility extends to the management of affiliates, allocation rules, brick-and-mortar locations, and customizable bundles, enriching the development experience. It’s a playground for developers who want to build something truly special.

Perks

  • Seamless Selection Integration
    • Selections created in Centra backend can be easily checked out in the Storefront API by generating a selection link and using the claimSelection mutation (claimSelection(id: String!, hash: String!)). This makes it easier to manage selections and streamline the checkout process.
  • Custom Attributes at Category and Selection Levels
    • The Storefront API supports custom attributes both at the category level and on individual selections. This flexibility allows you to tailor the experience for your customers and present highly personalized product options.
  • Session and No-Session Modes The Storefront API offers two modes:
    • Session Mode: This allows users to manage carts, complete checkouts, and perform post-checkout operations based on the shopper’s session details (market, price list, language, etc.).
    • No-Session Mode: Stateless and designed to expose only the necessary data, this mode is ideal for building custom caches and efficiently handling data without retaining session information.
  • Affiliate Tracking
    • The Storefront API enables you to track affiliate-driven sales easily. When a user arrives on your site via an affiliate link, the affiliate is connected to the selection. This helps you monitor and analyze orders generated through affiliate partnerships, such as influencer marketing efforts.
  • Historical Orders
    • Once a customer completes the checkout process, the selection is automatically converted into an order. Registered users can log in and view their historical orders, improving the post-purchase experience and fostering customer retention.
  • Advanced Filtering Options
    • The Storefront API provides comprehensive filtering capabilities (displayItems.filters) for narrowing down results by categories, collections, brands, and more. You can retrieve detailed filter data, such as category information, without requiring separate queries. This improves both performance and user experience.
  • Powerful Search Capabilities
    • Storefront API enables you to implement a search bar with both strict and full-text search options. A simple search query allows the API to find matching results across various fields, improving product discoverability and enhancing the user experience.

Key Tips for Migrating from Checkout API to Storefront API

Optimize Your Data Fetching To ensure smooth performance and avoid overfetching, optimize the data you retrieve based on where the customer is in their journey. Fetch only the necessary data depending on whether the user is browsing, viewing the cart, or checking out.

Simply mapping Checkout API responses to the Storefront API will cause overfetching — meaning you end up pulling more data than necessary. To avoid this, plan ahead and make sure you're only fetching the data you actually need.

So how do you start the migration?

When starting, the Catalog is a good place to focus. For example, when fetching a list of display items, you likely don't need all the attributes — just key ones, like the color swatch.

On the PDP (Product Detail Page), you’ll need more detailed data, but only for one product. Related products are fetched similarly to a list view. The same goes for cart vs. checkout: in the cart, you don't need all the data that’s required at checkout.

For instance, in the cart, you probably don't need to load checkout fields like shipping costs. If you're calculating shipping totals, there’s no need to ask for details from services like Ingrid while still in the cart. The same applies to responses when adding products from the PDP.

Migration table

Customer

Update customer

ActionCheckout APIShop APIStorefront API
Update customer addressPUT /addressPUT /customers/{email}updateCustomer
Update customerPUT /customer/updatePUT /customers/{email}updateCustomer
Change passwordPUT /passwordPUT /customers/{email}updateCustomer
Change emailPUT /emailPUT /customers/{email}updateCustomer

Register, log in and log out

ActionCheckout APIShop APIStorefront API
Register customerPOST /registerPOST /customers/{email}registerCustomer
Log inPOST /login/{email}POST /customers/{email}/loginlogin
Log outPOST /logoutNo matcheslogout

Get customer data

ActionCheckout APIShop APIStorefront API
CustomerGET /customerGET /customers/{email}
GET /customers/{email}/registered/{registered}
customer
Customer ordersPOST /orderscustomer

Subscription management

ActionCheckout APIShop APIStorefront API
Customer subscriptionsPOST /customer/subscriptionsPOST /customers/{email}/subscriptionscustomer
subscriptionContracts
Add customer subscriptionPOST /customer/contracts/{contract}/subscriptionPOST /customers/{email}/contracts/{contract}/subscriptionaddSubscription
Update subscription quantityPUT /customer/contracts/{contract}/subscription/{subscription}PUT /customers/{email}/contracts/{contract}/subscription/{subscription}updateSubscriptionQuantity
Change subscription addressPUT /subscription/addressPUT /subscription/addresschangeSubscriptionContractAddress
Change subscription intervalPUT /subscription/intervalPUT /subscription/intervalupdateSubscriptionInterval
Update subscription statusPUT /subscription/statusPUT /subscription/statusupdateSubscriptionStatus

Reset password flow

Reset password has different flows. Need to be described separately

ActionCheckout APIShop APIStorefront API
Send reset password emailPOST /password-reset-email
POST /password-reset-email/{email}
POST customers/{email}/password-reset-emailrequestPasswordResetEmail
Verify hashesNo matchesPOST /customer-password-reset-checkverifyResetPasswordHashes
Reset passwordPOST /password-resetPUT /customers/{email}resetPassword

Wishlist

ActionCheckout APIShop APIStorefront API
Customer wishlistGET /customer/wishlists/{wishlist}No matchescustomer
Add wishlist itemPOST /customer/wishlists/{wishlist}/items/{displayItem}No matchesaddWishlistItem
Remove wishlist itemDELETE /customer/wishlists/{wishlist}/items/{displayItem}No matchesremoveWishlistItem

Product and newsletter subscriptions

ActionCheckout APIShop APIStorefront API
Subscribe to back in stockPOST /back-in-stock-subscriptionPOST /customers/{email}/back-in-stock-subscriptionsubscribeToBackInStock
Subscribe to newsletterPOST /newsletter-subscription
POST /newsletter-subscription/{email}
POST /customers/{email}/newsletter-subscriptionsubscribeToNewsletter

To expose Customer.gender in an API using Session mode scopes in the Storefront API plugin, select it as an option. Note that the gender format in Storefront API differs from Checkout API and requires mapping.

Checkout APIStorefront API
MMALE
FFEMALE
XUNKNOWN

All attributes are exposed in the same format throughout the Storefront API. To align them with the Checkout API format, follow the attribute transformation rules.

Selection

ActionCheckout APIShop APIStorefront API
Add itemPOST /items/{item}
POST /items/{item}/quantity/{quantity}
POST /selections/{selection}/items/{item}
POST /selections/{selection}/items/{item}/quantity/{quantity}
addItem
Add flexible bundlePOST /items/bundles/{item}POST /selections/{selection}/bundlesaddFlexibleBundle
Add gift certificatePOST /items/gift-certificates/{giftCertificate}
POST /items/gift-certificates/{giftCertificate}/amount/{amount}
POST /selections/{selection}/gift-certificates/{giftCertificate}
POST/selections/{selection}/gift-certificates/{giftCertificate}/amount/{amount}
Not supported

Line modifications

ActionCheckout APIShop APIStorefront API
Increase line quantityPOST /lines/{line}
POST /lines/{line}/quantity/{quantity}
POST /selections/{selection}/lines/{line}
POST /selections/{selection}/lines/{line}/quantity/{quantity}
updateLine
Reduce line quantityDELETE /lines/{line}/quantity/{quantity}DELETE /selections/{selection}/lines/{line}/quantity/{quantity}updateLine
Reduce item quantityNot supportedDELETE /selections/{selection}/items/{item}/quantity/{quantity}updateLine
Delete lineDELETE /lines/{line}DELETE /selections/{selection}/lines/{line}deleteLine
Delete itemN\ADELETE /selections/{selection}/items
DELETE/selections/{selection}/items/{item}
N/A
Set line quantityPUT /lines/{line}/quantity/{quantity}PUT /selections/{selection}/lines/{line}/quantity/{quantity}updateLine
Set item quantityNot supportedPUT /selections/{selection}/items/{item}/quantity/{quantity}updateLine
Remove line subscription planDELETE /lines/{line}/subscription-planDELETE /selections/{selection}/lines/{line}/subscription-planremoveSubscriptionPlanFromLine
Update line subscription planPUT /lines/{line}/subscription-plan/{subscriptionPlan}PUT /selections/{selection}/lines/{line}/subscription-plan/{subscriptionPlan}updateLine

Selection modifications

ActionCheckout APIShop APIStorefront API
Change countryPUT /countries/{country}
PUT /countries/{country}/states/{state}
PUT /selections/{selection}/countries/{country}setCountryState
Update marketPUT /selectionPUT /selections/{selection}/markets/{market}setMarket
Update pricelistPUT /selectionPUT /selections/{selection}/pricelists/{pricelist}Automated by GeoIP, can be controlled via setCountryState
Change languagePUT /languages/{language}PUT /selections/{selection}/languages/{language}setLanguage
Set campaign sitePUT /campaign-siteNot supportedsetCampaignSite
Set affiliateNot supportedNot supportedsetAffiliate
Remove customerNot supportedDELETE /selections/{selection}/customersNot supported
Attach customerNot supportedPUT /selections/{selection}/customers/{customer}Not supported
Set VAT exemptNot supportedPUT /selections/{selection}/vat-exempt/{vatExempt}Not supported
Apply gift cardPOST /gift-card-applynot supportedapplyGiftCard

Remaining endpoints

ActionCheckout APIShop APIStorefront API
Create selectionCreated at first selection actionPOST /selectionsCreated at first selection action
Get selectionGET /selectionGET /selections/{selection}selection
Attach selectionPUT /selection/{selection}No matchessetSelection
Claim selectionNot supportedPOST /payment-links/{hash1}/{hash2}claimSelection

Line prices

Checkout APIShop APIStorefront API
priceEachAsNumberpriceEachAsNumberline.unitOriginalPrice - applied campaigns appliedPromotions.value.value * quantity
priceEachWithoutTaxAsNumberpriceEachWithoutTaxAsNumber(line.unitOriginalPrice - applied campaigns appliedPromotions.value.value * quantity) / tax percent
priceEachBeforeDiscountAsNumberpriceEachBeforeDiscountAsNumberline.unitOriginalPrice
priceEachReductionAsNumberpriceEachReductionAsNumberline.unitPriceReduction (includes campaign + voucher)
totalPriceBeforeDiscountAsNumbertotalPriceBeforeDiscountAsNumberline.originalLineValue
totalPriceAsNumbertotalPriceAsNumberline.lineValue + line vouchers appliedPromotions.value.value * line quantity
totalPriceAfterCampaignAsNumbertotalPriceAfterCampaignAsNumberline.originalLineValue - applied campaigns * line quantity
totalPriceAfterDiscountAsNumbertotalPriceAfterDiscountAsNumberline.lineValue
anyDiscountanyDiscountline.hasDiscount
taxPercenttaxPercentline.taxPercent

Note: Unlike Checkout API and Shop API, which only include campaign promotions in line prices, the Storefront API includes all applied promotions. Therefore, to match the previous price format, you will need to calculate certain values independently.

Catalog

Queries

ActionCheckout APIShop APIStorefront API
List productsGET productsGET productsdisplayItems
Search productsPOST productsPOST products/searchdisplayItems
Filter productsPOST products POST products/filter, GET products/{filter}/{value} displayItems
Product DetailsPOST product/{product} POST products displayItem

Brands

Queries

ActionCheckout APIShop APIStorefront API
List brandsGET brands GET brands brands

Collections

Queries

ActionCheckout APIShop APIStorefront API
List collectionsGET collections GET collections collections
Collection detailsGET collections/{collection} collections

Warehouses

Queries

ActionCheckout APIShop APIStorefront API
List WarehousesGET warehouses GET warehouses Not supported

Checkout migration

Checkout details

ActionCheckout APIShop APIStorefront API
Set shipping methodPUT /shipping-methods/{shippingMethod}PUT/selections/{selection}/shipping-method/{shippingMethod}setShippingMethod
Set payment methodPUT /payment-methods/{paymentMethod}PUT /selections/{selection}/payment-methods/{paymentMethod}setPaymentMethod
Payment fieldsPUT /payment-fieldsPOST /selections/{selection}/payment-fields
PUT /selections/{selection}/checkout-fields
setAddress
handleWidgetEvent

Vouchers

ActionCheckout APIShop APIStorefront API
Add voucherPOST /vouchersPOST /selections/{selection}/vouchers/{voucher}addVoucher
Add URI voucherPOST /vouchersPOST /selections/{selection}/voucher-uri/{voucher}lookupUri
Remove voucherDELETE /vouchers
DELETE /vouchers/{voucher}
DELETE /selections/{selection}/vouchers
DELETE /selections/{selection}/vouchers/{voucher}
removeVoucher
Remove URI voucherDELETE /vouchers
DELETE /vouchers/{voucher}
DELETE /selections/{selection}/voucher-uri/{voucher}removeVoucher

Gift cards

ActionCheckout APIShop APIStorefront API
Apply gift cardPOST /gift-card-applyapplyGiftCard

Ship from Store

ActionCheckout APIShop APIStorefront API
Set allocation rulePUT /allocation-rule/{id}PUT /selections/{selection}/allocation-rule/{allocationRule}setAllocationRule
Set Brick and mortarPUT /brick-and-mortar/{id}PUT /selections/{selection}/brick-and-mortar/{brickAndMortar}setBrickAndMortar
Fulfilment checkPOST /fulfillment-checkPOST /selections/{selection}/fulfillment-checkfulfillmentCheck

Payment process

ActionCheckout APIShop APIStorefront API
Payment instructionsPOST /paymentPOST /selections/{selection}/paymentpaymentInstructions
Payment resultPOST /payment-resultPOST /selections/{selection}/payment-resultpaymentResult

Remaining

ActionCheckout APIShop APIStorefront API
Address searchPOST /address-searchPOST /payment-methods/{paymentMethod}/address-searchNot supported
ReceiptGET /receiptGET /selections/{selection}/receiptorder

Storefront API doesn’t support address search.

Totals

Storefront API provides selection totals under selection.checkout.totals. This list contains the selection summary per type.

Checkout APIShop APIStorefront API
itemsTotalPriceAsNumberitemsTotalPriceAsNumberITEMS_SUBTOTAL + discounts applied on lines.
totalDiscountPriceAsNumbertotalDiscountPriceAsNumberDISCOUNT + CREDIT
shippingPriceAsNumbershippingPriceAsNumberSHIPPING
handlingCostAddedToShippingPricehandlingCostPriceAsNumberHANDLING
totalQuantitytotalQuantitySum of line.quantity
taxDeductedAsNumbertaxDeductedAsNumberTAX_DEDUCT.taxPercent
taxAddedAsNumbertaxAddedAsNumberTAX_ADDED.taxPercent
taxPercenttaxPercentINCLUDING_TAX.taxPercent
grandTotalPriceAsNumbergrandTotalPriceAsNumberGRAND_TOTAL
grandTotalPriceTaxAsNumbergrandTotalPriceTaxAsNumberINCLUDING_TAX or TAX_ADDED