How to Build a Custom E-commerce Integration With Clover
Jacob Naryan - Full-Stack Developer
Posted: Fri Mar 29 2024
Last updated: Fri Mar 29 2024
Clover’s documentation is probably the worst for any POS or payment provider I have ever seen. It’s filled with conflicting information, complex diagrams, and generally over-complicates a lot of things that should be pretty standard. I have a lot of experience integrating custom payment and e-commerce solutions and Clover is by far the hardest integration I’ve ever done.
After hours of reading quite literally the entire documentation, what felt like all of the community discussion boards, and calling customer support I still did not have an answer on the correct way to build a custom e-commerce integration with Clover.
That being said, once I found the correct way to do a custom integration with Clover using the SDKs and hosted iframe, I was baffled by how easy it actually was (though you’d never figure that out by reading the documentation). So here it is, the correct way to build a custom e-commerce integration with Clover using the hosted iframe and the API or the SDKs.
1. DON’T CREATE A DEVELOPER ACCOUNT!
Unless you need to use web hooks this is not needed at all. If you read the documentation you’re lead to believe you need to have an approved developer account and an approved production app before you can integrate with Clover merchants, get an your auth token, and your PAKMS key. This is not true, if you are doing a simple e-commerce integration for one merchant you just need an E-commerce API public and secret token also known as the PAKMS and auth token.
2. Where to Get Your PAKMS and Auth Token
The documentation does not tell you at all how to use the e-commerce public and secret token, which are actually the PAKMS key (used for the hosted iframe) and the auth token (used to authenticate all your api calls either through REST API or SDK). But fear not, I have figured it out so you don’t have to.
Sign in to your merchant account, either your test merchant account or a production account. Click ‘Accounts and Setup’ on the left navigation. Once there, click ‘Ecommerce API Tokens’. Then simply create a token and select the integration type as ‘IFRAME + SDK’
3. Use Your Keys
Now that you have your keys use them like this. The public token is your PAKMS key which is used when using the hosted IFRAME.
const clover = new Clover("YOUR PUBLIC TOKEN HERE");
The private token is your auth token and should not be shared or used on the client side. This is exclusively for your backend. If you’re using the Node.js SDK you can authenticate your SDK like this:
const sdk = require("api")("@clover-platform/v3#gng1klnjtn9av");
sdk.auth("YOUR PRIVATE TOKEN HERE");
And that’s all there is to it! With this you should be able to build your custom integration with Clover by following the documentation for using the hosted iframe plus the SDK.