docs
  1. SCAYLE Resource Center
  2. Developer Guides
  3. Customer
  4. Customer States

Customer States

General

In SCAYLE, the Customer status resource holds information about the status of a customer's account.

There are two options in shop’s customer status settings:

  • isActive - Customer’s account can be set to active or inactive state. Inactive customer accounts are blocked accounts due to bad logins, password resets, etc. Basically, this setting is used to block unwanted customer accounts.
  • isGuestCustomer - This status defines the type of customer account. Customers can choose to either sign into their account or check out as a guest.

Admin API

Update customer status

When updating a customer status, you have to specify the customer ID or customer reference key.

param nametyperequireddescription
isActivebooleantrueDeclares whether the customer account is active or not
isGuestCustomerbooleantrueDeclares if the customer has an account or not
let response = await adminApi.apis.Customers.updateCustomerStatus(
  { shopKey: shopKey, countryCode: countryCode, customerIdentifier: customerIdentifier },
  { requestBody: customerStatus }
);
let createdCustomerStatus = response.body;

Update a Customer

This method can be used to update an existing customer.

Note that a reference key update is only possible via a dedicated method.

Method Signature

let response = await client.apis.Customers.updateCustomer({shopKey: shopKey, countryCode: countryCode, customerIdentifier: customerIdentifier}, {requestBody: customer});
let customer = response.body;

Update customer's email

let response = await adminApi.apis.Customers.getCustomer({shopKey: 'ms', countryCode: 'DE', customerIdentifier: 1});
let customer = response.body;

customer.email = "[email protected]";

response = await adminApi.apis.Customers.updateCustomer({shopKey: 'ms', countryCode: 'DE', customerIdentifier: customer.id}, {requestBody: customer});
customer = response.body;

console.log(customer.email);

Get a customer status

This endpoint is not shop country scoped, but the shop country, identified by shopKey and countryCode, is still needed.

When retrieving a customer status, you must specify the customer ID or customer reference key.

param nametyperequireddescription
isActivebooleantrueDeclares whether the customer account is active or not
isGuestCustomerbooleantrueDeclares if the customer has an account or not
let response = await adminApi.apis.Customers.getCustomerStatus({shopKey: 'ms', countryCode: 'DE', customerIdentifier: "key=my-key"});
let customerStatus = response.body;

console.log(customerStatus);