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

# Quickstart

This guide walks you through integrating Pillar8 into your checkout to start receiving decision packages.

The integration is lightweight and requires no changes to your existing payment stack.

<Steps>
  <Step title="Add Pillar8 to Checkout">
    Install the Pillar8 client in your checkout environment.

    The component:

    * Captures checkout context (device, country, cart, payment methods)
    * Sends a request to the Pillar8 decision engine
    * Receives a decision package in real time
  </Step>

  <Step title="Call the Optimize API">
    Your checkout integration sends a request to:

    `POST /api/shopify/checkout-optimize`

    #### Example Request

    ```text theme={null}
    {
      "shop_domain": "example.myshopify.com",
      "cart_value": 85,
      "currency_code": "EUR",
      "country_code": "DE",
      "device_type": "mobile",
      "checkoutToken": "abc123",
      "default_fops": ["card", "paypal", "klarna"],
      "presented_payment_methods": ["card", "paypal", "klarna"]
    }
    ```
  </Step>

  <Step title="Receive Decision Package">
    Pillar8 returns a decision package for the checkout session.

    #### Example Response

    ```text theme={null}
    {
      "status": "ok",
      "ab_variant": "optimize",
      "was_optimized": true,
      "shadow_engine": {
        "scored": [
          { "code": "paypal", "score": 0.82 },
          { "code": "card", "score": 0.74 }
        ]
      },
      "gating_passed": true
    }
    ```
  </Step>

  <Step title="Apply the Decision">
    Use the decision package to:

    * Display an advisory recommendation to the shopper
    * Highlight or emphasize specific payment methods
    * Adjust checkout behavior
  </Step>

  <Step title="Send Transaction Outcome (Webhook)">
    Configure your backend to send transaction outcomes to Pillar8.

    `POST /api/shopify/webhooks/order-completed`

    This enables Pillar8 to:

    * Learn from actual payment outcomes
    * Improve future decisions
    * Measure impact
  </Step>
</Steps>

<Tip>
  Typical integration time: **a few hours to a couple of days**
</Tip>

## What Does Not Change

* Your PSP integrations remain unchanged
* Your orchestration layer remains unchanged
* Your payment routing remains unchanged

Pillar8 operates before payment execution.

## Next Steps

* See **API** for full endpoint definitions
* Review **Architecture** to understand system flow
* Check **Platforms → Shopify** for platform-specific details
