Building a client in PHP to interface with an EPP server

So I’m being tasked with building an interface for an EPP server. As someone who is foremost a front end designer, I’m way in the deep end. I’m not a complete beginner at PHP, but I have a hard time troubleshooting my cURL requests when they fail, and navigating all the data requirements of different domains. This system allows me to send and receive with JSON instead of XML like many of the other clients I have seen. Wondering if anyone had pointers on how I can go about structuring this program. My biggest problems so far are getting the data and headers correct for the cURL requests to complete, and being able to decipher what exactly the server error codes are pointing at.