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

# Endpoint & Distribution Configuration

> Step-by-step guide to create and configure custom endpoints and set up distribution logic in Pingtree.

# Endpoint & Distribution Configuration

Follow these steps to build and activate a custom endpoint, then wire up distribution logic (routing rules, filters, CAPs, thresholds).

> **Video Walkthrough:** A step-by-step video guide for this feature is coming soon.

<Frame caption="Endpoint configuration wizard with field mapping">
  <img src="https://mintcdn.com/pingtree/VhlsITRW0O01h-Sm/assets/images/screenshots/endpoint-configuration.png?fit=max&auto=format&n=VhlsITRW0O01h-Sm&q=85&s=e855959fcc7c1df5d9cb33cf3d8db769" alt="Endpoint configuration wizard with field mapping" width="1920" height="985" data-path="assets/images/screenshots/endpoint-configuration.png" />
</Frame>

***

## Pre-Setup Considerations

Before you begin, gather:

* **Endpoint function**: direct buyer, CRM, dialer, data warehouse, etc.
* **Routing method**: Form, Click, Ping+Post, or Pingtree Routing.
* **API specs**: endpoint URLs, methods, payload formats, authentication, and response structure.
* **Filter & rule criteria**: geolocation, CAPs, time windows, custom routing logic.

***

<Steps>
  <Step title="1. Create the Endpoint">
    <Frame>
      1. Go to **Distribution → Custom Endpoint**.<br />
      2. Click **Add Custom Endpoint**.<br />
      3. Enter a **Name**, select a **Parent Endpoint**, and save.
    </Frame>
  </Step>

  <Step title="2. Map Lead Routing">
    <Frame>
      1. In the **Lead Routing** tab, enter your **Primary URL** and **Backup URL** (optional).<br />
      2. Map system fields and any **Static Fields** (headers, tokens, etc.).<br />
      3. (Optional) Set a **Minimum Price** to only accept leads if the response price ≥ your threshold.
    </Frame>
  </Step>

  <Step title="3. Configure HTTP Method & Format">
    <Frame>
      1. Choose **GET** or **POST** (per API specs).<br />
      2. Select **Payload Format**:<br />
         * JSON (default)<br />
         * x-www-form-urlencoded<br />
         * form-data<br />
         * XML (16-bit or 8-bit)
    </Frame>
  </Step>

  <Step title="4. Set Response Mapping & Timeouts">
    <Frame>
      1. In **Response Mapping**, map:<br />
         * **Success flag** (accept/reject)<br />
         * **Amount** (revenue)<br />
         * **URL** (redirects)<br />
         * **Reject Reason** (for logs)<br />
      2. Assign **Endpoint Timeout** (seconds to wait per request).<br />
      3. Use **Sample Response** to test with a real `transaction_id`.
    </Frame>
  </Step>

  <Step title="5. Add Filters & CAPs">
    <Frame>
      1. Go to the **Filters** tab.<br />
      2. Enable **Black List Alliance** (if used).<br />
      3. Configure **Geolocation**, **State/Zip** filters.<br />
      4. Set **CAPs** (global, daily, weekly, monthly).<br />
      5. Define **Day-Parting** time windows.
    </Frame>
  </Step>

  <Step title="6. Set Price & Test">
    <Frame>
      1. In **Price Settings**, assign a **Fixed Payout** per sale.<br />
      2. Toggle **Override Campaign Settings** for source-specific pricing.<br />
      3. Click **Test Endpoint**, enter sample values, and verify the live API response.
    </Frame>
  </Step>

  <Step title="7. Activate the Endpoint">
    <Frame>
      1. Toggle **Enable Endpoint** on.<br />
      2. In the top-left, select **Activate**.<br />
      3. Ensure the endpoint status shows **Active**.
    </Frame>
  </Step>

  <Step title="8. Configure Distribution Logic">
    <Frame>
      1. **Routing Rules**: Create IF/THEN conditions under **Distribution → Routing Logic**.<br />
      2. **Routing Models**:<br />
         * Base Routing: default delivery<br />
         * Conditional Routing: custom rules<br />
         * Failover Routing: catch-all<br />
      3. **Routing Thresholds**: apply weights for rotational distribution.<br />
      4. Save and **Publish** your campaign changes.
    </Frame>
  </Step>
</Steps>

***

You’re all set! Your endpoint is now live with full distribution logic. Monitor logs and adjust filters, CAPs, or routing rules as needed.
