> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opencharge.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Codes

> Standard error codes and response format for the Opencharge protocol

## Error Code Reference

| Code                       | HTTP | Description                                 |
| -------------------------- | ---- | ------------------------------------------- |
| `INVALID_SIGNATURE`        | 401  | Signature verification failed               |
| `TIMESTAMP_EXPIRED`        | 401  | Timestamp outside ±5 minute window          |
| `NONCE_REUSED`             | 401  | Nonce already seen (replay attempt)         |
| `UNKNOWN_OCID`             | 401  | OCID not found in registry                  |
| `METADATA_UNAVAILABLE`     | 502  | Could not fetch sender's metadata           |
| `INVALID_PROOF`            | 400  | Proof structure is malformed                |
| `PROOF_SIGNATURE_INVALID`  | 400  | Proof signature verification failed         |
| `ISSUER_NOT_ACCEPTED`      | 400  | Proof issuer not in settlement.accepts      |
| `AMOUNT_MISMATCH`          | 400  | Proof amount doesn't match transaction      |
| `CURRENCY_MISMATCH`        | 400  | Proof currency doesn't match transaction    |
| `TXID_NOT_FOUND`           | 404  | Referenced transaction doesn't exist        |
| `TRANSACTION_EXPIRED`      | 410  | Settlement window has closed                |
| `INSUFFICIENT_FUNDS`       | 402  | Sender has insufficient balance             |
| `CAPABILITY_NOT_SUPPORTED` | 400  | Service doesn't support requested operation |
| `RATE_LIMITED`             | 429  | Too many requests                           |

## Connection Refused (403)

Services may refuse connections at their discretion without providing a specific reason. This is distinct from authentication failures (401) or validation errors (400).

A 403 response during handshake means the service has chosen not to establish a connection. The response body is optional and may be empty.

```json theme={null}
{
  "error": {
    "code": "CONNECTION_REFUSED",
    "message": "Connection not accepted"
  }
}
```

Common reasons a service might refuse a connection include:

* Business policy decisions
* Compliance or regulatory requirements
* Geographic restrictions
* Internal blocklists

Services are not required to disclose why a connection was refused.

### Handling refused connections

* Do not retry immediately — the refusal is intentional
* Check your metadata is correctly published and discoverable
* Contact the service operator through out-of-band channels if you believe the refusal is in error

## Error Response Format

```json theme={null}
{
  "error": {
    "code": "ISSUER_NOT_ACCEPTED",
    "message": "Proof issuer OCID 999 is not in accepted settlement sources",
    "details": {
      "providedIssuer": 999,
      "acceptedIssuers": [100, 101, 102]
    }
  }
}
```
