Order extra storage for web hosting
POST /api/v2/shared-hosting/{accountId}/addons/storage
Order extra disk space for a web hosting account. Read GET /api/v2/shared-hosting/{accountId}/addons/storage first. Send a tier’s id as addonId when actions.canAddStorage.allowed and the tier’s available are true. Without a body or addonId the 25 GB tier is ordered. The account must be active. Contacts on the account need permission to place orders. The call creates an order and an invoice. The first period is prorated to the hosting plan’s renewal date. After that the add-on renews every year. The storage is added at the latest when the invoice is paid. The response gives the invoice, the order and a client-area link to pay the invoice.
Authentication: An API key with the scopes write:billing and write:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).Body (optional)
addonIdstringid from tiers[].id. Default: the 25 GB tier.paymentMethodstringcard sets the invoice up for card payment. Default invoice. One of card, invoice.Example
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/addons/storage" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonId": "7" }'curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/addons/storage" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "addonId": "7", "paymentMethod": "card" }'Responses
201 Order and invoice created.
{ "invoiceId": "inv_01hxa3b4c5d6e7f8g9h0j1k2m3", "orderId": "ord_01hxa3b4c5d6e7f8g9h0j1k2m3", "redirectUrl": "/billing?invoice=inv_01hxa3b4c5d6e7f8g9h0j1k2m3"}Response fields
invoiceIdstring or nullinv_…).orderIdstring or nullord_…).redirectUrlstring or nullErrors
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 shared_hosting_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. |