I’m really hoping I can get some basic help with some coding using the current PHP SDK. I’ve got quite a few “apps” that we use in our production environment that are based on the old “connect” SDK. I had migrated a few of them over to a more recent version but know that I must get them moved over to the latest. My issue is that I cannot find any solid examples of code using the current PHP SDK that work. I’m sorry but most of my coding has been from utilizing examples and being able to combine that with the documentation from the old SDK and I was able to code many simple interfaces.
That is not the case with the most recent SDK. First off, I don’t find any doc for the SDK that provides me insight into how to construct the calls or even get the basic interface setup.
I have installed the latest SDK using composer on my server and I have tried, endlessly, to use what small snippets of examples that I can find to make anything work but to no avail.
Would someone be willing to provide me with a simple example of how to use the current SDK.
Just for a start, all I’m trying to do is get a list of current employees, nothing fancy. From there I should be able to build that into migrating my existing code to current.
Any help would be greatly appreciated.
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
Additional Documentation
Square SDK and Mobile Samples
Test Authorization with Web Server
Node.js SDK Migration Guide
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
Have you looked at using our API Explorer to help build requests? You can select PHP to create requests.
![]()
Bryan,
Thank you for the quick response. I have done so much testing w/various examples I wanted to redo some of them to give you as detailed response as possible:
First off, I use composer on my server and installed the latest version of the PHP SDK:
From the composer.lock file:
“name”: “square/square”,
“version”: “43.0.2.20250820”,
I have verified my php version as: PHP Version 8.2.18
I copy the code from the Quickstart page and immediately get the following error in the code editor:

I copy the code from API Explorer and get the same error when pasting it in my editor:
I’ve been able to modify the syntax to get around the specific error but then start running into additional errors during execution. Probably best to start here without my modifications. Hopefully this is something I’m just overlooking.
What endpoint are you calling? ![]()
for the API Explorer it is Search team members
and the Quickstart it is List locations
Bryan,
I’ve been doing some additional testing and went back a few versions of the SDK and had some success with them. I decided to move back to the latest and try again. One thing I realized is that I hadn’t actually tried running the code in spite of the syntax error. When I did that there was no error pertaining to the syntax. I made a few other minor changes and the test code IS working.
I’ll continue to do some work to understand how to migrate some of my older code forward but I think my initial issue is resolved.
Thank you!
Glad to hear that your making progress. ![]()
