Trying "create-cash-customer" with API using PHP on Linux returns invalid hash

Has anyone been successful at generating a valid hash with PHP for creating a cash customer / user via the create-cash-customer API? I am running PHP on a Linux system and have been unable to create a valid hash.

Hi Don,
I think we need a little more context. What do you mean by a cash customer? Is this for Epicor Kinetic?

1 Like

Thanks for the reply, I am writing an interface between a WordPress site and BisTrack / WebTrack. I am using the Epicor.BisTrack.WebStoreAPI.Catalog. It that catalog is the “create-cash-customer” API. In order to create a cash customer with a WebTrack user I have to supply the password hash. I have not been able to find an algorithm that works. I am running PHP 8.1

1 Like

Epicor uses a DLL for creating a hash and the is an example of how is is done at Additional Password Validation - #10 by hkeric.wci . Unfortunately DLL don’t run on Linux. Base on the sparse documentation I have found, I have some very simple PHP code that I have been modifying to try to produce a compatible hash on Linux.

$br=‘
’;
$salt=random_bytes(8);
//$salt=‘$b^strfh’;
$pwd = ‘donabcdefgh’;
$pwdSub=$salt.$pwd;
$pwd_hashed= hash(‘sha256’, $pwdSub);
echo '$salt: '.$salt.$br;
echo '$pwd_hashed: '.$pwd_hashed.$br;
echo '$pwd_hashed base64_encode: '.base64_encode($pwd_hashed).$br;

I have been trying the different hashes this produces using the “create-cash-customer” API in Swagger. No luck!
Unfortunately, I don’t have access to see how the DLL is building the hash.

If anyone has any suggestions on how to resolve this it will be greatly appreciated.

This project will be for not if I can’t come up with a solution.

Don, which version of Epicor ERP are you on? Your profile says you’re on 6.5.656, which is not a current Kinetic ERP version currently hosted by Epicor.

1 Like

Man I don’t miss php. Glad I forgot most of it. :rofl:

1 Like

Did you look at the last post by @hkeric.wci in that thread?

1 Like

We are not on it yet. Scheduled to be on it in December.

2023.2?

If so, then you have Epicor Functions. This means you can execute the same methods at the server and have all the libraries you need. This will simplify your API call and probably make it faster since you won’t be making so many round trips.

I don’t think your going to find the help you need here.

We don’t even have a section for it.

I don’t think that would help as the API is the only access that the website would have to BisTrack. There is no way I know to execute Epicor Functions from the website.

Maybe if we float up the stack a bit and you can explain the business (not technical) problem you’re trying to solve. What is the integration touch point of BisTrack to Kinetic? Or if there no integration involved, then Kevin is right. We may not be able to help you here.

We are a building materials retailer currently with 6 stores. We use BisTrack for our POS, accounting and inventory management. We have had an internet presence for a long time but, only as a source of information. We are now working on a full ecommerce implementation. All of the interfacing between our website and BisTrack / WebTrack has been done to this point via the “Epicor BisTrack WebStoreAPI” functions. All of it is working very well including creating new BisTrack customers but, I can not create WebTrack users because of the hash issue. I need to create WebTrack users in order to place quotes and fulfill orders. Thanks for the help.

Are you trying to replace the WooCommerce piece here?

Not trying to replace WooCommerce, just adding to it.

Looking at the diagram in the link that you posted I would say that the part represented by the ?INTEGRATOR is what best describes what I am working on.

Yes. I’m rather surprised that’s not a part of the Epicor solution - unless that company is a certified Epicor provider of some kind.