Get a summary of unpaid invoices
GET /api/v2/billing/unpaid-summary
Get the account’s unpaid invoices in one call: the total to pay, each invoice with how soon it is due and whether the saved card will pay them automatically. Use it to decide whether to remind someone to pay. uiShouldShow is false when there is nothing to do, for example when the saved card will pay every invoice on its due date. uiSuppressReason says why. An invoice already included in a bulk-payment invoice has isBulkPaymentChild: true and its parent in bulkPaymentParentId. count and totalAmount leave those out. When the invoices cannot be read, the call still answers 200 as if nothing is unpaid (count: 0, uiSuppressReason: no_unpaid_invoices). autoCharge.status is off when the saved card or the setting cannot be read. Read the summary again before you stop reminding someone.
Authentication: An API key with the scope read:billing. About keys and scopes
Example
curl "https://cloud.hostup.se/api/v2/billing/unpaid-summary" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 Unpaid invoices and the automatic card payment state.
{ "totalAmount": 97.5, "currencyCode": "SEK", "count": 1, "uiDisplayKind": "dueSoon", "uiShouldShow": false, "uiSuppressReason": "auto_charge_handles_upcoming", "invoices": [ { "id": "inv_01hxa3b4c5d6e7f8g9h0j1k2m3", "number": "202600001", "amount": 97.5, "currencyCode": "SEK", "dueAt": "2026-05-22T00:00:00.000Z", "dueStatus": "dueSoon", "daysOverdue": null, "daysUntilDue": 5, "isBulkPaymentChild": false, "bulkPaymentParentId": null } ], "autoCharge": { "enabled": true, "method": { "kind": "card", "last4": "8127", "brand": "visa" }, "scheduledAt": "2026-05-22T18:00:00.000Z", "status": "scheduled", "reason": null, "lastAttemptAt": null, "failureKind": null }}Response fields
totalAmountnumbercurrencyCodestringtotalAmount.countintegeruiDisplayKindstringnone when nothing is unpaid. One of overdue, dueSoon, upcoming, none.uiShouldShowbooleanuiSuppressReasonstring or nullno_unpaid_invoices or auto_charge_handles_upcoming. One of no_unpaid_invoices, auto_charge_handles_upcoming.invoicesarray of objectidstringinv_…).numberstring or nullamountnumbercurrencyCodestringamount.dueAtstring or nulldueStatusstringoverdue: past the due date. dueSoon: due today or within 7 days. upcoming: due later. unknown: no due date. One of overdue, dueSoon, upcoming, unknown.daysOverduenumber or nulloverdue.daysUntilDuenumber or nulldueSoon or upcoming.isBulkPaymentChildbooleanbulkPaymentParentIdstring or nullautoChargeobjectenabledbooleanmethodobject or nullscheduledAtstring or nullstatusstringoff: automatic card payment is off or no card is saved. scheduled: the card will be charged on the earliest due date. failed: an invoice is past due although automatic payment was on. The charge did not go through. One of off, scheduled, failed.reasonstring or nullstatus is failed: what went wrong with the card, whether a retry is still coming and what to do. Null otherwise.lastAttemptAtstring or nullstatus is not failed.failureKindstring or nullstatus is failed. unknown when only the overdue invoice shows the failure. Null otherwise. One of card_declined, insufficient_funds, card_expired, authentication_required, unknown.Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | forbidden: the API key lacks read:billing. requiredScopes names it. The same code comes back when the account is not active. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |