Back to Website
Show / Hide Table of Contents

Registering customers

  • 6 minutes to read

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 this registration, private data storage for a customer is created with special data access restrictions.

During the personalization process, customers can upload their images to private storage. At the same time, the authorization policy of Customer's Canvas provides the necessary isolation of the private data of different customers.

Managing storefront users

The entity storefront user 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. Private storage of an anonymous user is temporary and must be merged with the regular storefront user account when this user logs in, as described below.

For example, if the storefront ID is 12, you can register a new user like this.

  • cURL
  • HTTP
  • C#
  • TS
  • PHP
curl -X \
  POST "https://api.customerscanvashub.com/api/storefront/v1/storefront-users?storefrontId=12" \
  -H  "accept: text/plain" \
  -H  "content-type: application/json-patch+json" \
  -H  "Authorization: Bearer <TOKEN>" \
  -d  "{'storefrontUserId': 'john@wood.com', 'isAnonymous': true}"
POST https://api.customerscanvashub.com/api/storefront/v1/storefront-users?storefrontId=12
{
    'storefrontUserId': 'john@wood.com',
    'isAnonymous': true
}
var storefrontId = 12; // Set a real storefront ID here
var body = "{'storefrontUserId': 'john@wood.com', 'isAnonymous': true}"; // Set a user ID and the anonymous flag
var storefrontUser = await storefrontApiClient.CreateAsync(storefrontId, null, body);
var storefrontId = 12; // Set a real storefront ID here
var body = "{'storefrontUserId': 'john@wood.com', 'isAnonymous': true}"; // Set a user ID and the anonymous flag
var storefrontUser = _storefrontApiClient.create(storefrontId, null, body);
$storefrontId = 12; // Set a real storefront ID here
$body = "{'storefrontUserId': 'john@wood.com', 'isAnonymous': true}"; // Set a user ID and the anonymous flag
$storefrontUser = $storefrontApiClient->storefrontUsersCreate($storefrontId, null, $body);

If a user with the specified identifier already exists, the error code 409 will be returned. If the result is successful, a user ID will be returned.

You can check that the customer already exists using the endpoint StorefrontUsers_Get.

  • cURL
  • HTTP
  • C#
  • TS
  • PHP
curl -X \
  GET "https://api.customerscanvashub.com/api/storefront/v1/storefront-users/john%40wood.com?storefrontId=12" \
  -H  "accept: text/plain" \
  -H  "Authorization: Bearer <TOKEN>"
GET https://api.customerscanvashub.com/api/storefront/v1/storefront-users/john%40wood.com?storefrontId=12
var storefrontId = 12; // Set a real storefront ID here
var userID = "john@wood.com"; // Set a user ID  here
var storefrontUser = await storefrontApiClient.GetAsync(userID, null, storefrontId);
var storefrontId = 12; // Set a real storefront ID here
var userID = "john@wood.com"; // Set a user ID  here
var storefrontUser = _storefrontApiClient.get(userID, null, storefrontId);
$storefrontId = 12; // Set a real storefront ID here
$userID = "john@wood.com"; // Set a user ID  here
$storefrontUser = $storefrontApiClient->storefrontUsersGet($userID, null, $storefrontId);

Once you receive the response, you need to check its status code. If the code is 200, the user was found in the storefront.

The key to access private storage is a customer token. You can get it using the endpoint StorefrontUsers_GetToken. The customer token represents a classic JSON Web Token (JWT) 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.

  • cURL
  • HTTP
  • C#
  • TS
  • PHP
curl -X \
  GET "https://api.customerscanvashub.com/api/storefront/v1/storefront-users/token?storefrontUserId=john%40wood.com&storefrontId=12" \
  -H  "accept: text/plain" \
  -H  "Authorization: Bearer <TOKEN>"
GET https://api.customerscanvashub.com/api/storefront/v1/storefront-users/token?storefrontUserId=john%40wood.com&storefrontId=12
var storefrontId = 12; // Set a real storefront ID here
var userID = "john@wood.com"; // Set a user ID  here
var userToken = await storefrontApiClient.GetTokenAsync(userID, storefrontId);
var storefrontId = 12; // Set a real storefront ID here
var userID = "john@wood.com"; // Set a user ID  here
var userToken = _storefrontApiClient.getToken(userID, storefrontId);
$storefrontId = 12; // Set a real storefront ID here
$userID = "john@wood.com"; // Set a user ID  here
$userToken = $storefrontApiClient->storefrontUsersGetToken($userID, $storefrontId);

To transfer 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. Customer's Canvas only supports data transfer from an anonymous user to a permanent user.

For example, if an anonymous user was registered with the ID user-123, you can merge their storage with storage of the regular user john@wood.com as follows:

  • cURL
  • HTTP
  • C#
  • TS
  • PHP
curl -X \
  POST "https://api.customerscanvashub.com/api/storefront/v1/storefront-users/merge-anonymous?storefrontId=12" \
  -H  "accept: text/plain" \
  -H  "content-type: application/json-patch+json" \
  -H  "Authorization: Bearer <TOKEN>" \
  -d  "{'anonymousStorefrontUserId': 'user-123', 'regularStorefrontUserId': 'john@wood.com'}"
POST https://api.customerscanvashub.com/api/storefront/v1/storefront-users/merge-anonymous?storefrontId=12
{
  'anonymousStorefrontUserId': 'user-123',
  'regularStorefrontUserId': 'john@wood.com'
}
var storefrontId = 12; // Set a real storefront ID here
var body = "{'anonymousStorefrontUserId': 'user-123', 'regularStorefrontUserId': 'john@wood.com'}"; // Set IDs of an anonymous and regular users
var mergeResult = await storefrontApiClient.MergeAnonymousAsync(storefrontId, null, body);
var storefrontId = 12; // Set a real storefront ID here
var body = "{'anonymousStorefrontUserId': 'user-123', 'regularStorefrontUserId': 'john@wood.com'}"; // Set IDs of an anonymous and regular users
var mergeResult = _storefrontApiClient.mergeAnonymous(storefrontId, null, body);
$storefrontId = 12; // Set a real storefront ID here
$body = "{'anonymousStorefrontUserId': 'user-123', 'regularStorefrontUserId': 'john@wood.com'}"; // Set IDs of an anonymous and regular users
$mergeResult = $storefrontApiClient->storefrontUsersMergeAnonymous($storefrontId, null, $body);

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 the 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 your 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 them and create their private storage.

This approach allows your customer to use their data, which was previously placed in 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 them and create new private storage.

After that, you can transfer the data uploaded during the anonymous personalization session to 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.


Further Reading

  • Learn how to edit product variants using this API.
  • Explore how to register storefronts in your Customer's Canvas account.
  • Dive into Storefront API reference.
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2025 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback