Get an invoice's payment link
GET /api/v2/billing/invoices/{id}/payment-link
Get the working payment link for an invoice and how often it was opened. When hasActiveLink is false, previousLinks lists up to five earlier links. Create a link with POST /api/v2/billing/invoices/{id}/actions/generate-payment-link.
Authentication: An API key with the scope read:billing. About keys and scopes
Request
Path parameters
idstringrequiredPublic invoice ID from
GET /api/v2/billing/invoices (inv_…).Example
curl "https://cloud.hostup.se/api/v2/billing/invoices/inv_01hxa3b4c5d6e7f8g9h0j1k2m3/payment-link" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 The invoice’s payment link, if any.
{ "hasActiveLink": true, "paymentUrl": "https://cloud.hostup.se/billing/pay/550e8400-e29b-41d4-a716-446655440000", "expiresAt": "2026-05-27T12:00:00.000Z", "viewCount": 3, "lastViewedAt": "2026-04-28T09:15:00.000Z", "previousLinks": []}{ "hasActiveLink": false, "previousLinks": [ { "createdAt": "2026-03-01T09:00:00.000Z", "expired": true, "invalidatedAt": "2026-04-02T08:00:00.000Z", "invalidationReason": "expired", "views": 1 } ]}Response fields
hasActiveLinkbooleanpaymentUrlstring or nullPresent when
hasActiveLink is true. Absent when there is no active link.expiresAtstring or nullPresent when
hasActiveLink is true. Absent when there is no active link.viewCountintegerlastViewedAtstringpreviousLinksarray of objectcreatedAtstring or nullexpiredbooleaninvalidatedAtstring or nullinvalidationReasonstring or nullviewsintegerErrors
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 caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller; code is invoice_not_found. |
| 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. |