Skip to content

Docs

Pay button

The only thing you put on your site: a «Pay with Stabletally» button. On tap, the payer goes to the hosted payment page and pays in stablecoins (USDC and USDT) straight to your wallet. No checkout runs inside your site.

Snippet

index.html
<script src="https://www.stabletally.com/pay.js" async></script>
<stabletally-pay merchant="your-slug" amount="49.00" description="Pro plan"></stabletally-pay>

Replace your-slug with yours. The button opens /pay/link with that amount. It weighs under 2 KB.

With an invoice

html
<!-- invoice created on your server with POST /v1/invoices -->
<stabletally-pay invoice="inv_7kq3m9x2abcd4efg" lang="es"></stabletally-pay>

For orders with status and webhooks, create the invoice on your server and pass its id.

Attributes

invoiceEither
An inv_… id created on your server. Goes to /pay/i/inv_….
merchantOr
Your public slug.
amountWith merchant
Amount with up to 2 decimals, e.g. "49.00". With merchant.
descriptionOptional
What is being paid, e.g. "Pro plan" (140 chars). With merchant.
chainOptional
Fix the network: base, polygon, ethereum or bsc.
langOptional
es or en. Defaults to the page language.
themeOptional
light, dark or auto.
blockOptional
Full-width button.

No button: redirect from your server

node
// Server side: create the invoice, then redirect the payer to the hosted page.
const invoice = await fetch('https://api.stabletally.com/v1/invoices', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.STABLETALLY_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': `order_${order.id}`,
  },
  body: JSON.stringify({ amount: '49.00', description: 'Pro plan', metadata: { orderId: order.id } }),
}).then((r) => r.json());

return Response.redirect(invoice.hostedUrl, 303); // https://www.stabletally.com/pay/i/inv_…

Confirm the payment with the invoice.paid webhook, never with the browser coming back.