9. Error Reference Table
Nijipe uses standard HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted), and codes in the 5xx range indicate an error with our servers.
| HTTP Code | Error Type | Description |
|---|---|---|
| 200 - 201 | Success | The request was successful. |
| 400 | Bad Request | The request was unacceptable, often due to missing a required parameter or invalid JSON. |
| 401 | Unauthorized | No valid API key provided or API key is incorrect. |
| 403 | Forbidden | The API key doesn't have permissions to perform the request. |
| 404 | Not Found | The requested resource doesn't exist. |
| 429 | Too Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
| 500, 502, 503, 504 | Server Errors | Something went wrong on Nijipe's end. (These are rare.) |
{
"error": {
"code": "invalid_request",
"message": "The 'total' parameter is required for invoice generation."
}
}Common Authentication Errors
{"error": "Unauthorized"}
Cause:
You hit the Bitcoin RPC node (which uses Basic Auth) instead of the Next.js API. Check your Base URL to ensure you are targeting the main application domain, not the `api.` subdomain.
{"error": "Missing or malformed Authorization header. Must provide a Bearer token."}
Cause:
Your HTTP client dropped the header. Ensure you are sending the `Authorization: Bearer <key>` header and that you aren't hitting a URL that redirects (like missing the `www.` prefix).
{"error": "Invalid API key. Store not found or key was revoked."}
Cause:
The key is correctly formatted and received, but the SHA-256 hash does not match an active store in the database. Ensure you are using the correct live or test key for your store.