4. Shop as a customer and verify the purchase
Shop (as the customer, on webchat)
Section titled “Shop (as the customer, on webchat)”| Step | What happens | Success looks like |
|---|---|---|
| Browse | Search the catalog without signing in. Only browsing is open to anonymous visitors | Products with exact prices |
| Add to cart | You are asked to sign in. Enter the code emailed to ana@example.com | After sign-in, the item you tried to add is added once |
| Checkout summary | The shop shows merchant, card, lines and the exact total | Total matches the cart |
| Card setup | If no card is on file, a secure link is emailed. Open it and enter a Dummy test card | Only the brand and last four digits are kept |
| Confirm | Ask to confirm, and enter the 6-digit code emailed to you in the code field | The purchase is made once. Retrying never charges twice |
| Receipt | Ask for your orders, then open the newest receipt | Exact lines and total. You only ever see your own orders |
A customer’s own AI agent can do the same through Customer OAuth and the ui_catalog, ui_cart, ui_checkout and ui_act tools.
The purchase still needs the code the customer typed. See Customer access.
Verify (as the merchant)
Section titled “Verify (as the merchant)”| Check | Operation | Expected |
|---|---|---|
| Order | REST GET /v4/commerce/orders/{orderId} (also visible in Admin console → Commerce → Orders) |
One order, payment status paid. At the pinned platform commit the API derives this status from the payment; check it through the API, not exports |
| Payment | Admin console → Payments; or REST GET /v4/payments/{id} |
One completed payment |
| Ledger | REST GET /v4/ledger/entries/by-reference?referenceType=payment&referenceId={paymentId}; Admin console → Ledger |
Two entries: debit external pay-in clearing, credit unallocated funds liability. Debits equal credits |
| Review task | Admin console order page | One purchase-review task |
Moving funds from unallocated liability to the merchant is a separate settlement step. It is not part of this tutorial.
Evidence
Section titled “Evidence”- A platform test runs checkout, the emailed code, the hosted card link, purchase, receipt and review task exactly once, and asserts a balanced ledger.
- Internal staging acceptance at 0.6.7:
- anonymous browse with sign-in step-up and exactly-once replay;
- exact totals;
- one order, one purchase attempt and one payment per purchase;
- receipts and history;
- isolation between customers.
- Docs acceptance on a prepared sandbox: pending. In particular, which Dummy test card numbers the hosted card form accepts has not been confirmed for the docs.