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

# Browser Harness

> Prava's checkout automation completes a real merchant checkout and confirms the true total before charging.

The **Browser Harness** is the second half of the agentic-commerce pipeline: it **starts from a
[UCP](https://docs.prava.space/integration/ucp.md) quote** and turns that estimate into a placed, verified order. Most merchants
don't expose a direct payment API, so to actually place an order, someone has to go through the
merchant's own checkout. The Browser Harness does exactly that: it drives the real Shopify checkout,
works out the true final total, and pays with the one-time tokenized card (a single-use stand-in
for the real card). An AI application completes the purchase without ever touching the raw card or
the merchant's checkout code.

> [!NOTE]
>
> The Browser Harness is the **checkout** step after a UCP [quote](https://docs.prava.space/integration/ucp.md). It powers
> [`prava shop checkout`](https://docs.prava.space/prava-pay/shopping#checkout) and hosted agentic purchases.

## What it does

> [card] Completes the real checkout
>
> Fills the merchant's checkout (contact, shipping address, delivery option) and submits payment with
> the one-time token. No merchant integration required.

> [card] Confirms the true total first
>
> Reconciles subtotal, shipping, and tax against the live checkout and waits for the amount to settle
> **before** charging, so there are no surprise totals.

> [card] Returns a verifiable result
>
> On success you get an **order id** and a payment **status**: a checkable confirmation the order was
> placed.

> [card] Reliable, repeatable
>
> It learns a merchant's checkout on the first run and completes later runs consistently, healing
> automatically if the page changes.

## Why it matters

**1. No surprise charges**

The amount is **reconciled and stable** before payment is attempted. If the total shifts mid-checkout
(late shipping, tax, or add-ons), reconciliation restarts rather than charging the wrong amount.

**2. One clean attempt**

A checkout runs as a single, tracked flow rather than a blind retry loop, so a purchase either
completes and returns an order, or fails cleanly for you to re-quote.

**3. Card safety preserved**

It pays with the **single-use, merchant-scoped** credential from the session. Even inside the
checkout, the credential can't be reused or redirected to another merchant.

## How it fits the flow

```mermaid theme={null}
flowchart LR
    U["UCP quote<br/>price the item"]
    B["Browser Harness<br/>confirm true total"]
    R["Order placed<br/>order id + status"]
    U --> B -->|pays with one-time token| R
```

The [UCP](https://docs.prava.space/integration/ucp.md) quote gives an estimate; the Browser Harness turns it into a **completed,
verified order**. Today it targets **Shopify** checkouts.

## Next

> [card] [UCP](https://docs.prava.space/integration/ucp.md)
>
> How products are discovered and quoted before checkout.

> [card] [Agentic Commerce](https://docs.prava.space/integration/overview.md)
>
> The full discover → quote → checkout → pay pipeline.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.