Renew several domains
POST /api/v2/domains/bulk/renew
Order a renewal for several domains in one call. The call checks each domain, queues a job and returns 202. Follow it at operation.pollUrl (Jobs). The job puts the domains that can be renewed on one renewal order with one invoice. They are renewed when the invoice is paid.
A domain that cannot be renewed does not stop the batch. It is listed in skipped with a reason. Examples are a domain that is not in your account, a domain that already has an unpaid renewal invoice and a renewal that would put the expiry date more than 10 years ahead. When every domain is skipped, nothing is ordered. The call then returns 200 with operation: null and allSkipped: true. The job result can list more skipped domains, for example when a renewal invoice was created in the meantime.
A contact (sub-account) also needs permission to place orders.
Authentication: An API key with the scopes write:domains and write:billing. About keys and scopes
Request
Body
domainIdsarray of stringrequireddom_…) to renew. At least one.Example
curl -X POST "https://cloud.hostup.se/api/v2/domains/bulk/renew" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "domainIds": [ "dom_01hxa3b4c5d6e7f8g9h0j1k2m3", "dom_01hxa3b4c5d6e7f8g9h0j1k2m4" ] }'Responses
200 Every domain was skipped. Nothing was ordered and no job was queued.
{ "operation": null, "domainsQueued": 0, "domainsSkipped": 1, "skipped": [ { "domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m4", "domainName": null, "reason": "This domain is not available for renewal from this account.", "orderNumber": null, "invoiceId": null } ], "allSkipped": true}Response fields
operationnullnull here.domainsQueuedintegerdomainsSkippedintegerskipped.skippedarray of objectdomainIdstring or nullnull when the ID you sent could not be read.domainNamestring or nullreasonstringorderNumberstring or nullinvoiceIdstring or nullallSkippedbooleantrue here.202 Renewal job queued for the domains that can be renewed. skipped lists the rest.
{ "operation": { "status": "pending", "jobId": "dbj_01hxa3b4c5d6e7f8g9h0j1k2m3", "pollUrl": "/api/jobs/dbj_01hxa3b4c5d6e7f8g9h0j1k2m3" }, "domainsQueued": 1, "domainsSkipped": 1, "skipped": [ { "domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m4", "domainName": "example.nu", "reason": "Already has pending renewal invoice (Order #123456)", "orderNumber": "123456", "invoiceId": "inv_01hxa3b4c5d6e7f8g9h0j1k2m5" } ], "allSkipped": false}Response fields
operationobjectstatusstring202 Accepted response only has pending, queued or in_progress. completed and failed appear when you poll pollUrl. They also appear in a 200 OK response when the action finished during the request. One of pending, queued, in_progress, completed, failed.jobIdstringpollUrlstring or nullnull when status is already completed or failed.domainsQueuedinteger or nulldomainsSkippedintegerskipped.skippedarray of objectdomainIdstring or nullnull when the ID you sent could not be read.domainNamestring or nullreasonstringorderNumberstring or nullinvoiceIdstring or nullallSkippedbooleanfalse when a job was queued.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. |
| 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. |