# Error Reference

### HTTP Status Codes

| Status Code | Description                                                |
| ----------- | ---------------------------------------------------------- |
| 200         | Success — request completed successfully                   |
| 400         | Bad Request — invalid parameters or business logic error   |
| 401         | Unauthorized — missing or invalid API key                  |
| 403         | Forbidden — IP not whitelisted or insufficient permissions |
| 429         | Too Many Requests — rate limit or idempotency violation    |
| 500         | Internal Server Error                                      |

### Common Error Messages

| Message                                                     | Cause                                             |
| ----------------------------------------------------------- | ------------------------------------------------- |
| `No token provided`                                         | Missing `Authorization` header                    |
| `Invalid token prefix`                                      | API key has an unrecognized prefix                |
| `Invalid api key`                                           | API key does not match any merchant record        |
| `Merchant not found`                                        | No merchant associated with the API key           |
| `Business not found`                                        | No business associated with the merchant          |
| `User not found`                                            | No user associated with the merchant              |
| `No Test SSH Key found` / `No Live SSH Key found`           | SSH public key not configured for the environment |
| `IP address not whitelisted`                                | Client IP is not in the allowed IP list           |
| `Permission denied`                                         | Business role lacks the required permission       |
| `No account role assigned`                                  | Business has no role configured                   |
| `Service is currently unavailable. Please try again later.` | Service disabled via emergency shutdown           |
| `Merchant configuration not found`                          | Merchant config record missing                    |
| `Too many request`                                          | Rate limit exceeded (60 requests/minute)          |
