Get invoice
Fetch a single invoice you own, including its payment address, QR payment URI, and how much has been received so far.
https://triport.io/v1/billing/invoices/inv_8f2c1a7e9b3d4e6f- Network
- — (per-invoice; the rail/network is returned in the body)
- Auth
- Session cookie (nl_session)
Returns the full state of one invoice belonging to the authenticated user. Use it
to render an invoice/checkout screen: the response carries the canonical
status, the deposit address for the chosen rail, a ready-to-render qr_uri,
and payments_received_micro so you can show progress toward the amount due.
This is the snapshot endpoint. For a live feed of status changes (payment
detected, paid, expired, cancelled) open the SSE stream at
GET /v1/billing/invoices/{id}/events instead of polling
this route.
Invoices are scoped to their owner. Requesting an id that does not exist — or
one that belongs to another user — returns 404 (the API does not distinguish
the two cases, so it never leaks the existence of someone else's invoice).
Parameters
Path parameters
idstringrequiredPOST /v1/billing/invoices or GET /v1/billing/invoices).Response
200 OK
idstringuser_idstringamount_micronumber1_000_000 = 1.00 USD).statusstringpending, paid, expired, cancelled.descriptionstringchannelstringcrypto-onchain or crypto-inapp.railstringbill_actionobject{ type, plan, months } where type is subscription_purchase, subscription_renew, or topup.client_request_idstringfx_rate_micro_per_atomicnumberreference_pubkeystringcreated_atstringexpires_atstringpending invoice is swept to expired.paid_atstringprocessed_atstringamount_usdstringamount_micro formatted as a decimal USD string, e.g. "49.00".addressobjectqr_uristringpayments_received_micronumberpayer_addressstringpayer_linkedbooleanErrors
| Code | Meaning | When it happens |
|---|---|---|
401 | auth required | No valid nl_session cookie on the request. |
404 | not found | The invoice does not exist, or it is not owned by the requesting user. |
All errors share the standard envelope { "error": "<message>" }. See
errors.md for the full error model.
Examples
JavaScript (fetch)
async function getInvoice(id) {
const r = await fetch(`https://triport.io/v1/billing/invoices/${id}`, {
headers: { 'Content-Type': 'application/json' },
credentials: 'include', // send the nl_session cookie
});
if (!r.ok) {
const body = await r.json().catch(() => ({}));
throw new Error(body.error || `HTTP ${r.status}`);
}
return r.json();
}
const invoice = await getInvoice('inv_8f2c1a7e9b3d4e6f');
console.log(invoice.status, invoice.amount_usd, invoice.address?.address);Notes
- Snapshot, not a stream. To react to payment in real time, subscribe to
GET /v1/billing/invoices/{id}/eventsrather than polling this endpoint. amount_usdvsamount_micro.amount_microis the precise integer amount in micro-units;amount_usdis the same value pre-formatted for display. Compute progress from the*_microfields, not the string.- Address availability.
addressandqr_uriare present for a normal per-rail invoice. If they are missing, the rail/address has not been resolved yet — re-fetch shortly or check the invoice was created against a valid rail. - Related endpoints: list invoices, create invoice, cancel invoice, pay from balance.