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

# Tebex

> Follow this guide to connect Tebex with Spartan

## Prerequisites

* Tebex Account
* Access to Tebex Creator Dashboard
* Your application ready for integration

## Access Tebex API Keys

<Steps>
  <Step title="Open the Tebex API keys">
    Open your Tebex Creator Dashboard and click **API Keys** in the left sidebar.

    <img src="https://mintcdn.com/dezerx/y8vFoAhtdIIxWI9B/public/gateways/tebex/step-1.png?fit=max&auto=format&n=y8vFoAhtdIIxWI9B&q=85&s=b52e07ea5ebba68b3bfd0f2570c33c64" alt="Access API Keys" width="1866" height="911" data-path="public/gateways/tebex/step-1.png" />
  </Step>
</Steps>

## Get Your Credentials

<Steps>
  <Step title="Copy the required credentials">
    * **Project ID**: Copy your unique project identifier.
    * **Public Token**: Copy the public token.
    * **Private Key**: Copy the secret key and keep it secure.

    These credentials are required for Tebex API authentication.

    <img src="https://mintcdn.com/dezerx/y8vFoAhtdIIxWI9B/public/gateways/tebex/step-2.png?fit=max&auto=format&n=y8vFoAhtdIIxWI9B&q=85&s=82f837c00f2963ac5cb6f08c8ebaf430" alt="Get Credentials" width="1866" height="911" data-path="public/gateways/tebex/step-2.png" />
  </Step>
</Steps>

## Create Webhook

<Steps>
  <Step title="Open the webhook settings">
    Navigate to the webhook section in your Tebex dashboard and create a new webhook endpoint.
  </Step>

  <Step title="Set the webhook URL">
    The webhook URL must end with `/api/webhook/public/gateways/tebex/callback`.

    For example:

    ```text theme={null}
    https://yourdomain.com/api/webhook/public/gateways/tebex/callback
    ```

    <img src="https://mintcdn.com/dezerx/y8vFoAhtdIIxWI9B/public/gateways/tebex/step-3.png?fit=max&auto=format&n=y8vFoAhtdIIxWI9B&q=85&s=cbcf60d6311024e68ab0e3750438d69a" alt="Create Webhook" width="1866" height="911" data-path="public/gateways/tebex/step-3.png" />
  </Step>
</Steps>

## Add Tebex to Spartan

<Steps>
  <Step title="Open the Tebex gateway">
    Log in to Spartan as an administrator, then go to **Modules → Gateways → Tebex**.
  </Step>

  <Step title="Enter the Tebex credentials">
    Enter the following credentials:

    * **Project ID**: The Project ID copied from Tebex.
    * **Public Token**: The Public Token copied from Tebex.
    * **Private Key**: The Private Key copied from Tebex.
    * **Webhook Secret**: The secret generated for the Tebex webhook.

    Click **Save Settings** when complete.

    <img src="https://mintcdn.com/dezerx/y8vFoAhtdIIxWI9B/public/gateways/tebex/step-4.png?fit=max&auto=format&n=y8vFoAhtdIIxWI9B&q=85&s=240a3efc45de4da44186a2cee7f50617" alt="Spartan Configuration" width="1866" height="911" data-path="public/gateways/tebex/step-4.png" />
  </Step>
</Steps>

## Troubleshooting

### Common Issues

1. **Invalid Credentials**
   * Verify Project ID, Public Token, and Private Key are correct
   * Ensure there are no extra spaces when copying credentials

2. **Webhook Not Receiving Events**
   * Check webhook URL ends with `/api/webhook/public/gateways/tebex/callback`
   * Verify webhook URL is accessible publicly
   * Check your server logs for errors
   * Make sure your webhook is validated inside Tebex

3. **Payment Processing Failures**
   * Check Webhook.
