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.
Creating a link
Create links in the dashboard, on the merchant's Payment Links tab.
| Field | Notes |
|---|---|
title | Shown to the customer at checkout. Up to 255 characters. |
currency | A 3-letter fiat code such as USD. This is the currency the price is quoted in; the customer still pays in crypto. |
amountMinor | A fixed price in minor units (4900 = $49.00). Omit it if the customer chooses the amount. |
allowCustomAmount | When true, the customer enters the amount at checkout (pay-what-you-want, donations, invoices). |
expiresAt | Optional. 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.
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).
onSuccessfires 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.onClosefires 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-baseon 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:
| Endpoint | What it does |
|---|---|
POST /v1/checkout/:linkId/payments/wallet | Creates a pending payment for a chosen payCurrency and returns the address, amount and quote deadline. |
POST /v1/checkout/payments/:paymentId/wallet-tx | Tells Axle which txHash to watch once the customer's wallet has broadcast the transaction. |
GET /v1/checkout/payments/:paymentId | Polled 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 returnscustom_amount_required.
Base URL for these endpoints: https://axle-production-fa2b.up.railway.app.