Payments
Payment Links
Accept payments without writing code. Share a link in a bio, a WhatsApp chat, an email or an invoice — or print its QR code.
How links work#
A payment link is a reusable, static checkout at /pay/l/{slug}. Every visit creates a fresh payment intent on the server, with its own reference key and expiry, and then shows hosted checkout. Each payment is tracked, verified and webhooked exactly like an API-created one (source: "payment_link").
| Payment link | API payment intent | |
|---|---|---|
| Created by | Dashboard or API, once | Your server, per order |
| Amount | Fixed, or chosen by the customer within min/max | Set per payment |
| Best for | Products, tips, donations, events, invoices | Carts, subscriptions, dynamic orders |
Create a link#
In the dashboard: Payments → Payment links → New link. Or through the API:
const link = await muny.paymentLinks.create({
name: "Lifetime Course",
description: "Access to the course",
amount: "500", // omit for "customer chooses"
collect_email: true,
success_url: "https://creatorhub.io/welcome",
metadata: { product: "course_lifetime" },
});
console.log(link.url); // https://muny.io/pay/l/lifetimecourseCustomer-chosen amount, with bounds:
await muny.paymentLinks.create({
name: "Support a creator",
min_amount: "5",
max_amount: "10000",
});- For fixed-price links the price is always taken from the link on the server; a modified client request can't change it.
- Optional:
collect_email,collect_name,expires_at,success_url,metadata(copied onto every payment).
Manage links#
await muny.paymentLinks.update(link.id, { amount: "450" });
await muny.paymentLinks.disable(link.id); // visitors see "no longer active"
await muny.paymentLinks.enable(link.id);
const copy = await muny.paymentLinks.duplicate(link.id);
// Payments made through a link
const { data } = await muny.payments.list({ payment_link_id: link.id });Each link reports stats.payments and stats.volume. In the dashboard you can copy the link, download its QR code, disable it, duplicate it and see its payments.
Request a payment#
For one-off requests (an in-person sale, an invoice), use Payments → Request payment in the dashboard: enter an amount and a description and Muny generates a payment intent with a QR code and a shareable checkout URL.
Endpoints#
POST /v1/payment-links·GET /v1/payment-links·GET /v1/payment-links/:id·PATCH /v1/payment-links/:idPOST /v1/payment-links/:id/disable·/enable·/duplicate- Public:
GET /v1/checkout/links/:slugandPOST /v1/checkout/links/:slug(starts a checkout). See Hosted Checkout.