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.
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:
| Field | Notes |
|---|---|
number | The invoice number, such as INV-2026-7. |
payment_id | Id of the payment behind the invoice. |
amount_micro | The amount paid, in micro-dollars (millionths of a dollar). |
refunded_micro | Refunded later, in micro-dollars, or 0. |
bonus_micro | Bonus credit that arrived with the payment; you were not charged for it. |
method | Either Card or Crypto. |
created_at | Unix milliseconds at which the balance was credited. |
pdf_url | Where 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
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.pdfThe bearer token in both calls is an admin key.