Most probably this error happened because of passing an invalid cart_id format. For example, passing integer id instead of a string.
In this article you will be going to know about:
How to investigate the reason that caused this error?
You can investigate the reason for such an error from the "API debug log", by navigating to the Developer’s menu > Testing > API Debug Logs (within your desired profile).
Or you may get the error directly from the response payload sent from PayTabs according to your sent request
Reason #1: Invalid cart_id format
This means that you passed an invalid format to the "cart_id" parameter. For example, passing integer values or even symbols.
The cart_id format MUST be string