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

# Authentication

> Authenticate every request with your API key in the x-api-key header.

Send your API key in the `x-api-key` header on **every** request, exactly once.

```http theme={null}
x-api-key: pk_live_3f9a…
Content-Type: application/json
```

## Keys

| Key | Use |
| - | - |
| `pk_test_…` | Test mode. No card is charged and no money moves. |
| `pk_live_…` | Live payments. |

Create keys in your merchant dashboard. A new key must be approved before it works.

<Warning>
  Keep your API key on your server. Never put it in a web page or a mobile app.
</Warning>

## Authentication errors

| HTTP | errorCode | Meaning |
| - | - | - |
| 401 | `API_KEY401_INVALID` | Missing, malformed or unknown API key. |
| 403 | `API_KEY403_NOT_ACTIVE` | Key pending, inactive or suspended. |
| 403 | `API_KEY403_REVOKED` | Key permanently rejected. |
| 403 | `MERCHANT403_INACTIVE` | Merchant account not active. |

## Webhook secret

The webhook signing secret is separate from your API key. Set it in the dashboard API settings. See [Verify the signature](/webhooks/verify-signature).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.