Reference
API v2: links, invoices and reports
Create payment links and invoices, list payments, get reports and check your settings with the Switro API.
Before you start
Use an API v2 key with the permission shown for each request. For stores, use the store API.
- Amounts are in US dollars, from 0.01 to 1,000,000, with up to two decimal places.
- Dates use ISO 8601, such as
2026-12-31T00:00:00Z. - For the lists of links, invoices and payments, use
pageandlimit(up to 100; the default is 20). The answer hasdata,total,pageandlimit. - Unknown fields are refused, so check the spelling.
Try again without duplicates
When you create a link or invoice, send an idempotency_key with 8 to 100 letters, numbers, _ or -. Save it before you send the request. After a timeout, send the same details and key to get the first result.
Never use a key for something else
Payment links
Permission: links:write
| Field | Required | What it is |
|---|---|---|
title | Yes | Up to 120 characters |
amount | Yes | The price in US dollars |
description | No | Up to 500 characters |
expires_at | No | When it stops taking payments. It must be in the future |
currency | No | Only USD |
idempotency_key | No | Prevents duplicates. Always send one |
{
"id": "LINK_ID",
"url": "https://www.switro.com/p/LINK_ID",
"title": "Blue stoneware plates",
"description": "A set of four.",
"amount": "58.00",
"currency": "USD",
"network": "devnet",
"status": "active",
"expires_at": null,
"created_at": "2026-11-29T12:00:00.000Z"
}status is active or expired. amount is null if the customer chooses how much to pay.
Permission: links:read
Permission: links:read
title, description, amount or expires_at that you send. To stop payments, set expires_at to the time now. Use null for no end date. Links for invoices cannot be changed.Permission: links:write
Invoices
Permission: invoices:write
| Field | Required | What it is |
|---|---|---|
customer_name | Yes | Up to 120 characters. Anyone with the link can see it |
items | Yes | 1 to 100 items |
items[].description | Yes | Up to 200 characters |
items[].quantity | Yes | A whole number, from 1 to 10,000 |
items[].unit_amount | Yes | The price of one, in US dollars |
customer_email | No | Only for you. Nothing is sent to it |
notes | No | Private notes, up to 1,000 characters |
due_at | No | When it should be paid. It can still be paid later |
expires_at | No | When it stops taking payments. It must be in the future |
currency | No | Only USD |
idempotency_key | No | Prevents duplicates. Always send one |
The answer also has id, number, status, url, payment_link_id, total and created_at. Send url to your customer.
Permission: invoices:read
Permission: invoices:read
Permission: invoices:write
Payments
Permission: payments:read
| Field | Required | What it is |
|---|---|---|
status | No | initiated, confirmed or failed |
payment_link_id | No | Payments for one link or invoice |
from, to | No | Only payments between these dates |
page, limit | No | Which page, and how many payments on each |
Permission: payments:read
Each payment has id, status, type, network, amount_usd, paid_currency (what the customer paid with), settlement_currency (what you received), payment_link_id, checkout_id, transaction_signature, transaction_url, created_at, confirmed_at and customer_provided. Only confirmed means paid.
Customers type customer_provided themselves
Reports
Permission: reports:read
You can choose the dates with from and to. The answer has network, from, to, currency, confirmed_payments, total, by_settlement_currency and by_day.
These totals are not accounting or tax advice. Refunds you send are not included.
Settings
Permission: config:read
Permission: config:read
Permission: config:write
| Field | Required | What it is |
|---|---|---|
name | No | Your business name, up to 120 characters |
description | No | Up to 500 characters |
webhook_url | No | A public https address. Send an empty value to turn webhooks off |
success_url, cancel_url | No | Where customers go after checkout, if a checkout has no addresses of its own |
convert_to_usdc | No | Use true to turn SOL payments into USDC. This only works on mainnet |
buyer_pays_fee | No | Use true to add Switro's fee to what the customer pays, or false to take it from what you receive |