Clover: Northstar Outfitters on this reference

How an outdoor retailer whose inventory lives in Clover runs Anthropic's Claude Commerce Agents blueprint here, how a Clover sandbox is created, what the adapter sends to Clover's sandbox hosts, and what has and has not been run against them.

The demo merchant

Northstar Outfitters is a fictional outdoor retailer in Duluth: tents, sleeping bags, a camp stove, a cooler, boots and rain shells in several sizes, packs, and a staff-sale canoe, 27 Clover items in verticals/northstar_outfitters/data/clover_items.json, from a $12 snack bundle to a $420 canoe. Its tenders are card, Apple Pay, Google Pay, gift cards (the demo user holds $40), Klarna pay in 4 between $35 and $1,000, and Pay by Bank, with a loyalty program called Trailhead Rewards at two points per dollar. Every company, brand, product, and person is fictional; only Clover is real.

Merchant Clover App Market The app (this reference) Clover REST API Store assistant app registration · permissions installs the app OAuth access token for thismerchant GETitems?expand=itemStock,categories,itemGroup,options GETitem_groups?expand=attributes.options· GET categories elements · itemGroups · categories products · families · stock · categories approved restock POST item_stocks/{itemId} · POSTitems/{itemId} the demo uses a fixture in this exact shape; sync_inventory reads a live merchant with the same three calls
Three reads, one shape. The adapter's inventory sync fetches items, item groups and categories and returns the fixture's shape; the storefront maps them onto the kit's products, families and availability. Descriptions and images are not Clover fields, so a sidecar the store owns supplies them, which is the content gap a feed vendor could fill. Details in docs/CLOVER-INVENTORY.md.

This merchant differs from the other four in where its catalog comes from. The storefront reads a Clover-shaped inventory (items, item groups as variant families, item stocks as availability, categories) through CloverCatalogStorefront in commerce_core/storefront.py, and the operations assistant's restocks and price moves are written back the way the Clover item API takes them (CloverMerchantBackend in commerce_core/merchant.py). It runs on the reference's own storefront and portal apps on ports 3010 and 3110, with the merchant API on 8010; the assistant is Northstar Guide.

Checkout in the four models

Model What the button opens What the Clover adapter does
hosted Clover Hosted Checkout, a 15-minute session on Clover's page POST /invoicingcheckoutservice/v1/checkouts with X-Clover-Merchant-Id, the customer, shoppingCart.lineItems (prices in cents), and redirectUrls; the response href is the button
server the merchant's own page POST /v1/tokens on the tokenization host with the PAKMS key, then POST /v1/charges on the Ecommerce host
dropin the merchant's page with Clover's hosted iframe GET /pakms/apikey for the public key; the iframe tokenizes in the browser and the server charges the clv_ token
link the same Hosted Checkout href, sent as a link POST /invoicingcheckoutservice/v1/checkouts
Shopper Assistant (the model) Store server PSP hosted page “check out” checkout(note) create_checkout_session(lines, customer,return_url) checkout_url · expires in 15 min checkout card + button (URL added after the model's call) opens the page · picks a tender · pays redirect + webhook: order · transaction next turn: “the cart is now an order” PCI: SAQ A · the PSP renders, collects, authorizes · the store learns by webhook
The processor renders, collects and authorizes. The store holds no card data. This is the model the first cut of this reference assumed, and the one Clover, Adyen, Stripe and Worldpay each create with a single call.

The adapter implements all four and scripts/psp_smoke.py clover exercises them. Northstar Outfitters runs whichever model CHECKOUT_MODEL names: build_backend in verticals/northstar_outfitters/api/backend.py composes the Clover catalog storefront with that model's mixin from psp_commerce/integration/ ahead of it, so the checkout button opens a Hosted Checkout page by default, the merchant's own page for the server and drop-in models, or a payment link.

What live mode changes for this merchant

Without Clover credentials the Northstar merchant boots on the simulated gateway, and its catalog is the fixture verticals/northstar_outfitters/data/clover_items.json, laid out in the shape Clover's REST API returns for items, item groups and categories. With CLOVER_MERCHANT_ID and CLOVER_ACCESS_TOKEN set, verticals/northstar_outfitters/api/main.py asks gateway_for for the Clover adapter instead, and CloverGateway answers the same reads (list_items, list_item_groups, list_categories, get_item_stock) from one sync_inventory call against the sandbox merchant's /v3/merchants/{mId}/items, item_groups and categories. The storefront then shows whatever that merchant sells, so a sandbox merchant with no items shows an empty store; seed it from the Clover dashboard or the Inventory API first.

first-party/run.sh prints Clover: live (test environment) when the two variables are set, and the merchant reports gateway_mode: live. test.sh with those variables set checks that, then runs scripts/psp_smoke.py clover, the first live call per endpoint. Neither has been run against a sandbox merchant in this repository.

Getting Clover sandbox credentials

Read from Clover's documentation on 8 September 2026.

  1. Create a sandbox developer account at https://sandbox.dev.clover.com/developer-home/create-account: email, confirmation, password, name, developer or company name, then the test merchant's details (name, country, address, currency, timezone, passcode length). It is immediate and test merchants are non-billable (https://docs.clover.com/dev/docs/create-a-sandbox-account).
  2. The merchant ID (mId, 13 characters) is in the Merchant Dashboard URL (https://docs.clover.com/dev/docs/using-api-tokens).
  3. A merchant-level API token: Developer Dashboard, Test Merchants, Launch Dashboard, Settings, View all settings, Business Operations, API tokens, Create new token, with the permission checkboxes (https://docs.clover.com/dev/docs/generate-a-test-api-token). This is CLOVER_ACCESS_TOKEN; an app's OAuth access token for the merchant works in its place.
  4. Ecommerce tokens for charges: Merchant Dashboard, Settings, View all settings, Ecommerce, Ecommerce API Tokens, Create New Token, choosing "Hosted checkout" (private token plus merchant ID) or "API" (public plus private token). This requires two-factor authentication and location access on the account (https://docs.clover.com/dev/docs/create-ecommerce-api-tokens). Tick "Enable online payments" in the same Ecommerce section. The private token is CLOVER_ECOMMERCE_TOKEN; without it the adapter reuses the merchant token for the Ecommerce host.
  5. Hosted Checkout redirect URLs can also be set in the dashboard under Ecommerce, Hosted Checkout, Redirect URLs, and dashboard values override the request (https://docs.clover.com/dev/docs/redirecting-customers). The Hosted Checkout webhook and its signing secret are under Ecommerce, Hosted Checkout, Webhook URL (https://docs.clover.com/dev/docs/ecomm-hosted-checkout-webhook); the reference implements no Clover webhook route.

The Ecommerce service is available in the United States and Canada.

The variables

Variable Read by Meaning
CLOVER_MERCHANT_ID psp_commerce/adapters/clover.py the 13-character mId
CLOVER_ACCESS_TOKEN the adapter the merchant API token or an app's OAuth access token, sent as a bearer
CLOVER_ECOMMERCE_TOKEN the adapter (optional) the private Ecommerce token for /v1/charges and /pakms/apikey
ANTHROPIC_API_KEY both assistants the model
CHECKOUT_MODEL hosted (default), server, dropin or link which page the checkout button opens, see above

First party and third party

The first-party run starts Northstar Outfitters with Northstar Guide: first-party/run.sh brings up the API on 8010, the storefront on 3010, and the portal on 3110 (--all default, --merchant, --api-only). The walkthrough, from a family tent to the hosted page, and the portal's Clover-shaped inventory alongside the processor's numbers, is in first-party/README.md.

The third-party run starts only the API and lets a platform agent shop the Clover inventory over UCP: scripted, or driven by a model, with --complete gpay_demo and --serve for an MCP client such as Claude Code. The endpoints and what Clover advertises to platforms are in third-party/README.md.

test.sh

platforms/clover/test.sh

It runs the pytest subset for this merchant (-k "northstar or clover or adapters or thirdparty or demo_paths or verticals_boot", 39 of 66 tests, the largest subset because the Clover storefront and merchant backend have their own tests), boots the API and checks the gateway mode, fetches UCP discovery and tools/list, and runs the scripted platform agent to a staged checkout. With the two Clover variables set it adds scripts/psp_smoke.py clover: a Hosted Checkout session, a second session as the link, a client session (which fetches the PAKMS key), a payment intent, a tokenize-and-charge with the adapter's test card, and a payments read.

== the merchant boots
   Northstar Outfitters · Clover · gateway simulated · checkout hosted
PASS  simulated gateway (no Clover credentials set)
== UCP discovery and the MCP handshake
PASS  discovery document
PASS  tools/list
== a scripted third-party agent shops here
PASS  platform agent staged a checkout (continue_url (variant 1, the shopper pays on the processor's page): http://localhost:8010/checkout/cko_…)
ALL PASS (Clover)

What was verified, and what was not

The Clover adapter has not been run against a Clover sandbox merchant in this repository. Its requests, including the inventory sync, are asserted in tests/test_adapters_http.py::test_clover_requests_and_inventory_sync against a mock transport with Clover's documented shapes; the storefront over the Clover-shaped fixture has its own tests in tests/test_clover_storefront.py. The simulated run of this folder was checked on 8 September 2026. scripts/psp_smoke.py clover is the first live run.

Troubleshooting

Symptom or question What the code does What Clover's documentation says (read 8 September 2026)
Platform API calls answer 404 or a redirect the adapter's platform host is https://apisandbox.dev.clover.com (PLATFORM_SANDBOX) for /v3/merchants/{mId}/… and Hosted Checkout, as the API reference gives it (https://docs.clover.com/dev/reference/api-reference-overview, https://docs.clover.com/dev/docs/creating-a-hosted-checkout-session); https://sandbox.dev.clover.com is the dashboard and OAuth host CLOVER_ENV=production switches the three hosts to their production names
Ecommerce calls answer 401 /v1/charges and /pakms/apikey use CLOVER_ECOMMERCE_TOKEN, or the merchant token when it is unset the Ecommerce private token is issued under Ecommerce API Tokens and requires 2FA on the account; the merchant API token is a different credential
Hosted Checkout answers an error the adapter sends customer, shoppingCart.lineItems, and redirectUrls with the merchant API's http://localhost:8010/checkout/return redirect URLs must be HTTPS, and "Enable online payments" with the Hosted checkout integration type must be on
The tokenizer's test card is refused the adapter's tokenize_test_card sends 4242 4242 4242 4242, the success card on Clover's test-card page, where 4005 5717 0222 2222 declines and 4005 5780 0333 3335 is a partial approval, the last three digits of the amount selecting the response (https://docs.clover.com/dev/docs/test-card-numbers) check that the Ecommerce API tokens were created with online payments enabled
The return page says the payment is not finished redirectUrls carry ?result=success&checkout_id=<reference>, and the return route finds the session by that reference; the adapter marks it completed once its ledger holds the payment the ledger is fed by the Hosted Checkout webhook, which this reference does not implement for Clover, so a live deployment adds that route or a status read on return
gateway_mode stays simulated with credentials set CLOVER_MERCHANT_ID or CLOVER_ACCESS_TOKEN is missing from the process, or GATEWAY_MODE=simulated is set put both in platforms/clover/.env and start again; with them the merchant reads its catalog from the sandbox merchant's items, item groups and categories

The endpoints the adapter calls

Three hosts: the platform API (PLATFORM_SANDBOX, bearer token), the Ecommerce API at https://scl-sandbox.dev.clover.com (bearer), and the tokenization host at https://token-sandbox.dev.clover.com (apikey header). The module docstring of psp_commerce/adapters/clover.py is the source.

Gateway method Clover call Status
sync_inventory GET /v3/merchants/{mId}/items?expand=itemStock,categories,itemGroup,options&limit=1000 (paged), /item_groups?expand=attributes.options, /categories tested; not wired into the demo
inventory writes POST /v3/merchants/{mId}/item_stocks/{itemId}, POST /v3/merchants/{mId}/items/{itemId} tested
create_checkout_session, create_payment_link POST /invoicingcheckoutservice/v1/checkouts with X-Clover-Merchant-Id tested
get_checkout_session the ledger, fed by the Hosted Checkout webhook tested
authorize_payment POST /v1/tokens (tokenization host, apikey = PAKMS key), then POST /v1/charges (Ecommerce host: amount in cents, currency, source, capture) tested
create_client_session GET /pakms/apikey (Ecommerce host) tested
complete_client_session POST /v1/charges with the iframe's clv_ token tested
authorize_delegated none; the adapter refuses every delegated credential tested
transactions GET /v3/merchants/{mId}/payments?expand=tender,cardTransaction&filter=createdTime>=… tested

Batches and disputes are dashboard reports at Clover, so the adapter's ledger stands in for them.