Checkout: invoices
POST
/v0/links/{id}/invoicesOne 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.
Authentication
Section titled “Authentication”None. The payment link’s ID is the capability, so this runs in a customer’s browser with no key at all.
Parameters
Section titled “Parameters”idRequired · path
Responses
Section titled “Responses”- 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
Request
Section titled “Request”curl https://api.intents.fi/v0/links/plink_Vb3kT9qLmZ2xR8wNc4HfJpYs6dGa1uEo/invoices \ -X POSTconst 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();import httpx
response = httpx.post( "https://api.intents.fi/v0/links/plink_Vb3kT9qLmZ2xR8wNc4HfJpYs6dGa1uEo/invoices",)response.raise_for_status()data = response.json()Errors
Section titled “Errors”{ "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.