{"id":16013,"date":"2023-02-13T06:59:51","date_gmt":"2023-02-13T06:59:51","guid":{"rendered":"https:\/\/ecommerce.folio3.com\/blog\/?p=16013"},"modified":"2025-10-24T09:30:52","modified_gmt":"2025-10-24T09:30:52","slug":"salesforce-headless-commerce-api","status":"publish","type":"post","link":"https:\/\/ecommerce.folio3.com\/blog\/salesforce-headless-commerce-api\/","title":{"rendered":"This Headless Commerce API Lets Shoppers Stay Logged In for 90 days. Here is How It Works."},"content":{"rendered":"<p><span style=\"font-weight: 400;\">These days, consumers can make purchases via various channels, including desktop computers, tablets, smartphones, and even Internet of Things (IoT) devices.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The original goal of headless commerce was to free up developers to build more comprehensive eCommerce platforms that offered a more satisfying experience for site users. As a result, it&#8217;s much easier to move customers down the sales funnel through <\/span><b>Salesforce commerce cloud development.<\/b><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, sessions were limited to 30 minutes in length after the last log-in. Developers, merchants, and e-commerce customers worldwide face the difficulty of keeping a user logged in for an extended period while maintaining a secure session.<\/span><\/p>\n<p><b>Salesforce Commerce Cloud<\/b><span style=\"font-weight: 400;\"> has<\/span><span style=\"font-weight: 400;\"> resolved this issue for businesses with new Shopper Login and API Access Service (SLAs). <\/span><b>Salesforce headless commerce API<\/b><span style=\"font-weight: 400;\"> empowers <\/span><b>Salesforce Commerce Cloud development <\/b><span style=\"font-weight: 400;\">companies to implement higher levels of safety and reliability in their headless commerce development.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">What You Need to Know About Shopper Login API<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Shopper API and service provide secure access to the Shopper APIs with <\/span><b>Salesforce Commerce Cloud Support<\/b><span style=\"font-weight: 400;\">, which acts as a scalable authentication and authorization solution. It allows businesses to offer features that let customers sign in via federation with their preferred Identity Provider (IDP).\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The advent of OAuth 2.0-based login APIs is crucial to SLAS since it implements the pattern to refresh tokens, enabling a customer to log in and utilize that keeps you signed in for up to 90 days.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here&#8217;s where Shopper Login Access and API Access Service come in handy; it&#8217;s a cinch to use and lets you efficiently provide several login options to your customers, both of which boost convenience and the length of their session. It&#8217;s a library of APIs that gives headless applications safe access to shopper APIs <\/span><b>Salesforce Commerce Cloud.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The hopper Login Access and API Access Service was made possible using OAuth 2.0-based login APIs. Because of this, a shopper can keep their session active for 90 days instead of only 30. Do you find this intriguing? So, let me explain how it all goes down.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This enterprise-level authentication and authorization system safeguards the use of the Commerce platform&#8217;s Retailer Application Programming Interfaces (APIs).\u00a0<\/span><\/p>\n<p><b>Salesforce commerce cloud development <\/b><span style=\"font-weight: 400;\">lets businesses provide features that let customers sign in via federation with their preferred Identity Provider (IDP). If you implement this feature, your customers can use the same credentials they use to access their social media or search accounts to access your website.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">With the help of<\/span><b> Salesforce Commerce Cloud implementation <\/b><span style=\"font-weight: 400;\">with this API, users can use a single set of credentials in various settings (for instance, Commerce Cloud vs. a Community Portal). OpenID-compliant social networks and search engines like Facebook and Google can be used in tandem with SLAs.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Extending a session for up to 90 days is quite convenient. However, 90 days in a mobile application environment makes more sense from a security perspective than on a web browser since using a public or shared computer could expose user details for longer than desirable. After discussing it with your <\/span><b><a href=\"https:\/\/ecommerce.folio3.com\/salesforce-commerce-cloud-development\/\">Salesforce Commerce Cloud development<\/a>,<\/b><span style=\"font-weight: 400;\"> security, and legal teams, decide.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Do yo<\/span><span style=\"font-weight: 400;\">u need the Salesforce headless commerce API?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Truthfully, you could already perform the aforementioned with SFRA and SiteGenesis. The system currently supports all of the previous forms of login access, including<\/span><b> <a href=\"https:\/\/ecommerce.folio3.com\/salesforce-b2b-commerce-integration\/\"><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;salesforce b2b commerce cloud partner&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:22915,&quot;3&quot;:{&quot;1&quot;:0},&quot;4&quot;:{&quot;1&quot;:2,&quot;2&quot;:65280},&quot;10&quot;:2,&quot;11&quot;:4,&quot;14&quot;:{&quot;1&quot;:2,&quot;2&quot;:2236962},&quot;15&quot;:&quot;Poppins&quot;,&quot;17&quot;:1}\">salesforce b2b commerce cloud partner<\/span><\/a>.<\/b><span style=\"font-weight: 400;\"> However, they have no further practical uses. To use these with them, you&#8217;ll need to develop a separate implementation for every platform, including endless aisle, kiosk, and mobile apps.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Alternatively, Shopper Login Access and API Access Service is a Salesforce headless commerce API that any of your channels may use, regardless of whether or not they are done with <\/span><b>salesforce commerce cloud integration.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Besides the possibility of extending the session period up to 90 days, it allows you to take the edge of the Single Sign-On feature. It is simpler to move sessions between channels if you are already using SFRA or SiteGenesis on <a href=\"https:\/\/ecommerce.folio3.com\/salesforce-b2c-commerce\/\">Salesforce B2C Commerce Cloud developer<\/a>.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Benefi<\/span><span style=\"font-weight: 400;\">ts of Salesforce Headless Commerce API<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Before using this set of APIs, you should know how this integration will benefit you in the long run.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Advantages for Programmers<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\"><a href=\"https:\/\/www.wiz.io\/academy\/api-security-solutions\" target=\"_blank\" rel=\"noopener\">Secure API access<\/a> should be implemented to avoid security risks like cross-tenant data access and exposing sensitive data during promotional periods.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">It is possible to adopt Commerce APIs in stages using the same SLAS access token for the latest <\/span><b>Salesforce Commerce Cloud<\/b><span style=\"font-weight: 400;\"> APIs (SCAPIs) and the existing Open Commerce APIs (OCAPIs) in a given headless application.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Headless applications of all types, including full-stack web apps, server-side BFF apps, mobile\/native apps, and single-page web apps) should have a secure login mechanism for accessing the API (public clients).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Put into practice authentication standards developed for your sector (finance, telco, insurance).<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">Advantages to Consumers<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Use an external identifier service and log in (for instance, Google, Facebook, and Auth0).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Salesforce commerce cloud integration,<\/b><span style=\"font-weight: 400;\"> Experience Cloud, and other Salesforce services into your existing site with a single sign-on.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enjoy a more tailored shopping journey. To use the Commerce Einstein APIs for tracking user behavior, the SLAS API returns a unique identification for each guest and registered user.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Keep your shopping basket open and your session active for longer.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Use the Shopper Application Programming Interfaces (APIs) provided by <\/span><a href=\"https:\/\/ecommerce.folio3.com\/salesforce-commerce-cloud-support\/\"><b>Salesforce Commerce Cloud Support services<\/b><\/a><span style=\"font-weight: 400;\"> to access their powered services (for commerce API and OCAPI).<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/ecommerce.folio3.com\/blog\/wp-content\/uploads\/2023\/02\/benfits-of-Shopper-Login-API.png\" \/><\/p>\n<h2><span style=\"font-weight: 400;\">The Shopper Login API: How Does It Function?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Accessing a wide range of headless applications is made easy with SLAS&#8217;s scalable login and API access. In <\/span><b>Salesforce commerce cloud development,<\/b><span style=\"font-weight: 400;\"> there are three stages to this procedure:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The shopper registers using an external identity provider (Google and Auth0) or an internal (Salesforce Commerce B2C system).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The app is issued a token with complete access to the Shopper API.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Thirdly, the token is a key to accessing any B2C Commerce Shopper APIs the app supports.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">For various headless applications, SLAS employs standard OAuth 2.0-based login procedures. Enforcing customer credentials for guest users, an authorization code flow for registered consumers, federating login to the external IDP, and authorization code pkce for signing buyers. It\u2019s then forwarded into the Business to the Customer system. These all are necessary for web apps with server-side back-end for front-end (BFF), where a client secret can be securely stored on a front-end.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/ecommerce.folio3.com\/blog\/wp-content\/uploads\/2023\/02\/authorization-code-pkce-flow.png\" \/><\/p>\n<p><span style=\"font-weight: 400;\">The authorization code pkce flow must be implemented in various forms for anonymous and known users to work with single-page applications (SPAs) and mobile\/native applications. The developer guide goes into greater depth into these processes.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">By making the SLAS GA in April 2021, <\/span><b>Salesforce Commerce Cloud Support<\/b><span style=\"font-weight: 400;\"> has given devs the tools they need to upgrade client implementations to accommodate two types of headless apps:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Web apps that rely on a server-side backend or BFF and have their clients run in isolation.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Public-facing mobile\/native apps or single-page web apps. This second pattern will be used by everyone who buys our PWA Kit.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">In each design, the user must actively go through the login process. Moreover, there is interest in enabling the third pattern, trusted system login, on a shopper&#8217;s behalf.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Unlike<\/span><b> Salesforce B2B Commerce Integration,<\/b><span style=\"font-weight: 400;\"> Customers do not manually enter their credentials into the B2C e-commerce system in this setup. Instead, a shopper&#8217;s personal information is requested from or updated by a reliable app.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This pattern allows the authorized app to access and modify the shopper&#8217;s profile information, shopping cart contents, and order history. To certify with the B2C Commerce system as a relied app on behalf of shoppers, this flow is generally used by developers who attest shoppers with the help of a third-party IDP.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The reliable app could be hosted locally or remotely. Applications like Experience Cloud and Salesforce Order Management are examples of trusted internal systems. For the consumer&#8217;s benefit, &#8220;external trusted applications&#8221; can be any third-party applications that communicate with the <\/span><b><a href=\"https:\/\/ecommerce.folio3.com\/salesforce-commerce-cloud-implementation\/\">Salesforce Commerce Cloud implementation<\/a>.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">In the case of<\/span><a href=\"https:\/\/ecommerce.folio3.com\/salesforce-commerce-cloud-migration\/\"><b> Salesforce Commerce Cloud Migration<\/b><\/a><span style=\"font-weight: 400;\">, sellers can easily access the customers\u2019 login details. Moreover, a <\/span><a href=\"https:\/\/ecommerce.folio3.com\/salesforce-commerce-cloud-consultants\/\"><b>salesforce commerce cloud consultant<\/b><\/a><span style=\"font-weight: 400;\"> can also help you with API settings.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">How to Utilize this API In A Monolithic Setup?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Using SFRA, you may quickly improve your consumers&#8217; online purchasing experience by adding new features and<\/span><a href=\"https:\/\/ecommerce.folio3.com\/salesforce-commerce-cloud-optimization\/\"><b> Salesforce Commerce Cloud Optimization<\/b><\/a><span style=\"font-weight: 400;\">. Use the new merged feature cartridge (plugin cartridge merge) to install and use multiple supplemental SFRA features in your present setup without the assistance of a programmer.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It&#8217;s also simple to turn off individual functions if necessary. The cartridge integrates the benefits of Shopper Login Access and API Access Service into SFRA&#8217;s monolithic architecture, turning it into a real headless commerce player.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, you should be aware of the following potential downsides:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Since the cartridge makes three or four more remote API calls, using this API may slow down your site. However, you have nothing to worry about; like all<\/span><b> Salesforce B2B Commerce Integration<\/b><span style=\"font-weight: 400;\">, this<\/span><b> salesforce commerce cloud integration<\/b><span style=\"font-weight: 400;\"> is subject to the same performance and uptime standards.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">4 remote APIs(2 SCAPI and 2 OCAPI calls) are used to get the login and registration through Shopper Login Access and API Access Service to work.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">There are now just 4 API requests you can make throughout the login process. According to an update, 5 API calls are needed during registration in some situations, which counts for a significant part of your \u201cbudget.\u201d<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can continue to utilize SiteGenesis, but it won\u2019t be plug-and-play anymore, as with SFRA. The code is straightforward, so you can use it as a reference to build the customized version of SiteGenesis you need.<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/ecommerce.folio3.com\/blog\/wp-content\/uploads\/2022\/09\/SalesForce-commerce-development.png\" \/><\/p>\n<h2><span style=\"font-weight: 400;\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Both Shopper Login Access and API Access Service have the potential to assist in extending user sessions within a protected setting. This <\/span><b>Salesforce headless commerce API<\/b><span style=\"font-weight: 400;\"> is capable of working with many channels.\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><em><span style=\"text-decoration: underline;\"><strong>Read Also <a href=\"https:\/\/ecommerce.folio3.com\/blog\/bigcommerce-api-documentation\/\">BigCommerce API Documentation<\/a><\/strong><\/span><\/em><\/p>\n<p><span style=\"font-weight: 400;\">Users can utilize the Single Sign-in functionality and extend the session length to a maximum of ninety days. This could mean working in an all-in-one feature cartridge for people using a monolithic setup. This cartridge unlocks several additional optional SFRA features without the assistance of a developer.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This particular feature of <\/span><b>Salesforce Commerce Cloud implementation<\/b><span style=\"font-weight: 400;\"> has helped customers and sellers efficiently manage the log-in feature.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>These days, consumers can make purchases via various channels, including desktop computers, tablets, smartphones, and even Internet of Things (IoT) devices.\u00a0 The original goal of headless commerce was to free up developers to build more comprehensive eCommerce platforms that offered a more satisfying experience for site users. As a result, it&#8217;s much easier to move<\/p>\n","protected":false},"author":1,"featured_media":16171,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[51],"tags":[55],"class_list":{"0":"post-16013","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-salesforce-commerce-cloud","8":"tag-salesforce-commerce-cloud-development"},"acf":[],"featured_image_data":{"src":"https:\/\/ecommerce.folio3.com\/blog\/wp-content\/uploads\/2023\/02\/This-Headless-Commerce-API-lets-shoppers-stay-logged-in-for-90-days.-Here-is-how-it-works-1.png","alt":"This Headless Commerce API lets shoppers stay logged in for 90 days. Here is how it works (1)","caption":""},"_links":{"self":[{"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/posts\/16013"}],"collection":[{"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/comments?post=16013"}],"version-history":[{"count":0,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/posts\/16013\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/media\/16171"}],"wp:attachment":[{"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/media?parent=16013"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/categories?post=16013"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ecommerce.folio3.com\/blog\/wp-json\/wp\/v2\/tags?post=16013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}