Skip to content

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

idstringrequired
The order ID (ord_…).

Body (optional)

confirmCancelAllboolean
Confirms cancelling a renewal order for several domains. Auto-renew is turned off for every domain the 409 response listed. Default false.

Example

POST /api/v2/orders/{id}/actions/cancel
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.

Response 200
{
"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
idstring
numberstring
statusstring
One of pending, active, completed, cancelled, failed.
typestring
One of new, renew, upgrade, transfer.
invoiceIdstring or null
checkoutUrlstring or null
Older name for the payment link. Read invoice.paymentUrl when invoice is present.
clientobject
idstring or null
emailstring or null
firstNamestring or null
lastNamestring or null
companyNamestring or null
billingobject
amountnumber or null
The price per billing cycle, in the currency of the resource. Null when there is no fixed price, as for a Cloud VPS.
currencyCodestring
billingCyclestring or null
The billing cycle. A Cloud VPS also shows monthly. Use isPayg to tell it apart from a fixed-cycle VPS. One of monthly, quarterly, semiannually, annually, biennially, triennially, free.
isPaygboolean
True for a Cloud VPS, which is billed for what it uses. False for a fixed-cycle VPS. Other services normally return false.
periodYearsinteger or null
invoiceobject | null
idstring
numberstring or null
amountnumber
currencyCodestring
dueAtstring or null
statusstring
One of paid, unpaid, partially_paid, draft, cancelled, refunded.
paymentUrlstring or null
totalsobject
datesobject
paymentStatusobject
statusstring
One of paid, unpaid, credit_note, pending, unknown.
reasonstring or null
actionsobject
canRetryobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
canCancelobject
allowedboolean
True when the action can be called now.
reasonstring or null
Why the action is blocked, ready to show. Null when allowed is true.
domainsarray of object
hostingarray of object
addonsarray of object
upgradesarray of object
invoiceLookupPendingboolean
restoreIntentsobject
Present when the order restores a backup onto the new VPS. dispatchDeferred: true means the restore is saved. It is tried again once the VPS has been created.
requestedinteger
createdinteger
queuedinteger
skippedinteger
dispatchDeferredboolean
createdAtstring or null
contractAcceptedAtstring or null
notesstring or null
referenceNumberstring or null
cancellationobject
What happened to each item of the order.
refreshedboolean
False when the order could not be read again after the cancellation. Every outcome is then unknown.
itemsarray of object
kindstring
What the item is. One of domain, hosting, addon, upgrade.
namestring
The domain or product name.
outcomestring
cancelled: 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.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404order_not_found: no order with this ID on your account.
409not_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.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.
502upstream_failed: the invoice could not be checked or the cancellation failed. Try again later.