Skip to main content
The embed starts a draft order and shows hosted checkout in an iframe. Load the script from a Join Markt host that serves /embed without a store rewrite (https://joinmarkt.com, a store subdomain, or a verified custom domain). The script calls that same origin. Do not put a merchant API key in the page. Both public endpoints accept POST with Content-Type: application/json, allow any origin, and limit each client to 30 requests per minute:
  • POST /api/embed/checkout — modal checkout. Response: { orderId, url }
  • POST /api/embed/elements/session — inline pieces. Response includes orderId, checkoutUrl, and elementUrls
productId is the product public id (PRD-…) or the product’s internal id. Optional HTTP fields on both endpoints: variantId, quantity (1–99), theme (light, dark, or auto), email, couponCode, returnUrl, affiliateCode, metadata (string values only). JoinMarkt.open uses those names. JoinMarktElements.session uses product, variant, coupon, and affiliate instead of productId, variantId, couponCode, and affiliateCode. Custom elements use the attributes product, variant, coupon, and return-url. url / checkoutUrl is {origin}/checkout/{orderId} plus query embed=1 and theme. Coupon, email, return URL, and metadata are copied onto that query when you sent them. The path is not rewritten to /store/{subdomain}/....
JoinMarkt.init() binds every element that has data-join-markt-product-id. data-join-markt-metadata must be JSON when you set it. JoinMarktEmbed is the same object. JoinMarkt.open sends only the first line:
Affiliate code falls back to the page’s ref query parameter, then the join_markt_affiliate cookie.

Elements

Elements is a separate script. Each piece is an iframe. Card data stays on Join Markt.
Pieces other than checkout have to sit inside <join-markt-session>:
Public piece names: checkout, summary, email, payment, coupon, terms, pay-button. JavaScript:
DOM events on the mount node are jm:ready, jm:paid, and jm:error. With no appearance object, host styling is copied only when --jm-accent, --color-brand, or --primary is set on the page. The script then also reads --jm-background, --jm-card, --jm-text, --jm-muted, --jm-radius, and --jm-font (with --background, --foreground, --radius, and --font-sans as fallbacks).