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

# Authentication

> Authenticate with the Partner Payout API

The Partner Payout API uses **Bearer Token** authentication. Include your API key in every request.

## Base URLs

The API has separate URLs for sandbox and production:

| Environment    | Base URL                                    |
| -------------- | ------------------------------------------- |
| **Sandbox**    | `https://quickei.io/api/partner/sandbox/v1` |
| **Production** | `https://quickei.io/api/partner/v1`         |

<Warning>
  Use the **sandbox** URL with sandbox credentials for testing. Use the **production** URL with production credentials for real transactions.

  A sandbox token will be rejected on the production URL, and vice versa.
</Warning>

## Getting Your Credentials

<Steps>
  <Step title="Log in to the Merchant Dashboard">
    Go to [quickei.io/merchant/login](https://quickei.io/merchant/login) and sign in.
  </Step>

  <Step title="Create API Keys">
    Go to **Developer API > API Keys** and generate your keys. You will get separate keys for Sandbox and Production.
  </Step>

  <Step title="Go to Payout API">
    Navigate to **Payout API** in the sidebar. You'll see your credentials for both environments with a toggle to switch between them.
  </Step>
</Steps>

## Request Headers

Include the following headers in every request:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json
```

## Example Requests

**Sandbox:**

```bash theme={null}
curl -X GET https://quickei.io/api/partner/sandbox/v1/balance \
  -H "Authorization: Bearer YOUR_SANDBOX_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"
```

**Production:**

```bash theme={null}
curl -X GET https://quickei.io/api/partner/v1/balance \
  -H "Authorization: Bearer YOUR_PRODUCTION_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"
```

## Sandbox vs Production

|                          | Sandbox                     | Production           |
| ------------------------ | --------------------------- | -------------------- |
| **Base URL**             | `/api/partner/sandbox/v1`   | `/api/partner/v1`    |
| **Credentials**          | Sandbox API key             | Production API key   |
| **Real funds**           | No — simulated transactions | Yes — real money     |
| **Wallet debited**       | Sandbox wallet              | Real merchant wallet |
| **User wallet credited** | No                          | Yes                  |

<Info>
  Sandbox transactions appear in the **Sandbox Wallets** section of your merchant dashboard, separate from production transactions.
</Info>

<Warning>
  Never expose your API key in client-side code, mobile apps, or public repositories. All Partner API calls must be made server-to-server.
</Warning>

## Error Responses

If authentication fails, the API returns:

```json theme={null}
{
  "message": {
    "error": ["Invalid sandbox API credentials."]
  }
}
```

| Status             | Cause                                                                   |
| ------------------ | ----------------------------------------------------------------------- |
| `401 Unauthorized` | Missing, invalid, or wrong-environment API key                          |
| `403 Forbidden`    | API key is valid but Partner Payout API is not enabled for your account |
