Settld SDK harness

A merchant's site, on its own origin — the only way to exercise CORS, approved origins, framing and postMessage.

Connection

A guid is sent as itemId, anything else as priceId, so a Settld item and a Paddle price can sit in the same cart. Multi-line carts are worth using: tax is allocated across lines, and one unresolvable line must fail the whole basket rather than quietly shrink it.

A subscription plan's price id goes in the same box and opens a subscription checkout — no customer needed, since the checkout collects the details and creates the subscription from them. One plan per cart: a second plan, or a plan beside a one-off item, is refused by name rather than reinterpreted as an add-on.

Any CSS length — 720px, 90vw, 40rem. Useful for seeing how the checkout reflows at narrow widths, since it renders inside the frame at whatever size you give it. Leave blank for the defaults.

Values persist in this browser. ?api=…&token=…&items=…&overlayWidth=…&overlayHeight=… also works (items comma-separated), so a bookmark survives a restart.

Options — fed into the calls below

Everything here is passed through to the real call, so the refusals are exercised with values you chose rather than hardcoded ones. locale is the single option that warns to the console and still opens a checkout — everything else Settld can't honour throws, and nothing opens.

Customer prefill — what the merchant already knows

Leave all three blank to send no customer at all. With a name and one contact channel the details step folds to a summary with an Edit toggle; tick the box to skip it entirely. Settld re-checks the prefill against the merchant's own Require rules either way, so a prefill that doesn't satisfy them renders the form regardless of the box.

Order reference

Your own identifier for what is being bought. Open the overlay once and pay it, then press Open again with the same value: no checkout renders, checkout.alreadyPaid fires instead, and open() rejects with error.alreadyPaid. Change one character and it opens normally — which is exactly why a value that varies per attempt silently buys you nothing.

Automated checks

Everything a headless run can prove. The overlay needs a human — use the button below.

Manual — poke at a running instance

Open the overlay and watch for checkout.loaded, then pick a payment method and watch checkout.payment.selected. The refusal buttons should each throw — the message is logged so you can read it. Environment.set() is the exception: it accepts production and refuses sandbox, because test mode is chosen by the key that creates the session, not in the browser.

Inline mount point

Set displayMode to inline and frameTarget to settld-inline-host, then open a checkout — it mounts here rather than over the page, and the frame tracks the checkout's height as it moves between the details and payment steps. That transition is a full page load inside the frame, which is exactly where the resize wiring is most likely to break.