> ## 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.

# Webhooks

Pillar8 uses webhooks to receive transaction outcomes and improve decision quality.

## Order Completed Webhook

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

### Purpose

Webhooks serve three key functions:

* Capture the selected payment method
* Record the transaction outcome
* Feed data into the learning loop

### Example Payload

```text theme={null}
{
  "order_id": "12345",
  "checkout_token": "abc123",
  "selected_fop": "paypal",
  "status": "paid",
  "amount": 85,
  "currency": "EUR"
}
```

### Headers

Shopify-style webhook authentication using HMAC signature.

## Shopify Webhooks Used

The Shopify integration uses multiple webhook events to reconstruct the full transaction lifecycle and improve decision accuracy:

* `orders/paid`
* `order_transactions/create`
* `tender_transactions/create`
* `checkouts/create`

<Note>
  Webhooks are required for learning and optimization. No changes to payment processing are required.
</Note>
