Add a payment button to your website

Two lines of code. Copy, paste, and start accepting payments.

mystore.com
Products · About · Contact
📱

Accessories

Slim Phone Case

Matte black finish with shockproof edges.
Ultra-slim design that fits most iPhone and Android models.
Raised bezels protect your screen and camera.

In Stock

Price

$1.99

index.html
<body>
  <nav>MyStore</nav>

  <div class="product">
    <img src="phone-case.jpg">
    <h2>Slim Phone Case</h2>
    <p class="price">$1.99</p>
    <button>Buy Now</button>
  </div>

</body>
<body>
  <nav>MyStore</nav>

  <div class="product">
    <img src="phone-case.jpg">
    <h2>Slim Phone Case</h2>
    <p class="price">$1.99</p>
    <button>Buy Now</button>
  </div>

  <!-- Load Fivo -->
  <script src="https://checkout.fivo.finance/v1/fivo.js"></script>
</body>
<body>
  <nav>MyStore</nav>

  <div class="product">
    <img src="phone-case.jpg">
    <h2>Slim Phone Case</h2>
    <p class="price">$1.99</p>
    <fivo-button
      merchant-id="your_merchant_id"
      amount="1.99"
      currency="USDC">
    </fivo-button>  </div>
  <script src="https://checkout.fivo.finance/v1/fivo.js"></script>
</body>

Integration Guide

1 What you need

To accept crypto payments on your website, you only need two things: a script that loads the Fivo widget, and a button element where your customers will click to pay. You don't need API keys, a backend server, or any configuration files.

2 How to add it to your website

  1. Copy the Fivo script line and paste it at the bottom of your page, just before the closing body tag
  2. Place a payment button wherever you want it to appear on your page
  3. Set three things on the button: your merchant ID, the price, and the currency (USDC or EURC)
  4. That's it. Your page now has a working crypto payment button

3 Three ways to set the price

  1. Fixed price — You set the exact amount. The customer pays that price. Best for products.
  2. Customer chooses — You don't set a price. The customer types how much they want to pay. Best for donations.
  3. Read from your page — The button reads the price from another element on your page, like a shopping cart total. Best for online stores with a cart.

4 What happens when a customer pays

  1. Customer clicks "Pay with Fivo"
  2. A checkout window opens on your page
  3. Customer connects their crypto wallet (MetaMask, Rainbow, Coinbase Wallet, etc.)
  4. They choose which blockchain to pay from
  5. If paying from a different chain, Fivo bridges the payment automatically
  6. Payment completes — you receive USDC or EURC directly in your Fivo wallet

5 Where does the money go?

Payments arrive directly in your Fivo wallet. From your dashboard you can view every transaction, download invoices, and withdraw your funds at any time.

6 Supported blockchains and currencies

Your customers can pay from 9 different blockchains: Ethereum, Base, Polygon, Arbitrum, Optimism, Avalanche, Linea, Unichain, and Sonic. If the customer pays from a different chain than yours, Fivo bridges the payment automatically — no extra setup needed.

Two currencies are supported: USDC (pegged to the US dollar) and EURC (pegged to the Euro). Both are issued by Circle, one of the most trusted companies in crypto.

7 Testing before going live

  1. Create a free account at test.fivo.finance to get your testnet merchant ID
  2. Use the testnet version of the script — it works exactly like the real one, but with fake money
  3. Get free test USDC from faucet.circle.com
  4. Make as many test payments as you want to see the full experience
  5. When everything works, switch to your real merchant ID and the production script. That's the only thing that changes

8 Want to go deeper?

This demo covers the basics. For advanced features like webhooks, checkout sessions via API, refunds, and more, visit the full documentation.

Studio Headphones on wooden desk
Best Seller

Studio Headphones

Premium wireless headphones with active noise cancellation. Ultra-comfortable over-ear design, perfect for music production and everyday listening.

Noise Cancellation 40h Battery Bluetooth 5.3
$9.99 USDC

No fees for the buyer. 0.5% fee on withdrawal only.

This is a testnet demo. Click the pay button above to see the full Fivo checkout experience. No real money is involved. You'll need free test USDC from Circle Faucet to complete a payment.

How to add a product button

Load the Fivo script once, then place a <fivo-button> wherever you want. Set the price with amount and the currency with currency.

product.html
<body>
  <!-- Load Fivo once -->
  <script src="https://checkout.fivo.finance/v1/fivo.js"></script>

  <!-- Your product page -->
  <div class="product">
    <img src="headphones.jpg">
    <h2>Studio Headphones</h2>
    <p class="price">$9.99</p>

    <!-- Fivo payment button -->
    <fivo-button
      merchant-id="your_merchant_id"
      amount="9.99"
      currency="USDC">
    </fivo-button>
  </div>

</body>

Common Questions

What does my customer see when they click the button?

A checkout window opens right on your page. No redirects, no new tabs. Your customer connects their wallet, picks which blockchain to pay from, and confirms. The whole process takes a few seconds.

How does Fivo know the correct price?

You set the price directly on the button with the amount attribute. Fivo validates the exact amount on the blockchain before confirming. If someone tries to pay a different amount, the payment won't go through.

What currencies and blockchains are supported?

Fivo supports two stablecoins: USDC and EURC. USDC is available on all 9 networks (Ethereum, Base, Polygon, Arbitrum, Optimism, Avalanche, Linea, Unichain, and Sonic). EURC is available on Ethereum, Base, and Avalanche. Your customer picks whichever network they have funds on.

What if my customer pays from a different blockchain than mine?

For USDC payments, Fivo moves the funds automatically using Circle's cross-chain bridge. Same-chain payments are instant. Cross-chain payments typically take about a minute. Your customer sees real-time progress the entire time.

Where does the money go?

Directly to your wallet as USDC or EURC. No intermediaries, no holding periods. You see the payment in your Fivo dashboard immediately and get an email notification.

Is this the right method for me?

If you sell a product or service with a set price, yes. If you want your customer to choose how much to pay, check the Donation tab. If you have multiple products on one page, check Multiple. If you need a shopping cart, check Cart.

Studio Headphones

Studio Headphones

$4.99

Leather Notebook

Leather Notebook

$2.99

Smart Watch

Smart Watch

$3.99

Ceramic Mug Set

Ceramic Mug Set

$1.99

Designer Sunglasses

Designer Sunglasses

$5.49

Desk Lamp

Desk Lamp

$1.49

Your Cart 0

Your cart is empty.
Click "Add to Cart" on any product.

This is a testnet demo. No real money is involved. Add items to the cart, adjust quantities, and click the Fivo button to test the full checkout flow. The button reads the cart total automatically using data-amount-from.

How to connect Fivo to your cart

The key attribute is data-amount-from. It takes a CSS selector pointing to the element that contains your cart total. Fivo reads the amount when the customer clicks, so it always uses the latest total.

cart.html
<body>
  <!-- Load Fivo once -->
  <script src="https://checkout.fivo.finance/v1/fivo.js"></script>

  <!-- Your cart (any HTML structure) -->
  <div class="cart">
    <div class="item">Headphones — $4.99</div>
    <div class="item">Smart Watch — $3.99</div>

    <!-- This element holds the total -->
    <p id="cart-total">$8.98</p>

    <!-- Fivo reads from #cart-total at click time -->
    <fivo-button
      merchant-id="your_merchant_id"
      data-amount-from="#cart-total"
      currency="USDC">
    </fivo-button>
  </div>

</body>

Common Questions

How does Fivo know the cart total?

You add data-amount-from="#cart-total" to the button. This tells Fivo to read the amount from the HTML element with id="cart-total". It accepts any CSS selector, so .total-price, [data-total], or any other selector works too.

What if the customer changes their cart?

Fivo reads the amount at the moment the customer clicks the button, not when the page loads. So if they add or remove items and the total changes, the button will always use the current total.

Does it work with my cart system?

Yes. It works with any cart: Shopify, WooCommerce, custom JavaScript, or plain HTML. The only requirement is that the cart total is visible on the page in a text element. Fivo reads the text content, strips dollar signs and commas, and uses the number.

What if the total element is an input field?

Fivo handles that too. If the element is an <input>, <select>, or <textarea>, Fivo reads the value property instead of the text content.

Can I combine cart buttons with individual product buttons?

Yes. You can have a cart button that reads the total and also individual product buttons with fixed amounts on the same page. They all work independently. This is covered in the Multiple tab.

How do I find the right CSS selector for my cart?

Right-click your cart total on your website and select "Inspect". The browser will highlight the HTML element. Look for an id attribute and use #that-id as the selector. If there's no ID, use a class name with .that-class.

Children by a water pump in a village NGO

Clean Water Initiative

Help us bring clean drinking water to communities in need. 100% of donations go directly to water projects.

Content creator with microphone and headphones Creator

Support a Creator

Help independent podcasters, artists, and educators keep creating. Choose any amount you want.

Developers collaborating on code Open Source

Open Source Fund

Fund the software projects you depend on. Developers receive contributions directly, no middlemen.

Volunteer with badge ready to help Relief

Emergency Relief

Provide immediate help to communities affected by natural disasters. Every second counts.

What makes it a donation button?

The only difference is removing the amount attribute. Without it, the checkout opens in flexible mode and your supporter chooses how much to give.

Product (fixed price)
<fivo-button
  merchant-id="your_id"
  amount="29.99"
  currency="USDC">
</fivo-button>
Donation (flexible amount)
<fivo-button
  merchant-id="your_id"
  currency="USDC">
</fivo-button>

This is a testnet demo. No real donations are processed. Use free test USDC from Circle Faucet to try the full checkout flow.

Transparent

Every donation is verifiable on the blockchain. Donors can see exactly where their money went.

Global

Accept donations from anywhere in the world. No bank account needed, no currency conversion fees.

Instant

Funds arrive in seconds. No processing delays, no holds, no waiting days for settlement.

Common Questions

How does the donor choose the amount?

When someone clicks the button, the Fivo checkout opens with an amount field. The donor types how much they want to give, picks a network, and confirms. You don't need to set any amount on your side.

Are there fees for the donor?

No. The donor pays only their network gas fee (usually a few cents). Fivo charges a 0.5% fee to you when you withdraw funds, not to the donor.

Can I accept donations from any country?

Yes. Stablecoin payments are borderless. Anyone with a crypto wallet and USDC or EURC can donate, regardless of their location. No bank account or currency conversion needed.

What currencies can donors use?

USDC (available on 9 blockchains) and EURC (available on Ethereum, Base, and Avalanche). You choose which one to accept by setting currency="USDC" or currency="EURC" on the button.

How do I know when someone donates?

Every donation appears instantly in your Fivo dashboard under Transactions. You also receive an email notification for each payment. For automation, you can set up webhooks to get notified in real time.

Can I add preset amounts on my page?

Yes. You can build your own preset buttons ($5, $10, $25) and use the data-amount-from attribute to pass the selected value to the Fivo button. The Quick Start tab shows how this attribute works.

Demo Store

Each product has its own pay button. Click any of them to open the checkout for that specific item.

Studio Headphones

Studio Headphones

Over-ear studio monitors with premium sound

Leather Notebook

Leather Notebook

Handmade spiral journal, 200 blank pages

Smart Watch

Smart Watch

Fitness tracker with heart rate and GPS

Ceramic Mug Set

Ceramic Mug Set

Set of 3 handcrafted artisan coffee mugs

Designer Sunglasses

Designer Sunglasses

Wood-accented frames with UV400 lenses

Desk Lamp

Desk Lamp

Modern orb lamp with warm ambient light

This is a testnet demo. No real money is involved. Each button opens an independent checkout for that product's price and currency. You load the Fivo script once, then place as many buttons as you need.

How to add multiple buttons

Load the script once at the top of your page. Then place a <fivo-button> next to each product. Each button works independently with its own price and currency.

store.html
<body>
  <!-- Load Fivo once -->
  <script src="https://checkout.fivo.finance/v1/fivo.js"></script>

  <!-- Product 1 — pays in USDC -->
  <div class="product">
    <h2>Studio Headphones</h2>
    <p class="price">$9.99</p>
    <fivo-button
      merchant-id="your_merchant_id"
      amount="9.99"
      currency="USDC">
    </fivo-button>
  </div>

  <!-- Product 2 — pays in EURC -->
  <div class="product">
    <h2>Leather Notebook</h2>
    <p class="price">€2.99</p>
    <fivo-button
      merchant-id="your_merchant_id"
      amount="2.99"
      currency="EURC">
    </fivo-button>
  </div>

  <!-- Product 3 — different price, back to USDC -->
  <div class="product">
    <h2>Desk Lamp</h2>
    <p class="price">$4.99</p>
    <fivo-button
      merchant-id="your_merchant_id"
      amount="4.99"
      currency="USDC">
    </fivo-button>
  </div>

</body>

Common Questions

Do I need to load the script multiple times?

No. You load the Fivo script once anywhere on your page. Every <fivo-button> element on the page will work automatically. Adding 50 products means 50 buttons but still just one script tag.

Can each product have a different currency?

Yes. Set currency="USDC" on some buttons and currency="EURC" on others. Each button is completely independent. You can even mix fixed-price buttons with flexible-amount buttons on the same page.

What happens when a customer clicks a button?

The checkout opens for that specific product only. The amount and currency are locked to what you set on that button. If the customer goes back and clicks a different product, a new checkout opens with that product's price.

Can I combine this with a shopping cart?

Yes. You can have individual product buttons for quick purchases and also add a cart button that reads the total from your page using the data-amount-from attribute. Both approaches work on the same page without conflicts. Check the Cart tab for details.

Is there a limit on how many buttons I can add?

No. The Fivo script uses Web Components, which are extremely lightweight. Each button is an independent HTML element. You can add as many as your page needs with no performance impact.

Do I need a backend for this?

No. This is 100% client-side. Just HTML. No server, no API calls, no database. The Fivo widget handles the entire payment flow: wallet connection, chain selection, and transaction confirmation.

yourstore.com/checkout

Order Summary

Wireless Headphones Qty: 1 · Black
$4.99
Phone Case Qty: 2 · Clear
$1.98
USB-C Cable Qty: 1 · 2m
$0.99

Subtotal $7.96
Shipping Free
Total $7.96

Click the button to see the real Fivo checkout. In a real integration, your customer would be redirected to this same checkout on a hosted page.

How it works behind the scenes

In the demo above, the button is embedded directly. In a real e-commerce integration, your server controls the flow using the Checkout Sessions API:

1

Create a session

Your server calls the API with amount, currency, and return URL. Fivo returns a checkout URL.

2

Customer pays

You redirect the customer to that URL. They connect their wallet and pay on Fivo's hosted page.

3

Verify & fulfill

Customer returns to your site. Your server checks the session status and fulfills the order.

Integration code

Two endpoints are all you need. One to create the session, one to verify the payment.

// Step 1: Create checkout session
app.post('/checkout', async (req, res) => {
  const response = await fetch('https://api.fivo.finance/checkout/sessions', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': process.env.FIVO_API_KEY,
    },
    body: JSON.stringify({
      amount: '49.99',
      currency: 'USDC',
      return_url: 'https://yoursite.com/success',
      metadata: { order_id: '12345' },
    }),
  });

  const { data } = await response.json();
  res.redirect(303, data.url);
});

// Step 3: Verify payment
app.get('/success', async (req, res) => {
  const check = await fetch(
    `https://api.fivo.finance/checkout/sessions/${req.query.session}`,
    { headers: { 'X-API-Key': process.env.FIVO_API_KEY } }
  );

  const { data } = await check.json();
  if (data.status === 'complete') {
    // Payment confirmed — fulfill the order
    res.send('Payment confirmed!');
  }
});
# Step 1: Create checkout session
import requests
from flask import Flask, redirect, request

app = Flask(__name__)

@app.route('/checkout', methods=['POST'])
def checkout():
    response = requests.post(
        'https://api.fivo.finance/checkout/sessions',
        headers={
            'Content-Type': 'application/json',
            'X-API-Key': FIVO_API_KEY,
        },
        json={
            'amount': '49.99',
            'currency': 'USDC',
            'return_url': 'https://yoursite.com/success',
            'metadata': {'order_id': '12345'},
        },
    )
    data = response.json()['data']
    return redirect(data['url'], code=303)

# Step 3: Verify payment
@app.route('/success')
def success():
    session = requests.get(
        f'https://api.fivo.finance/checkout/sessions/{request.args["session"]}',
        headers={'X-API-Key': FIVO_API_KEY},
    )
    data = session.json()['data']
    if data['status'] == 'complete':
        # Payment confirmed — fulfill the order
        return 'Payment confirmed!'
# Step 1: Create checkout session
curl -X POST https://api.fivo.finance/checkout/sessions \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "49.99",
    "currency": "USDC",
    "return_url": "https://yoursite.com/success",
    "metadata": { "order_id": "12345" }
  }'

# Response:
# {
#   "data": {
#     "id": "cs_test_abc123...",
#     "url": "https://checkout.fivo.finance?session=cs_test_abc123..."
#   }
# }

# Step 3: Verify payment
curl https://api.fivo.finance/checkout/sessions/cs_test_abc123 \
  -H "X-API-Key: your_api_key"

# Response:
# {
#   "data": {
#     "status": "complete",
#     "payment": { "amount": "49.99", "tx_hash": "0x..." }
#   }
# }
This integration requires a backend. Unlike the widget (which works with just HTML), the Checkout Sessions API needs your server to create sessions and verify payments. Get your API key from the API Integration Guide.

Common Questions

When should I use the API instead of the widget?

Use the API when you need backend control over the checkout process — for example, validating stock before creating a payment, linking payments to orders in your database, or building a custom checkout flow. If you just need a payment button on a page, the widget is simpler.

Do I need a backend to use this?

Yes. The Checkout Sessions API requires an API key, which must stay on your server (never expose it in frontend code). Your server creates the session, and your server verifies the payment. The customer-facing checkout page is hosted by Fivo.

What languages and frameworks are supported?

Any language that can make HTTP requests. The API is a standard REST API. The examples above show Node.js (Express), Python (Flask), and cURL. You can use PHP, Ruby, Go, Java, or any other server-side language.

How do I verify that a payment was completed?

After the customer pays, Fivo redirects them to your return_url with a ?session=cs_test_... query parameter. Your server calls GET /checkout/sessions/{id} with your API key. If status is "complete", the payment is confirmed.

Can I attach order data to a session?

Yes. Use the metadata field to store up to 5 key-value pairs (like order ID, customer ID, or product SKU). This data is returned when you verify the session, so you can link the payment to your order.

What happens if the session expires?

Sessions expire after 30 minutes by default (configurable from 1 minute to 24 hours via expires_in). If a customer tries to pay after expiry, they see an error. You can create a new session and redirect them again.