Unexpected token in JSON
What the error means, why it happens and how to fix it in seconds.
This error means the parser met a character it did not expect at that place. Typical causes: a missing comma between two fields, a trailing comma, an extra bracket, or the response is not JSON at all (for example an HTML error page starting with <).
“Unexpected token <” almost always means your API returned HTML (404/500 page) instead of JSON — check the URL and the status code before parsing.
Example of broken JSON:
{
"id": 1
"status": "paid"
}