Registering a Storefront
Before you can manage the integration parameters of an online store in your Customer's Canvas account, you need to enter some information about it.
If needed, your Customer's Canvas account allows you to organize simultaneous work with several online stores, providing a single platform for managing product designs and flexible customization of personalization parameters.
Adding a Storefront
To add information about a new store:
- Log in to your Customer's Canvas account using BackOffice.
- On the main menu, click Settings.
- Click the Integration tab and then click Add new.
- Type in the store name and select the Custom integration type.
As already noted, Customer's Canvas supports dedicated schemes for integration with online stores based on popular e-commerce platforms. In this scenario, we consider the most complex integration type, which involves performing all the integration work by oneself.
Registering of a new store is an important procedure that is always performed manually by users in BackOffice. You cannot register one through the API.
Each online store has its customers. To store and process their personalized designs, you must register these customers in your Customer's Canvas account. As a result of registration, private data storage for a customer is created with special data access restrictions.
During the personalization process, customers can upload their images to the private storage. At the same time, the authorization policy of Customer's Canvas provides the necessary isolation of the private data of different customers.
Unlike the registration of an online store, the registration of customers must be performed using the Storefront API.
Before your customer starts the personalization process, you must first register the customer in your Customer's Canvas account and prepare their private storage. In real life, there are two different approaches, which we will now describe in more detail.
Product Personalization by an Identified Customer
Let's assume that the customer, having opened a page of your online store, first logged into his account, and only after that proceeded to select a product for personalization.
In this case, by the time they personalize the product, you already have the permanent ID of the customer's account in the online store. Just before starting the personalization process, you can check whether a customer with this ID is registered in your Customer's Canvas account and, if needed, register and create private storage.
This approach allows your customer to use their data, previously placed in the private storage, when personalizing products.
Product Personalization by an Anonymous Customer
Consider a situation where the customer immediately selects products for personalization, postponing the authorization until the payment is made.
In this case, before starting the personalization process, you need to register a temporary anonymous user and create separate private storage based on the session ID.
When the customer finishes personalizing and proceeds to payment, they will log in to your online store account. At the stage of saving the personalization results, you can check whether a customer with such an ID is registered in your Customer's Canvas account and, if needed, register and create new private storage.
After that, you can transfer the data uploaded during the anonymous personalization session to the private storage that corresponds to the customer ID.
If this customer returns for another purchase and logs in before the personalization process, they can access the data uploaded in the current anonymous session.
Data Access Using the Storefront API
Let's take a look at Storefront API as well as integration entities that provide programmatic access to information about the online store and its customers.
The dedicated integration entity Storefront is responsible for storing information about online stores connected to your Customer's Canvas account.
You can use the endpoint Storefronts_GetAll to get the available information about all online stores connected to a Customer's Canvas account.
Note that you need to store either the ID or name of the returned model on the side of the online store to manage the integration parameters of this store.
The entity StorefrontUser allows you to manage the customers of an online store.
You can use the endpoint StorefrontUsers_Create to register a user and create private storage. When registering a user, you must explicitly specify whether the user is anonymous.
You can check that the customer already exists using the endpoint StorefrontUsers_Get.
The key to access the private storage is a customer token. You can get it using the endpoint StorefrontUsers_GetToken. The customer token represents a classic jwt-token prepared by the Customer's Canvas authorization module. You must pass this token to the personalization tool to work with the data of a specific customer.
To transfer the data from temporary storage created during the anonymous product personalization to private storage linked to the customer ID in the online store, you can use the endpoint StorefrontUsers_MergeAnonymous. Data transfer is only possible from an anonymous user to a permanent user.
In the next topic, we will look at how you can associate online store products with Customer's Canvas designs.