Guides
Create an invoice
Bill a customer for a list of items, then send them a link to pay with USDC or SOL. Use the dashboard or the API.
In the dashboard
Add the customer and items
Open Invoices, then create a new invoice. Switro adds up the total.

The form and preview. Shown with sample data. Send the link yourself
Switro does not email invoices
Copy the payment link and send it to your customer. Adding their email address does not send them anything.
The payment link and QR code to send. Shown with sample data. Check what your customer sees

The invoice payment page. Shown with sample data. Anyone with the link can see the invoice
This includes the customer's name, items and dates. It does not include their email address or your private notes. Do not put anything private in an item's description.
With the API
You need Node.js 22 or later, your Solana wallet in the devnet settings, and an API v2 key with the invoices:write permission. Save connect.mjs, then get a devnet key:
node connect.mjs invoices.env invoices:writeSave this sample in the same folder:
// Needs an API v2 key with the invoices:write permission.
const API = process.env.SWITRO_API_URL ?? "https://www.switro.com/api";
const DAY = 24 * 60 * 60 * 1000;
const response = await fetch(`${API}/v2/invoices`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SWITRO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
customer_name: "Sample Cafe",
due_at: new Date(Date.now() + 14 * DAY).toISOString(),
items: [
{ description: "Blue stoneware plates", quantity: 6, unit_amount: 58 },
{ description: "Delivery", quantity: 1, unit_amount: 18 },
],
// Use your own invoice or order ID here. Never use it for another invoice.
idempotency_key: "cafe-invoice-0001",
}),
});
const invoice = await response.json();
if (!response.ok) throw new Error(`Switro answered ${response.status}: ${invoice.message}`);
console.log(`${invoice.number}: $${invoice.total}, ${invoice.status}`);
console.log(`Send this link to your customer: ${invoice.url}`);Then run it:
node --env-file=invoices.env create-invoice.mjsUse your own invoice or order ID as the idempotency_key. If you try again with the same key, you get the same invoice, not a second one. See every field in the API reference.
Invoice status
| Status | What it means |
|---|---|
open | It can be paid |
overdue | The due date has passed, but it can still be paid |
paid | A payment is confirmed |
expired | Its expiry date has passed, so it can no longer be paid |
void | You cancelled it. This cannot be undone |
due_at only shows when to pay. To stop payments after a date, use expires_at.


