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

# Configure Your VTPE Integration: Setup Guide

> Step-by-step guide to configure a VTPE integration by providing your API URL and Webhook URL and setting up credentials securely.

VTPE is the platform that initiates payments on behalf of customers and calls your systems for payment details and status updates. This guide walks you through configuring your integration with Mizaniya Pay so VTPE can reach your endpoints securely.

<Steps>
  <Step title="Create a Partner Account">
    Register at the [Partner Portal](https://partner.mizaniyapay.dz/) and complete the onboarding process. Mizaniya Pay will review your application and, upon approval, issue your API Secret and HMAC Secret.
  </Step>

  <Step title="Receive Credentials from Mizaniya Pay">
    After onboarding, you receive two secrets:

    * **API Secret**: used to authenticate requests from VTPE in the `Authorization` header
    * **HMAC Secret**: used to verify webhook signatures sent by VTPE

    Store both as environment variables in your server environment:

    ```bash theme={null}
    export VTPE_API_SECRET="your_api_secret"
    export VTPE_HMAC_SECRET="your_hmac_secret"
    ```

    <Note>
      Store secrets in environment variables or a secrets manager. Never commit them to source code or expose them in client-side code.
    </Note>
  </Step>

  <Step title="Expose Your Product Information API">
    You must implement and host a GET endpoint that VTPE calls to retrieve payment details before initiating a payment. Ensure this endpoint is publicly reachable over HTTPS at your chosen API URL.

    Example URL:

    ```text theme={null}
    GET https://api.example.com/payments/{reference}
    ```
  </Step>

  <Step title="Expose Your Webhook Endpoint">
    You must implement and host a POST endpoint that VTPE calls to notify you about payment events. Ensure this endpoint is publicly reachable over HTTPS at your chosen webhook URL.

    Example URL:

    ```text theme={null}
    POST https://api.example.com/webhooks/vtpe
    ```

    <Warning>
      Both your Product Information API and your Webhook URL must be served over HTTPS. VTPE will not call HTTP endpoints.
    </Warning>
  </Step>

  <Step title="Provide Your URLs to Mizaniya Pay">
    Share your API URL and Webhook URL with Mizaniya Pay so VTPE knows where to send requests.

    | Configuration | Description                                                                    |
    | ------------- | ------------------------------------------------------------------------------ |
    | API URL       | Endpoint VTPE uses to retrieve payment information before initiating a payment |
    | Webhook URL   | Endpoint that receives payment event notifications from VTPE                   |
  </Step>

  <Step title="Test the Integration">
    Mizaniya Pay will test your configuration by calling your API URL with a reference and sending a test webhook to your Webhook URL. Verify that:

    * Your Product Information API returns the correct payment details
    * Your Webhook URL responds with HTTP 200 and `{ "success": true }`
    * Your server receives and can inspect the `Authorization`, `X-Timestamp`, and `X-Signature` headers
  </Step>

  <Step title="Verify Signature Handling">
    Ensure that your webhook handler verifies the `X-Signature` header on every incoming webhook request before processing the event. This prevents spoofed or tampered requests from being accepted.
  </Step>
</Steps>

After completing these steps, your VTPE integration is fully configured and ready to process live payments.
