Skip to content
Checkout: invoices
POST/v0/links/{id}/invoices

One visit to a payment link: an invoice at the link's price, or the customer's amount

Takes the merchant’s publishable key (pk_), or no key: the link ID is its capability, and a link can only create the invoice the merchant priced, or, on a custom link, one at an amount the customer chose inside the merchant’s bounds. A key must match the link’s account and mode. Body (optional JSON, schema PaymentLinkInvoiceRequest): quantity, amount (custom links, required there), customerEmail.

None. The payment link’s ID is the capability, so this runs in a customer’s browser with no key at all.

  • idRequired · path
  • 201Created; send the customer to url
  • 400A bad quantity or amount, or a key from the other mode
  • 404Unknown or off
  • 422AMOUNT_OUT_OF_RANGE: outside the link's minimum and maximum
  • 429Too many from this IP, or on this custom-amount link
curl
curl https://api.intents.fi/v0/links/plink_Vb3kT9qLmZ2xR8wNc4HfJpYs6dGa1uEo/invoices \
-X POST
TypeScript
const response = await fetch("https://api.intents.fi/v0/links/plink_Vb3kT9qLmZ2xR8wNc4HfJpYs6dGa1uEo/invoices", {
method: "POST",
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();
Python
import httpx
response = httpx.post(
"https://api.intents.fi/v0/links/plink_Vb3kT9qLmZ2xR8wNc4HfJpYs6dGa1uEo/invoices",
)
response.raise_for_status()
data = response.json()
{ "error": { "code": "INVOICE_EXPIRED", "message": "This invoice has expired" } }

Switch on code, not on the message: every code has a page under Error codes. Base URL https://api.intents.fi; the whole reference is on one page.