Hi everyone,

Nopcommerce using cookies to keep customer guid.
In _workcontext.CurrentCustomer is check if need to create new customer or not.

In this code :
  protected virtual string GetCustomerCookie()
        {
            return _httpContextAccessor.HttpContext?.Request?.Cookies[CUSTOMER_COOKIE_NAME];
        }


So to prevent nopcommerce from creating new guest customer on api request :
1. Create customer and name it like ( APICustomer ) to use its Guid in requests.
2. Add cookie to your Api request :
    

requestMessage.Headers.Add("Cookie", ".Nop.Customer=5E56A566-D0E5-4C3C-8788-9D2E0156D392; expires=Wed, 18-Mar-2020 14:43:34 GMT; path=/; HttpOnly");




Nopcommerce version 4.0