Cancel an order
POST /api/v2/orders/{id}/actions/cancel
Cancels one of your orders before it is delivered. Check actions.canCancel on GET /api/v2/orders/{id} first. An order whose invoice is paid cannot be cancelled. Only items that are still pending are cancelled. Items already delivered stay, for example a domain transfer that went through. The invoice is cancelled when nothing is left on it. cancellation.items in the response says what happened to each item. A renewal order for several domains answers 409 combined_renewal_order first. Send confirmCancelAll: true to cancel the renewal of every listed domain. That also turns off auto-renew for each of them. To cancel the renewal of one domain and keep the others, use POST /api/v2/domains/{id}/actions/respond-to-renewal.
Authentication: An API key with the scope write:orders. About keys and scopes
Request
Path parameters
idstringrequiredord_…).Body (optional)
confirmCancelAllbooleanfalse.Example
curl -X POST "https://cloud.hostup.se/api/v2/orders/ord_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/cancel" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json"Responses
200 The order after the cancellation, with the outcome per item.
{ "id": "ord_01hxa3b4c5d6e7f8g9h0j1k2m3", "number": "2016143001", "invoiceId": "inv_01hxa3b4c5d6e7f8g9h0j1k2m3", "status": "cancelled", "type": "renew", "client": { "id": "client_01hxa3b4c5d6e7f8g9h0j1k2m3", "email": null, "firstName": "Alex", "lastName": "Example", "companyName": "Example AB" }, "billing": { "amount": 159, "currencyCode": "SEK", "billingCycle": null, "isPayg": false }, "invoice": { "id": "inv_01hxa3b4c5d6e7f8g9h0j1k2m3", "number": "202600001", "amount": 159, "currencyCode": "SEK", "dueAt": "2026-05-11T23:59:59.000Z", "status": "cancelled", "paymentUrl": "/billing?invoice=202600001", "totals": { "currencyCode": "SEK", "total": 159, "amountPaid": 0, "outstanding": 159 }, "dates": { "dueAt": "2026-05-11T23:59:59.000Z" } }, "paymentStatus": { "status": "credit_note", "reason": "Invoice has been cancelled." }, "actions": { "canRetry": { "allowed": false, "reason": "Order is cancelled." }, "canCancel": { "allowed": false, "reason": "Order is already cancelled." } }, "invoiceLookupPending": false, "domains": [ { "name": "example.com", "tld": "com", "amount": 159, "currencyCode": "SEK" } ], "hosting": [], "addons": [], "upgrades": [], "createdAt": "2026-04-27T12:00:00.000Z", "contractAcceptedAt": null, "notes": "Customer requested cancellation before payment.", "referenceNumber": null, "cancellation": { "refreshed": true, "items": [ { "kind": "domain", "name": "example.com", "outcome": "cancelled" } ] }}Response fields
idstringnumberstringstatusstringpending, active, completed, cancelled, failed.typestringnew, renew, upgrade, transfer.invoiceIdstring or nullcheckoutUrlstring or nullinvoice.paymentUrl when invoice is present.clientobjectidstring or nullemailstring or nullfirstNamestring or nulllastNamestring or nullcompanyNamestring or nullbillingobjectamountnumber or nullcurrencyCodestringbillingCyclestring or nullmonthly. Use isPayg to tell it apart from a fixed-cycle VPS. One of monthly, quarterly, semiannually, annually, biennially, triennially, free.isPaygbooleanperiodYearsinteger or nullinvoiceobject | nullidstringnumberstring or nullamountnumbercurrencyCodestringdueAtstring or nullstatusstringpaid, unpaid, partially_paid, draft, cancelled, refunded.paymentUrlstring or nulltotalsobjectdatesobjectpaymentStatusobjectstatusstringpaid, unpaid, credit_note, pending, unknown.reasonstring or nullactionsobjectcanRetryobjectallowedbooleanreasonstring or nullcodestring or nullcanCancelobjectallowedbooleanreasonstring or nullallowed is true.domainsarray of objecthostingarray of objectaddonsarray of objectupgradesarray of objectinvoiceLookupPendingbooleanrestoreIntentsobjectdispatchDeferred: true means the restore is saved. It is tried again once the VPS has been created.requestedintegercreatedintegerqueuedintegerskippedintegerdispatchDeferredbooleancreatedAtstring or nullcontractAcceptedAtstring or nullnotesstring or nullreferenceNumberstring or nullcancellationobjectrefreshedbooleanunknown.itemsarray of objectkindstringdomain, hosting, addon, upgrade.namestringoutcomestringcancelled: cancelled now. kept_completed: already delivered. It stays. still_pending: not cancelled. unknown: the outcome could not be read. One of cancelled, kept_completed, still_pending, 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 caller lacks a required scope or does not own the resource. |
| 404 | order_not_found: no order with this ID on your account. |
| 409 | not_cancelable: the order is active or already cancelled. It is also returned when the invoice is paid or carries account credit in another currency. combined_renewal_order: the order renews several domains. domains lists them. Resend with confirmCancelAll: true to cancel all of them. |
| 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. |
| 502 | upstream_failed: the invoice could not be checked or the cancellation failed. Try again later. |