Invoices API: list top-ups and download a PDF

Read every credited card or crypto top-up as an invoice with its number, amount and method, and fetch any of them as a PDF rendered from your billing details.

Checked 2026-11-22

·API reference·Models

Each top-up that credits your balance comes with an invoice, and two routes under https://api.uplinkswitch.com/v1/invoices read them. A number looks like INV-2026-7: the year, then a counter that starts again for your organization every UTC year. Both routes accept an admin key or a signed-in console session, and a key issued only for model calls cannot open them.

List invoices

GET /v1/invoices answers with data, newest first. Each entry holds:

FieldNotes
numberThe invoice number, such as INV-2026-7.
payment_idId of the payment behind the invoice.
amount_microThe amount paid, in micro-dollars (millionths of a dollar).
refunded_microRefunded later, in micro-dollars, or 0.
bonus_microBonus credit that arrived with the payment; you were not charged for it.
methodEither Card or Crypto.
created_atUnix milliseconds at which the balance was credited.
pdf_urlWhere the PDF lives: /v1/invoices/<number>.pdf.

Every amount comes straight from the payment record, so no figure is written into this page.

Download a PDF

GET /v1/invoices/{invoice_number}.pdf draws the PDF at the moment you request it, using the billing details saved at that time. It shows the seller, the customer, the amount paid, the payment method under the console's name for it, the date and the balance credited, and it is served as application/pdf with an attachment disposition. Since the customer block reads whatever details are current, save the right company, address and tax id in the billing details first, then download.

Status codes

  • 200: the list, or the PDF file.
  • 401 invalid_api_key: neither an accepted key nor a console session came with the request.
  • 404 not_found: that number does not belong to your organization.

Example

bash
curl https://api.uplinkswitch.com/v1/invoices \
  -H "Authorization: Bearer sk-uplink-live-..."

curl https://api.uplinkswitch.com/v1/invoices/INV-2026-1.pdf \
  -H "Authorization: Bearer sk-uplink-live-..." -o INV-2026-1.pdf

The bearer token in both calls is an admin key.

Questions and answers

Only top-ups that really credited the balance, whether by card or by crypto. A failed or still-pending payment gets nothing, and the number is handed out the moment the credit is applied.

Save them as billing details from the console. Each PDF reads those details when it is generated, so your next download prints them under "Bill to"; a file you already saved keeps what it showed.

No. An invoice documents one payment into the account. A statement is the signed monthly summary of what your requests spent, and the statement signing key lets you confirm its signature.
Join on Telegram
Help