Create prepaid mail-relay quota invoice

Create an unpaid invoice for a higher VPS mail relay monthly quota. The higher quota is applied only after the generated invoice is paid. Unused prepaid quota is credited to the account balance after the mail relay usage period closes. PAYG overage remains available only where the account has separately enabled it.

VPS Services VM

Authentication

Required API scope: write:billing

Use Authorization: Bearer <token> for API keys. Dashboard sessions may also use hostup_session.

Context

Path Parameters

id string required Example: vps_01hxa3b4c5d6e7f8g9h0j1k2m3

Public VPS ID from `GET /api/v2/vps` `data[].id`. Do not invent this value; use the exact ID returned by the referenced API response.

Headers

Accept Example
Content-Type Example

Body

required
application/json
requestedMonthlyLimit integer required · Example: 100000

Requested total monthly relay quota. Must be higher than the current effective monthly limit and must use 1,000-email increments.

acknowledgePrepaidTerms boolean required · Example: true

Must be `true` to confirm that the caller understands the invoice must be paid before the higher quota is applied and unused prepaid quota is credited after the period.

Responses

201 Prepaid quota invoice created. The higher quota is pending payment.
id string required · Example: d9dc8efa-c281-477d-86ef-758dd54a9a51

Prepaid quota purchase ID.

status string · enum required · Example: pending_payment
pending_payment
billingMode string · enum required · Example: prepaid
prepaid
period string required · Example: 2026-05
periodStart string required · Example: 2026-05-01
periodEnd string required · Example: 2026-05-31
currentMonthlyLimit integer required · Example: 15000
requestedMonthlyLimit integer required · Example: 100000
purchasedExtraEmails integer required · Example: 85000
total number required · Example: 42.5
currencyCode string required · Example: EUR
invoice object required
invoice.id string required · Example: inv_01hxa3b4c5d6e7f8g9h0j1k2m3
invoice.number string required · Example: 202600123
invoice.status string required · Example: Unpaid
400 The request body is invalid or the requested limit is not higher than the current monthly limit.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
401 Authentication is required.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
403 Forbidden. The caller lacks a required scope or does not own the resource.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
404 The requested VPS was not found or is not accessible.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
409 A prerequisite prevents invoice creation, such as an existing unpaid prepaid quota invoice, missing sender IP, or temporarily unavailable pricing.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
429 Rate limited. Retry after the limit resets. 429 responses include `Retry-After` seconds plus `X-RateLimit-*` headers.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
500 Unexpected error while creating the prepaid mail-relay quota invoice.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
POST https://cloud.hostup.se/api/v2/vps/{id}/mail-relay/quota-requests
For AI assistants
View as Markdown
cURL
curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/mail-relay/quota-requests" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "requestedMonthlyLimit": 100000,
    "acknowledgePrepaidTerms": true
  }'
Response
{
  "id": "d9dc8efa-c281-477d-86ef-758dd54a9a51",
  "status": "pending_payment",
  "billingMode": "prepaid",
  "period": "2026-05",
  "periodStart": "2026-05-01",
  "periodEnd": "2026-05-31",
  "currentMonthlyLimit": 15000,
  "requestedMonthlyLimit": 100000,
  "purchasedExtraEmails": 85000,
  "total": 42.5,
  "currencyCode": "EUR",
  "invoice": {
    "id": "inv_01hxa3b4c5d6e7f8g9h0j1k2m3",
    "number": "202600123",
    "status": "Unpaid"
  }
}
Request Body Create invoice for 100,000 emails/month
{
  "requestedMonthlyLimit": 100000,
  "acknowledgePrepaidTerms": true
}