# API04001: Invalid Response Format

## What This Means[​](#what-this-means "Direct link to What This Means")

The server responded, but the response format is not what the POS expected. The server should return JSON data, but something else was received.

## Common Causes[​](#common-causes "Direct link to Common Causes")

* **PHP error displayed** — A PHP error is being output before JSON
* **Plugin conflict** — Another plugin is outputting content
* **Maintenance mode** — Site is showing a maintenance page
* **Wrong content type** — Server sending HTML instead of JSON
* **Caching issue** — A cached error page is being served

## How to Fix[​](#how-to-fix "Direct link to How to Fix")

### 1. Check Your Site[​](#1-check-your-site "Direct link to 1. Check Your Site")

Visit your WordPress site in a browser:

* Is it displaying normally?
* Are there any visible errors?
* Is it in maintenance mode?

### 2. Check for PHP Errors[​](#2-check-for-php-errors "Direct link to 2. Check for PHP Errors")

In `wp-config.php`, temporarily enable debugging:

```
define('WP_DEBUG', true);

define('WP_DEBUG_LOG', true);

define('WP_DEBUG_DISPLAY', false);
```

Check `wp-content/debug.log` for errors.

### 3. Test the REST API Directly[​](#3-test-the-rest-api-directly "Direct link to 3. Test the REST API Directly")

Visit `https://yoursite.com/wp-json/` in your browser:

* Should return JSON data
* If you see HTML or errors, there's a problem
* Check for plugin-related output

### 4. Disable Caching Temporarily[​](#4-disable-caching-temporarily "Direct link to 4. Disable Caching Temporarily")

Caching plugins may serve stale responses:

* Clear all caches
* Temporarily disable caching plugins
* Exclude the REST API from caching

### 5. Check for Plugin Conflicts[​](#5-check-for-plugin-conflicts "Direct link to 5. Check for Plugin Conflicts")

If a plugin outputs content on every page:

1. Disable all non-essential plugins
2. Test the POS
3. Re-enable plugins one by one

## Related Errors[​](#related-errors "Direct link to Related Errors")

* [API04003](/error-codes/API04003.md) — Malformed JSON Response
* [API05005](/error-codes/API05005.md) — Plugin Not Found
