Accept or decline a domain renewal
POST /api/v2/domains/{id}/actions/respond-to-renewal
Decline or keep a domain’s unpaid renewal order. Use it when GET /api/v2/domains/{id} shows a pendingRenewalOrder. Declining (accept: false) cancels the renewal order and its invoice. If that order also renews other domains, they get a new renewal invoice. A paid renewal cannot be declined and returns 409 not_cancelable. Accepting (accept: true) changes nothing. The invoice stays open and renewalInvoice links to it. Without an open renewal the call returns 409 no_pending_renewal. Contacts on the account need permission to place orders to decline.
Authentication: An API key with the scope write:domains. Also write:billing: only when declining (accept: false or decision: "decline"). About keys and scopes
Request
Path parameters
idstringrequireddom_…).Body
acceptbooleanfalse declines and cancels the renewal. true keeps it.decisionstringaccept wins. One of accept, decline.Example
curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/respond-to-renewal" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "accept": false }'curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/respond-to-renewal" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "decision": "accept" }'Responses
200 The decision was applied.
{ "domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m3", "decision": "declined", "newExpiresAt": null, "renewalInvoice": null}Response fields
domainIdstringdom_…).decisionstringdeclined: the pending renewal order was cancelled. accepted: the renewal invoice stays open for payment. One of accepted, declined.newExpiresAtstring or nullrenewalInvoicenulldeclined. The renewal order is then cancelled.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 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 domain_not_found. |
| 409 | no_pending_renewal: the domain has no unpaid renewal order. not_cancelable: the renewal is already paid or its invoice could not be checked. |
| 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. |