The buy button
The buy button is a few lines of HTML you paste on any page. No framework, no install step on your end. The button renders on first paint; the payment popup and the payment-provider SDKs load on demand the first time a buyer clicks. It works in any site or framework that renders HTML, including the no-code site builders that let you paste HTML embeds.
Confirmed working with: Angular, Hugo, Jekyll, plain HTML, Webflow (Custom Code embed), Carrd (Embed element), Framer (HTML embed), Squarespace (Code Block), WordPress (Custom HTML block), Ghost, Notion sites (HTML embed widgets). If your site lets you paste HTML on a page, the buy button works there.
Attribute reference
| Attribute | Required | What it accepts | Notes |
|---|---|---|---|
endpoint | No | URL string | Almost always omit this. The button auto-detects its API base: https://api.coinmoebius.com in production, http://localhost:8787 on localhost. Only set it as an override for an unusual setup (e.g., a self-hosted proxy in front of the API). |
project-id | Yes | String, prefixed proj_ | The Store id from your store's Store settings page in the dashboard. Safe to expose publicly, it's an identifier, not a credential. |
product-id | Yes | Letters, numbers, and hyphens, up to 80 characters. No spaces. | The product reference of a product in your store. This is how the worker looks up the product and its price in your catalog. It is saved on the transaction as metadata.productId so you can map transactions back to inventory. See Pricing: fixed vs buyer-priced. |
amount | Yes | Decimal number as string | The price in major units (e.g., dollars, not cents). Must be positive. The button will not start a checkout without it. For a fixed-price product the worker still charges the price in your catalog, whatever the HTML says. For a buyer-priced product it is the suggested amount the popup starts with. |
currency | Yes | Three-letter ISO 4217 code or your own unit name | USD, EUR, etc. for cards / crypto rails. A pay-by-mail price can use your own unit code (e.g., GBK) because the merchant is the one settling the transaction. Same rule as amount: the button will not start a checkout without it. Use the currency your product is priced in. |
label | No | String | The button text. Defaults to Buy. Use this to distinguish buttons on the same page. |
customer-ref | No | String, any format you choose | An opaque identifier for the buyer in your own system, like a logged-in user id. The button forwards it to the worker as metadata.customerRef, and the worker tags the transaction with it. Later you can ask "which of my users paid?" using your own id, without us holding any actual customer data. Omit for anonymous checkouts. |
buyer-email | No | Email address | Where to send a digital download. Set this when your site already knows the buyer, like a members area or a logged-in app, and the button will not ask them for an email. When it is not set, the button asks the buyer for one at checkout if the product is a download on a provider that does not return the email itself. We hold the address encrypted until the download email is sent, then delete it. If the sale never completes, it is deleted after 7 days. |
theme | No | dark or light | Picks the built-in color scheme for the button and popup together. Defaults to dark. Set theme="light" for the light scheme. Your CSS variables override either one. See the styling guide. |
editable-amount | No | true or false | When true, the popup shows an amount field the buyer fills in (tips, donations, pay-what-you-want). Use it only on a buyer-priced product, because a fixed-price product always charges the price in your catalog. Defaults to false, where no field appears. The payment buttons stay disabled until the amount is a positive number. |
disabled | No | Attribute present/absent, or the el.disabled property | The standard button contract: while present, the button is dimmed and ignores clicks. Set it in your HTML, or flip the property from code the way you would on a native button. Separate from this, the button always locks itself while a click is processing so a double-click can't start two checkouts; that internal lock never touches a value you set here. |
spinner | No | true or false | The built-in loading spinner shown on the button while checkout starts. On by default. Set spinner="false" to turn it off and drive your own loading UI from the cm-busy and cm-idle events. Turning it off never turns off the double-click protection. The spinner draws in your button's own text color and size, so it matches your styling automatically; restyle it with ::part(spinner) or replace it entirely with <span slot="spinner">your markup</span>. |
One payment method? No popup.
When a product has exactly one payment method enabled and a fixed price, the button skips the payment popup: the buyer clicks and goes straight into that method's flow. Hosted checkouts navigate immediately with no popup at all, while pay-by-mail, in-page coins, and download-email prompts still open the popup at their own first step. Products with two or more methods, buyer-priced products (tips, donations), and products where buyers choose a quantity always show the payment popup. There is no separate setting for this; the button decides from your product's own settings, per product, so a two-method product and a one-method product on the same page each do the right thing. If a checkout fails on the direct path, a short error line appears under the button (styleable via ::part(error)).
Multiple buttons on one page
The script registers the button once, then any number of instances can render on a page. Each instance is independent. Each button carries its own amount and currency, the way the dashboard's Show code writes them.
<coin-moebius-buy
project-id="proj_YOUR_ID"
product-id="t-shirt-medium"
amount="25.00"
currency="USD"
label="T-shirt (medium)">
</coin-moebius-buy>
<coin-moebius-buy
project-id="proj_YOUR_ID"
product-id="mug-blue"
amount="15.00"
currency="USD"
label="Blue mug">
</coin-moebius-buy>For a buyer-priced product (donation widgets, tip jars), the button also includes editable-amount="true". See Pricing: fixed vs buyer-priced for the full picture.
Theming the button
The buy button renders inside a Shadow DOM, which means none of your page's existing CSS reaches into it. That's deliberate: it keeps the button looking the same on every site, and stops a stray * { box-sizing: ... } rule from breaking the payment popup. You style it through two surfaces from your own stylesheet: CSS custom properties for colors, fonts, and shape, and ::part() selectors for everything else. No JavaScript involved.
The main variables and parts are documented on the styling guide, with live examples you can click and copy:
Open the interactive styling guide →
The success and cancel URLs
When you connect a card provider such as Stripe on the dashboard's Providers page, you set two URLs:
- Success URL, where the buyer lands after a successful payment. Most static sites just show a generic "Thanks, your payment is processing" message and rely on the dashboard for the source of truth.
- Cancel URL, where the buyer lands if they back out before paying. Often the same as your cart page.
Both URLs are configured per-provider in the dashboard, the element doesn't need to know about them.