Preview order

POST /api/v2/orders/preview

Calculate pricing, tax, discounts, and validation requirements without creating an order or invoice.

Authentication is optional: unauthenticated callers can preview a checkout cart, while authenticated callers may use stored account country/currency context.

Use this after availability/product-detail lookup and before POST /api/v2/orders so the customer sees the exact total and any missing domain requirements.

Previews that include a voucher code return priceAssurance.level: provisional, because voucher discounts are revalidated when the order is submitted; all other previews are authoritative.

Final order creation validates again and can reject a stale or unavailable quote.

When supplied, paymentMethod is a checkout hint for the invoice that would be created: card, swish, bankgiro, sepa, or invoice.

Account credit is handled after invoice creation.

Billing & Orders Orders

Authentication

No authentication required.

Context

Headers

Accept application/json
Content-Type application/json

Body

required
application/json
items array<any>
clientData object

Optional for authenticated API-key/session orders. Use only to override or provide missing profile fields returned by availability/validation requirements. Required for unauthenticated signup orders.

clientData.firstName string · Example: Anna
clientData.lastName string · Example: Svensson
clientData.companyName string · Example: Example AB
clientData.email string · Example: user@example.com
clientData.address object
clientData.address.street string · Example: Examplegatan 1
clientData.address.address2 string · nullable · Example: null

Nullable: may be null when not applicable.

clientData.address.city string · Example: Stockholm
clientData.address.state string · Example: Stockholm
clientData.address.postalCode string · Example: 12345
clientData.countryCode string · Example: SE
clientData.phoneNumber string · Example: +46700000000
clientData.registrationIdentifier object
clientData.registrationIdentifier.value string · Example: 850507-3412
clientData.registrationIdentifier.countryCode string · nullable · Example: SE

Nullable: may be null when not applicable.

clientData.vatNumber string · Example: SE559999999901
clientData.accountType string · enum · Example: private
private
organisation
paymentMethod string · enum · Example: card

Canonical checkout preference for the invoice created by the order. Use card for card-backed hosted checkout flows, swish for Swish, bankgiro for Swedish SEK invoice payment, sepa for EUR SEPA bank transfer, or invoice to create the invoice without starting a specific payment flow. Provider names are not public v2 method values. Account credit is applied after invoice creation through the invoice credit action.

card
swish
bankgiro
sepa
invoice
attemptKey string · Example: order_attempt_01hxa3b4c5d6e7f8g9h0j1k2m3

Optional caller-generated idempotency key for retry-safe order creation. Generate a fresh value for each logical order/checkout attempt and reuse that exact value only when retrying the same request after a timeout or lost response. If the previous attempt created an order, repeats with the same key within the duplicate-prevention window (currently one hour) return that existing order/invoice instead of creating another order. Do not reuse a key for a different cart.

Responses

200 Order price preview.
items array<object>
items[].productSlug string · nullable required · Example: vps-med

Nullable: may be null when not applicable.

items[].domainName string · nullable required · Example: null

Nullable: may be null when not applicable.

items[].type string · enum required · Example: vps
vps
shared_hosting
addon
domain
items[].billingCycle string · nullable required · Example: annually

Nullable: may be null when not applicable.

items[].periodYears integer · nullable · Example: 1

Present for multi-year domain previews.

items[].quantity integer required · Example: 1
items[].unitAmount number required · Example: 1440
items[].renewalAnnualAmount number · nullable · Example: 129

Annual renewal amount for domain preview items in currencyCode. Null or absent for non-domain items.

items[].setupAmount number required · Example: 0
items[].configurableOptionAmounts array<object> required
items[].configurableOptionAmounts[].key string required · Example: backupSlots
items[].configurableOptionAmounts[].label string required · Example: Example Label
items[].configurableOptionAmounts[].amount number required · Example: 0
items[].configurableOptionAmounts[].quantity number · nullable required · Example: 7

Nullable: may be null when not applicable.

items[].subtotal number required · Example: 1440
items[].currencyCode string required · Example: SEK
subtotal number · Example: 1440
taxRateDecimal number · Example: 0.25
taxAmount number · Example: 360
total number · Example: 1800
currencyCode string · Example: SEK
reverseCharge boolean · Example: false
priceAssurance object
priceAssurance.level string · enum required · Example: authoritative
authoritative
provisional
priceAssurance.reason string · nullable required · Example: null

Nullable: may be null when not applicable.

priceAssurance.revalidatedAtSubmit boolean required · Example: false
400 Invalid request. The response body is an RFC 7807 Problem Details document.
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 Not found. The resource does not exist or is not owned by the caller.
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 Internal error. Retry later or contact support if the issue persists.
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/orders/preview
For AI assistants
View as Markdown
cURL
curl -X POST "https://cloud.hostup.se/api/v2/orders/preview" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "paymentMethod": "bankgiro",
    "items": [
      {
        "type": "domain",
        "action": "register",
        "domainName": "example.se",
        "years": 1,
        "acceptedTerms": [
          "se_registration_terms"
        ],
        "registrantContact": {
          "type": "private",
          "firstName": "Anna",
          "lastName": "Svensson",
          "email": "user@example.com",
          "phoneNumber": "+46700000000",
          "countryCode": "SE",
          "registrationIdentifier": {
            "value": "850507-3412",
            "countryCode": "SE"
          }
        }
      }
    ],
    "clientData": {
      "countryCode": "SE",
      "accountType": "private",
      "registrationIdentifier": {
        "value": "850507-3412",
        "countryCode": "SE"
      }
    }
  }'
Response
{
  "items": [
    {
      "productSlug": "domain-se",
      "domainName": "example.se",
      "type": "domain",
      "billingCycle": "annually",
      "periodYears": 1,
      "quantity": 1,
      "unitAmount": 79,
      "renewalAnnualAmount": 129,
      "setupAmount": 0,
      "configurableOptionAmounts": [],
      "subtotal": 79,
      "currencyCode": "SEK"
    }
  ],
  "subtotal": 79,
  "taxRateDecimal": 0.25,
  "taxAmount": 19.75,
  "total": 98.75,
  "currencyCode": "SEK",
  "reverseCharge": false,
  "priceAssurance": {
    "level": "authoritative",
    "reason": null,
    "revalidatedAtSubmit": false
  }
}
Request Body Preview .se registration
{
  "paymentMethod": "bankgiro",
  "items": [
    {
      "type": "domain",
      "action": "register",
      "domainName": "example.se",
      "years": 1,
      "acceptedTerms": [
        "se_registration_terms"
      ],
      "registrantContact": {
        "type": "private",
        "firstName": "Anna",
        "lastName": "Svensson",
        "email": "user@example.com",
        "phoneNumber": "+46700000000",
        "countryCode": "SE",
        "registrationIdentifier": {
          "value": "850507-3412",
          "countryCode": "SE"
        }
      }
    }
  ],
  "clientData": {
    "countryCode": "SE",
    "accountType": "private",
    "registrationIdentifier": {
      "value": "850507-3412",
      "countryCode": "SE"
    }
  }
}