Accepting payments

Payment links & checkout.

A payment link is a reusable checkout URL. Customers open it, choose a currency, and pay from their own wallet. You can also open the same checkout as a modal on your own site.

Create links in the dashboard, on the merchant's Payment Links tab.

FieldNotes
titleShown to the customer at checkout. Up to 255 characters.
currencyA 3-letter fiat code such as USD. This is the currency the price is quoted in; the customer still pays in crypto.
amountMinorA fixed price in minor units (4900 = $49.00). Omit it if the customer chooses the amount.
allowCustomAmountWhen true, the customer enters the amount at checkout (pay-what-you-want, donations, invoices).
expiresAtOptional. After this time the link stops accepting payments.

A link gives you a hosted checkout URL. You can deactivate a link at any time from the dashboard.

checkout url
https://web-production-3b1f8.up.railway.app/pay/<linkId>

How the customer is quoted

When the customer picks a currency, Axle converts your fiat price to crypto at the current market rate and shows the exact amount to send. That quote is locked for 20 minutes so the amount doesn't move while they pay. Rates come from CoinGecko and are cached for 30 seconds.

Embedding checkout

Open the real checkout as a modal over your own page, so the customer never leaves. It's a single dependency-free script. You need an existing payment link's ID (or its full checkout URL).

html
<script src="https://web-production-3b1f8.up.railway.app/checkout-sdk.js"></script>

<script>
  document.getElementById("buy-button").addEventListener("click", function () {
    Axle.openCheckout({
      linkId: "<linkId>",
      onSuccess: function (payment) {
        console.log("Paid", payment.id, payment.amountMinor, payment.currency);
      },
      onClose: function () {
        console.log("Checkout closed");
      },
    });
  });
</script>
  • onSuccess fires when checkout reports a successful payment. Treat it as a UI signal only, and confirm fulfilment from a webhook or by reading the payment on your server before shipping anything.
  • onClose fires whenever the modal closes: the × button, the backdrop, Esc, or Done after a successful payment.
  • If the script isn't served from the same domain as Axle's dashboard, set data-axle-base on the script tag to point at it.

Under the hood

The hosted and embedded checkout call three public endpoints. They're unauthenticated (a customer has no API key) and rate limited to 30 requests per minute. You don't normally call them yourself, but they're useful to understand:

EndpointWhat it does
POST /v1/checkout/:linkId/payments/walletCreates a pending payment for a chosen payCurrency and returns the address, amount and quote deadline.
POST /v1/checkout/payments/:paymentId/wallet-txTells Axle which txHash to watch once the customer's wallet has broadcast the transaction.
GET /v1/checkout/payments/:paymentIdPolled by checkout. Each call re-checks the chain for a pending payment.

Requirements for a link to accept payments

  • The merchant has connected a payout wallet, otherwise merchant_wallet_not_connected.
  • The link hasn't expired, otherwise payment_link_expired.
  • The link has a fixed amount or allows a custom one. Sending an amount for a fixed link returns custom_amount_not_allowed; omitting it for a custom link returns custom_amount_required.

Base URL for these endpoints: https://axle-production-fa2b.up.railway.app.