TriportRPC

Get invoice

GEThttps://api.triport.io/v1/billing/invoices/inv_8f2c1a7e9b3d4e6f

Fetch a single invoice you own, including its payment address, QR payment URI, and how much has been received so far.

— (per-invoice; the rail/network is returned in the body)

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

idstringrequired
The invoice ID (as returned by POST /v1/billing/invoices or GET /v1/billing/invoices).

Response

200 OK

idstring
Invoice ID.
user_idstring
Owner of the invoice.
amount_micronumber
Amount due, in micro-units (1_000_000 = 1.00 USD).
statusstring
One of pending, paid, expired, cancelled.
descriptionstring
Human-readable line item.
channelstring
Payment channel: crypto-onchain or crypto-inapp.
railstring
Payment rail, e.g. polygon-usdc, sol-spl-usdc, eth-usdt. See GET /v1/billing/rails.
bill_actionobject
What the payment buys: { type, plan, months } where type is subscription_purchase, subscription_renew, or topup.
client_request_idstring
Idempotency key supplied at creation (if any).
fx_rate_micro_per_atomicnumber
FX rate locked at creation, for rails that require one (if any).
reference_pubkeystring
On-chain reference key used to match payments (if any).
created_atstring
ISO-8601 creation time.
expires_atstring
ISO-8601 expiry; after this a pending invoice is swept to expired.
paid_atstring
ISO-8601 time the invoice was marked paid (present once paid).
processed_atstring
ISO-8601 time the bill action was applied (present once processed).
amount_usdstring
amount_micro formatted as a decimal USD string, e.g. "49.00".
addressobject
The single deposit address for this invoice (see below). May be absent if no address has been derived.
qr_uristring
Payment URI for the rail, suitable for rendering a QR code. Absent when the rail is unknown or no address exists.
payments_received_micronumber
Total received so far for this invoice, in micro-units.

Errors

CodeMeaningWhen it happens
401auth requiredNo valid nl_session cookie on the request.
404not foundThe 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://api.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);

TypeScript SDK (@triport/sdk)

import { Triport } from '@triport/sdk';


const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });


const invoice = await triport.billing.invoices.get('inv_8f2c1a7e9b3d4e6f');
console.log(invoice.status);                 // "pending"
console.log(invoice.amountUsd);              // "49.00"
console.log(invoice.address?.address);       // "0x3a1F9C7b..."
console.log(invoice.paymentsReceivedMicro);  // 0

Python (triport-sdk)

import os
from triport import Triport


triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])


invoice = triport.billing.invoices.get("inv_8f2c1a7e9b3d4e6f")
print(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}/events rather than polling this endpoint.
  • amount_usd vs amount_micro. amount_micro is the precise integer amount in micro-units; amount_usd is the same value pre-formatted for display. Compute progress from the *_micro fields, not the string.
  • Address availability. address and qr_uri are 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.