Get unpaid-invoices summary

GET /api/v2/billing/unpaid-summary

Get a summary of the account's unpaid invoices: the total outstanding amount, one entry per unpaid invoice with due-date status, and whether a saved card will settle them automatically (autoCharge).

Invoices already covered by a bulk-payment invoice are flagged with isBulkPaymentChild and their parent's ID.

uiShouldShow, uiDisplayKind, and uiSuppressReason say whether a payment reminder needs the customer's attention at all — for example, everything upcoming may already be handled by automatic card charging.

Billing & Orders Billing

Authentication

Required API scope: read:billing

Authenticate with an API key in the Authorization: Bearer <token> header.

Context

Headers

Authorization Bearer <token>
Accept application/json

Responses

200 Summary of unpaid invoices and automatic-charge status.
totalAmount number

Total outstanding amount across unpaid invoices, in major units of currencyCode.

currencyCode string

ISO-4217 currency code for totalAmount.

count integer
uiDisplayKind string · enum
overdue
dueSoon
upcoming
none
uiShouldShow boolean
uiSuppressReason string · nullable · enum

no_unpaid_invoices
auto_charge_handles_upcoming
invoices array<object>
invoices[].id string
invoices[].number string · nullable

Nullable: may be null when not applicable.

invoices[].amount number

Outstanding amount for this invoice (not the invoice total), in major units of currencyCode.

invoices[].currencyCode string

ISO-4217 currency code for amount.

invoices[].dueAt string · nullable

Nullable: may be null when not applicable.

invoices[].dueStatus string · enum
overdue
dueSoon
upcoming
unknown
invoices[].daysOverdue number · nullable

Nullable: may be null when not applicable.

invoices[].daysUntilDue number · nullable

Nullable: may be null when not applicable.

invoices[].isBulkPaymentChild boolean
invoices[].bulkPaymentParentId string · nullable

Nullable: may be null when not applicable.

autoCharge object

Always present. Whether a saved card will settle unpaid invoices automatically — and whether the last automatic attempt actually went through. status is authoritative: scheduled means the next charge is ahead, failed means an invoice is past due while a card was armed, so the automatic charge did not go through and the customer must replace the card or pay another way.

autoCharge.enabled boolean required

true when automatic card charging is on and a payment method is saved.

autoCharge.method object · nullable required

The payment method that will be charged; null when auto-charge is disabled or no method is on file.

autoCharge.scheduledAt string · nullable required

When the next automatic attempt is expected to run (20:00 Europe/Stockholm on the due date, or a possible daily retry shortly after a failed attempt); null when no further automatic attempt is expected — no unpaid invoices, auto-charge off, or a failure older than the short retry window. After a failure, treat any scheduled retry as best-effort: the customer should still replace the card or pay another way.

autoCharge.status string · enum required · Example: scheduled

off: auto-charge disabled or no card on file. scheduled: a card is armed and the earliest unpaid invoice is not yet due. failed: an unpaid invoice is past its due date while a card was armed — the automatic charge did not go through (declined, expired, or blocked card). Never treat failed as 'no action needed'.

off
scheduled
failed
autoCharge.reason string · nullable required · Example: null

Plain-language explanation when status is failed: what went wrong with the saved card, whether a retry is still pending, and that the customer must update the card or pay another way. Null for off and scheduled.

autoCharge.lastAttemptAt string · nullable required · Example: null

When the last automatic charge attempt failed, if the payment provider reported it to us. Null when no attempt record exists (the failure is then inferred from the invoice being past due) or when status is not failed.

autoCharge.failureKind string · nullable · enum required · Example: null

Customer-facing classification of the last decline when status is failed; unknown when the failure is inferred from the overdue state only. Null otherwise.

card_declined
insufficient_funds
card_expired
authentication_required
unknown
400 Invalid request. The response body is an RFC 7807 Problem Details document.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
401 Unauthorized. Authentication is required.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
403 Forbidden. The caller lacks a required scope or does not own the resource.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
404 Not found. The resource does not exist or is not owned by the caller.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
429 Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
500 Internal error. Retry later or contact support if the issue persists.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on detail.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when code is invalid_request.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
GET https://cloud.hostup.se/api/v2/billing/unpaid-summary
For AI assistants
View as Markdown
cURL
curl -X GET "https://cloud.hostup.se/api/v2/billing/unpaid-summary" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Response
{
  "totalAmount": 97.5,
  "currencyCode": "SEK",
  "count": 1,
  "uiDisplayKind": "dueSoon",
  "uiShouldShow": false,
  "uiSuppressReason": "auto_charge_handles_upcoming",
  "invoices": [
    {
      "id": "inv_abc123",
      "number": "202664539",
      "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"
  }
}