Do you set up websites for your clients? Then you can order their web hosting through the Site.eu API. Your script pays from your wallet, and the order starts right away.
With the API, you can order a new plan, renew a plan and restore a plan. Each call is one order for one plan. Want to order domain names too? Read how to order domain names with the API. New to our API? Then first read how to get started with the API.
What you need
An API key. Make one in your dashboard under Settings, on the API keys tab. Only tick the permissions you need, under API Endpoints:
- plans.order.create: order, renew and restore plans.
- domains.view: look up the IDs of your plans and domain names.
Money in your wallet. Orders through the API are always paid from your online wallet. The balance must cover the whole order, VAT included.
Orders only work with an API key. In your browser, you simply use the shopping cart.
How an order works
You send a POST request to the API. Put your API key in the X-API-Key header, and the details of the order as JSON in the body. For example, to order a new plan:
POST https://backend.site.eu/v2/plans/order
X-API-Key: your API key
Content-Type: application/json
In the body, you send at least plan_name, for example starter. Then this happens:
- Same price. You pay the same as when you order on our website.
- Nothing is charged when something is wrong. You get an error code that says why.
- Test it first. Send dry_run: true. The answer shows the price, the VAT and whether your wallet balance covers it. Nothing is ordered or charged.
- We start the order within about a minute. From then on, it goes like any other order, with the same emails.
- It goes on your monthly invoice, marked "Via API". That also happens when monthly invoicing is off.
The API documentation lists every field and gives examples of each request and answer.
Order a new plan
POST https://backend.site.eu/v2/plans/order
You can send these fields:
- plan_name (required): the name of the plan in lowercase, like starter or power.
- order_period: the number of years, 1 to 5. The default is 1.
- domain_name_ids: the IDs of domain names you already have with us, to put in the new plan. You find them with GET /v2/domain_names.
- external_domain_name_ids: the IDs of domain names that are registered somewhere else, but that you added to your account. You find them with GET /v2/external_domain_names.
- expected_price: the price in cents, without VAT, that you accept. Is the price different? Then we don't place the order.
- dry_run: true only checks and prices the order.
The domain names must be active, and they can't be in another plan yet. And every plan holds a maximum number of domain names. Need a new domain name for the plan? Order it first, and wait until it's active.
Renew or restore a plan
POST https://backend.site.eu/v2/plans/91/renew
POST https://backend.site.eu/v2/plans/91/restore
Here, 91 is the ID of the plan. You find it with GET /v2/plans. In the body, you can send order_period (in years), expected_price and dry_run.
- Renew: for an active plan. Read how the renewal of a plan works.
- Restore: for a plan that expired or was cancelled, up to 14 days after it expired.
Is the plan being moved to another user right now? Then you can't renew it until the move is done.
The answer
Did the order go through? Then you get its order_id, with order_status paid. You also get the prices in cents: amount_excluding_vat_in_cents, vat_amount_in_cents and total_including_vat_in_cents. Under payment, wallet_balance_in_cents shows what's left in your wallet.
Follow the order with its ID:
GET https://backend.site.eu/v2/orders/5926
Each line of the order has a status: unprocessed, processing, processed, failed or cancelled.
Never pay twice
Sometimes the connection drops right after you send an order. Did it go through or not? To be safe, send an Idempotency-Key header with every order. That's a unique code of up to 255 characters, like a UUID.
Send the same order again with the same key? Then you get the first answer back, and you're never charged twice. Use the key for a different order, and you get the error ORDER_005.
Error codes
With every error, nothing is charged. These are the most common ones:
- ORDER_001: your wallet balance is too low. Under top_up, the answer gives the amount to add and a link to top up your wallet.
- ORDER_002: the price is not your expected_price. The answer has the current price.
- ORDER_003: this order isn't possible. The reason field says why. For example: the plan can't hold that many domain names, a domain name is already in a plan, or the restore period is over.
- ORDER_004: paying from the wallet isn't possible for your account.
- ORDER_005: you already used this Idempotency-Key for a different order.
- GENERAL_001: there's no plan with this name, or the plan ID isn't yours.
- DOMAIN_NOT_FOUND: one of the domain name IDs isn't yours.
Good to know
- There's no test environment. Every order is real. So test with dry_run first.






