Creating PHP custom API is outside the scope of this forum.
But once API is created, you can consume your REST API in Mendix.
Refer the comments : https://forum.mendix.com/link/space/databases/questions/128574
OR
https://docs.mendix.com/refguide/integration/consume-a-rest-service/