Skip to content
30 % discount on first order (on monthly payment) — automatically applied in the cart:
Istanbul data center Free SSL · DDoS protection
VatanHosting
Create account
Reseller API
Reseller API Documentation

Fetch products and reseller prices, order from your wallet balance, manage invoices and services. Every endpoint returns JSON and uses a Bearer API key.

VatanHosting · Developer documentation · v1

Reseller API

Sell products from your own site at special dealer prices, pay for orders automatically from your wallet, and manage services with a single REST API.

Base URL https://vatanhosting.com/api/v1/client
  • JSON/REST UTF-8, consistent response structure
  • Bearer token Optional IP restriction
  • 60 requests/min per API key
  • Payment from wallet Orders are paid from balance

Getting started

Quick start

Place your first order via API in four steps.

  1. Apply for dealership

    Fill out the application form (individual or company). When your wallet balance reaches 2,000 ₺ (current balance or total top-ups after application), your dealership will be automatically activated . Activation is one-time; Subsequent expenses will not reduce your dealership.

  2. Generate API key

    Generate a new key from the dealer panel . The key starts with wck_ and is shown only once ; Save it in a safe place immediately. You can create up to 20 keys per account, limiting each key to specific IP addresses.

  3. Submit your first request

    GET /me returns your account and balance. If you get a 200 response, your key is working.

    curl "https://vatanhosting.com/api/v1/client/me" \
      -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  4. Place your first order

    First see the net amount with POST /orders/preview , then send POST /orders with the same items. Always use a unique Idempotency-Key in the order.

    curl -X POST "https://vatanhosting.com/api/v1/client/orders/preview" \
      -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
      -H "Content-Type: application/json" \
      -d '{
        "items": [
          {
            "product_id": 41,
            "cycle": "monthly"
          }
        ]
      }'
    curl -X POST "https://vatanhosting.com/api/v1/client/orders" \
      -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: siparis-a1042-7f3c9e2b" \
      -d '{
        "items": [
          {
            "product_id": 41,
            "cycle": "monthly"
          }
        ],
        "payment": {
          "method": "balance"
        },
        "terms": true
      }'

Temeller

Authentication

Add your API key to each request as a Bearer token in the Authorization header. Clients that cannot set the header can use the X-Api-Key header. Only GET /ping does not require authentication.

Request headers
Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# alternatif
X-Api-Key: wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • Key format: wck_ +32 characters (0-9A-Za-z ). The key is only shown once when it is created; Only the digest (SHA-256) is stored in the system, so the lost key cannot be recovered.
  • Keys are created and canceled from the dealer panel. A maximum of 20 keys can be defined per account.
  • You can define an optional IP allow list (full IP addresses) for each switch. Requests from addresses not on the list receive 403 ip_not_allowed .
  • API only works on active reseller accounts; other accounts get 403 client_api_not_allowed .

Don't put your key in client-side code like a browser, mobile app, or public repository. Always send requests from your own server; If the key leaks, immediately cancel it from the panel and create a new one.

Request and response structure

API receives and returns UTF-8 encoded JSON. Use Content-Type: application/json in requests where you send bodies. All paths are relative to the base URL: https://vatanhosting.com/api/v1/client/orders .

Successful response

Data is always in the data field (object, array or null ). In paged lists, meta is added; It is available only when necessary. The status code 200 and becomes 201 for requests that create new records.

200Successful response
{
  "data": {
    "id": 77,
    "status": "active"
  },
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 25,
    "next_page": 0
  }
}

Error response

For errors, the body contains a single error object: code for machine readability, message for human readability, and details for additional information, if any. Always decide by code field in your integration.

422Error response
{
  "error": {
    "code": "insufficient_balance",
    "message": "Bakiye yetersiz.",
    "details": {
      "required": {
        "amount": 420,
        "currency": "TRY"
      },
      "available": {
        "amount": 180.5,
        "currency": "TRY"
      }
    }
  }
}

Method overriding and CORS

Clients that cannot send PATCH, PUT, or DELETE can send the request as POST and add X-Http-Method-Override: PATCH|PUT|DELETE header. Access-Control-Allow-Origin: * for API CORS: * returns and responds to OPTIONS requests with 204 ; Don't use your key in the browser though.

Error codes

The HTTP status code indicates the class of the error, and error.code indicates the exact cause. 401 , 403 and 429 errors can be returned on all ends that require authentication.

Error codes
KodHTTPMeaning
bad_request400The request could not be parsed (e.g. invalid JSON body).
operation_failed400The operation could not be completed; The reason is in message field.
missing_token401No Authorization or X-Api-Key header was sent.
invalid_token401The key is invalid or not recognized.
key_revoked401The key has been cancelled. Create a new key from the panel.
owner_inactive401The account that owns the key is inactive.
ip_not_allowed403The request came from an address that is not in the switch's IP permission list.
client_api_not_allowed403The account is not an active dealer; No API access.
insufficient_scope403The key is not authorized for this operation.
not_found404The requested record was not found.
endpoint_not_found404There is no such extreme; check the path and version.
method_not_allowed405The endpoint does not support this HTTP method.
idempotency_in_flight409The request sent with the same Idempotency-Key is still being processed; Try again after a short while.
idempotency_key_reuse422The same Idempotency-Key was used with a different body.
validation_failed422One or more fields are invalid; details are in details .
insufficient_balance422Wallet balance is insufficient. details.required and details.available amounts are returned.
cycle_invalid422The product is not sold during this period. Valid periods are in details.allowed .
product_not_orderable422The product is currently not available to order.
out_of_stock422The product is out of stock.
addon_invalid422Plugin is invalid for this product.
addon_option_invalid422Plugin option is invalid.
requirement_missing422A mandatory order requirement (requirements ) is missing.
terms_required422Contract confirmation (terms: true ) was not sent.
payment_method_invalid422Payment method is invalid; Only balance is accepted.
invoice_not_payable422The invoice is not payable.
not_renewable422Hizmet yenilenemiyor.
cancellation_exists422There is already a cancellation request for this service.
tool_action_failed422Vehicle action failed.
password_too_short422Password is too short.
rate_limited429Minute request limit exceeded; Wait for Retry-After seconds.
too_many_auth_failures429Too many failed authentication attempts; wait for a while.
server_error500Unexpected server error. Try again; If it persists, contact support.

Sayfalama

List ends accept page (≥ 1, default 1) and limit (1–100, default 25) query parameters. meta object in the response returns the total number of records and the next page; On the last page, next_page value becomes 0 .

Example
GET /services?page=2&limit=50

"meta": { "total": 134, "page": 2, "limit": 50, "next_page": 3 }

Request the next page until next_page value is 0 to retrieve all records.

Idempotency

Add Idempotency-Key header (8–191 characters) to POST requests so you can safely repeat a request in the event of network failure or timeout. Always send in POST /orders and POST /invoices/ {id} /pay requests.

Idempotency behavior
StatusConclusion
Same key and same body, within 24 hoursThe procedure is not repeated; The first response is returned as is, and Idempotency-Replayed: true header is added.
Same key, different body422 idempotency_key_reuse
First request still processing409 idempotency_in_flight ; Try again after a short while.

Generate the key once per transaction (e.g. from your own order number or a UUID) and do not change it on retries.

Request limit

There is a limit of 60 requests per minute for each API key (fixed 60-second window). Each authenticated response contains headers that indicate your remaining rights.

Request limit headers
TitleExplanation
X-RateLimit-LimitTotal number of requests in the window (60).
X-RateLimit-RemainingRemaining request right in the window.
X-RateLimit-ResetThe time at which the window will be reset (Unix timestamp).
Retry-AfterOn 429 responses only: seconds to wait before trying again.
429When the limit is exceeded
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1796481060
Retry-After: 23

{"error": {"code": "rate_limited", "message": "Too many requests."}}

Make status polls every few seconds and wait for Retry-After time when you receive 429 . Repeated failed authentication attempts are temporarily blocked with too_many_auth_failures .

Money and date format

Para

All amounts are an object containing numbers and currency. amount is a decimal number (not text).

Para nesnesi
{"amount": 123.45, "currency": "TRY"}

Date

Dates are in the format YYYY-MM-DD . created_at in wallet transactions is in ISO 8601 format.

Example
"due_date":   "2027-01-05"
"created_at": "2026-12-05T14:31:02+03:00"

Billing periods

In order items and price lists, cycle field takes one of the following values. The periods a product is offered are listed in pricing array; If a period that is not offered is submitted, 422 cycle_invalid is returned and valid values come in details.allowed .

Billing periods
ValuePeriod
hourlyHourly usage
monthlyMonthly
quarterly3 months old
semiannually6 months old
annuallyAnnual
biennially2 years
triennially3 years
onetimeOne time

Dealer pricing

Dealer discount is automatically applied to all orders you place via API and panel. Always get the exact net price with GET /reseller/prices or POST /orders/preview .

Private dealer up to 30% discount
Company dealer up to 35% discount
  • Discount applies to products, add-ons and installation fees.
  • The discounted price never goes below the product's cost base; Therefore, the actual discount rate is lower on some products. The product-based rate is shown in the discount_pct field.
  • Domain names and hourly usage fees are excluded from the discount.
  • No coupon or group discount is applied on top of the dealer discount.
  • VAT is added to the discounted amount.
  • API orders are paid only from wallet balance (payment.method = "balance" ).
  • You can sell to your own customers at any price you want.
List price (monthly) 500,00 ₺
Dealer discount (30% on this product) −150,00 ₺
VAT (20% on discounted amount) +70,00 ₺
420,00 ₺ to be paid from wallet

The example is for a product for which the full discount is applied; rates vary by product and your dealer type.

End to end

Full flow example

Calls required to purchase VDS for a customer, deliver access information, and renew after one month.

  1. List dealer prices

    Select the product and period; reseller amount is your net purchase price.

    curl "https://vatanhosting.com/api/v1/client/reseller/prices?search=VDS" \
      -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  2. Preview the order

    compare total with your balance (GET /balance ); If it is not enough, load the balance first.

    curl -X POST "https://vatanhosting.com/api/v1/client/orders/preview" \
      -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
      -H "Content-Type: application/json" \
      -d '{
        "items": [
          {
            "product_id": 41,
            "cycle": "monthly",
            "requirements": {
              "7": "21"
            }
          }
        ]
      }'
  3. Place the order with Idempotency-Key

    If the answer is 201 and payment.status: "paid" the amount has been deducted from your wallet and the installation has started. If the connection is lost, try again with the same key and the same body.

    curl -X POST "https://vatanhosting.com/api/v1/client/orders" \
      -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: siparis-a1042-7f3c9e2b" \
      -d '{
        "items": [
          {
            "product_id": 41,
            "cycle": "monthly",
            "requirements": {
              "7": "21"
            }
          }
        ],
        "payment": {
          "method": "balance"
        },
        "terms": true,
        "notes": "Müşteri ref: A-1042"
      }'
  4. Kurulumu takip edin

    Query every 15 seconds until services array in the GET /orders/ {id} response is full and all services active .

    # jq gerekir
    BASE="https://vatanhosting.com/api/v1/client"
    TOKEN="wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    
    until curl -s "$BASE/orders/10234" -H "Authorization: Bearer $TOKEN" \
      | jq -e '.data.services | length > 0 and all(.status == "active")' > /dev/null; do
      sleep 15
    done
    
    curl -s "$BASE/orders/10234" -H "Authorization: Bearer $TOKEN" | jq '.data.services'
  5. Get access information

    Transmit the server address, username and password in access object to your client through a secure channel.

    curl "https://vatanhosting.com/api/v1/client/services/77" \
      -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  6. Renew and pay the bill

    Create a renewal invoice (if there is an open invoice, it will be returned), then pay the invoice from the wallet with the returned invoice_id .

    curl -X POST "https://vatanhosting.com/api/v1/client/services/77/renew" \
      -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    curl -X POST "https://vatanhosting.com/api/v1/client/invoices/55188/pay" \
      -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: fatura-55188-odeme" \
      -d '{
        "payment": {
          "method": "balance"
        }
      }'

Extreme points

Sistem

Verify the connection and your API key.

Connection test

No authentication required#
GET/ping

Verifies that API is accessible. Does not require authentication; Suitable for monitoring (health check).

Parametreler

This tip takes no parameters.

Sample request

curl "https://vatanhosting.com/api/v1/client/ping"

Sample answer

200Response
{
  "data": {
    "pong": true,
    "version": "v1",
    "time": "2026-12-05 14:30:00"
  }
}

Possible errors

Anahtar bilgisi

#
GET/whoami

Returns API key and owner who made the request. id is the ID of the key, owner_id is the ID of the account. Use it to verify that the switch works when setting up the integration.

Parametreler

This tip takes no parameters.

Sample request

curl "https://vatanhosting.com/api/v1/client/whoami" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": {
    "id": 12,
    "type": "client",
    "name": "Mağaza entegrasyonu",
    "permissions": [
      "*"
    ],
    "last_access": "2026-12-05 14:28:11",
    "owner_id": 4821
  }
}

Possible errors

Extreme points

Account & Balance

Your account profile, wallet balance and balance movements.

Account details

#
GET/me

Returns the profile and current wallet balance of the account that owns the key. kind value is individual or corporate ; Company information is in the company object.

Parametreler

This tip takes no parameters.

Sample request

curl "https://vatanhosting.com/api/v1/client/me" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": {
    "id": 4821,
    "kind": "corporate",
    "full_name": "Ayşe Yılmaz",
    "name": "Ayşe",
    "surname": "Yılmaz",
    "company": {
      "name": "Örnek Bilişim Ltd. Şti.",
      "tax_number": "1234567890",
      "tax_office": "Kadıköy"
    },
    "email": "ayse@example.com",
    "email_verified": true,
    "phone": "+905550000000",
    "phone_verified": true,
    "language": "tr",
    "country": "TR",
    "currency": "TRY",
    "balance": {
      "amount": 2450.75,
      "currency": "TRY"
    },
    "created_at": "2026-11-02",
    "last_login_at": "2026-12-05"
  }
}

Possible errors

and common authentication and boundary errors for all ends

Wallet balance

#
GET/balance

Returns the wallet balance. API orders are paid from this balance only; Please check that you meet the total before ordering. wallet_empty and low_balance flags can be used to show warnings.

Parametreler

This tip takes no parameters.

Sample request

curl "https://vatanhosting.com/api/v1/client/balance" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": {
    "balance": {
      "amount": 2450.75,
      "currency": "TRY"
    },
    "wallet_empty": false,
    "low_balance": false
  }
}

Possible errors

and common authentication and boundary errors for all ends

Wallet transactions

#
GET/balance/transactions

It lists balance uploads (up ) and expenditures (down ) in pages. created_at is in ISO 8601 format.

Parametreler

ParametreTypeCompulsoryExplanation
type querystringoptionalup (load) or down (spend).
page queryintegeroptionalPage number (≥ 1, default 1).
limit queryintegeroptionalRecords per page (1–100, default 25).

Sample request

curl "https://vatanhosting.com/api/v1/client/balance/transactions?type=down&limit=25" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": [
    {
      "transaction_id": 90311,
      "type": "down",
      "amount": {
        "amount": 420,
        "currency": "TRY"
      },
      "description": "Fatura #55120 ödemesi",
      "invoice_id": 55120,
      "created_at": "2026-12-05T14:31:02+03:00"
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 25,
    "next_page": 0
  }
}

Possible errors

Extreme points

Dealer

Your dealership status and net purchase prices specific to you. These two ends are reseller extensions added to the client API.

Reseller status

Reseller extension#
GET/reseller

Returns your dealership status, type, discount rate, and balance progress required for activation. status : pending , active , suspended , rejected or none . rate is the highest discount rate that can be achieved according to your type; For the actual rate by product, use GET /reseller/prices .

Parametreler

This tip takes no parameters.

Sample request

curl "https://vatanhosting.com/api/v1/client/reseller" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": {
    "status": "active",
    "kind": "individual",
    "rate": 30,
    "min_deposit": {
      "amount": 2000,
      "currency": "TRY"
    },
    "deposit_progress": {
      "have": {
        "amount": 2000,
        "currency": "TRY"
      },
      "left": {
        "amount": 0,
        "currency": "TRY"
      },
      "reached": true
    },
    "activated_at": "2026-11-03"
  }
}

Possible errors

and common authentication and boundary errors for all ends

Dealer prices

Reseller extension#
GET/reseller/prices

It returns the list price (list ), your specific net purchase price (reseller ) and the applied discount rate (discount_pct ) for each product and period. The cost basis is the final price applied; VAT is excluded. Paging is the same as GET /products .

For the second product in the example, the discount remains at 22%: the discounted price does not go below the cost base.

Parametreler

ParametreTypeCompulsoryExplanation
category queryintegeroptionalFilter by category ID.
search querystringoptionalSearch in product name.
page queryintegeroptionalPage number (≥ 1, default 1).
limit queryintegeroptionalRecords per page (1–100, default 25).

Sample request

curl "https://vatanhosting.com/api/v1/client/reseller/prices?search=VDS" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": [
    {
      "id": 41,
      "title": "VDS Başlangıç",
      "category": {
        "id": 3,
        "name": "VDS Sunucular"
      },
      "pricing": [
        {
          "cycle": "monthly",
          "list": {
            "amount": 500,
            "currency": "TRY"
          },
          "reseller": {
            "amount": 350,
            "currency": "TRY"
          },
          "discount_pct": 30
        },
        {
          "cycle": "annually",
          "list": {
            "amount": 5000,
            "currency": "TRY"
          },
          "reseller": {
            "amount": 3500,
            "currency": "TRY"
          },
          "discount_pct": 30
        }
      ]
    },
    {
      "id": 57,
      "title": "VDS Pro",
      "category": {
        "id": 3,
        "name": "VDS Sunucular"
      },
      "pricing": [
        {
          "cycle": "monthly",
          "list": {
            "amount": 900,
            "currency": "TRY"
          },
          "reseller": {
            "amount": 702,
            "currency": "TRY"
          },
          "discount_pct": 22
        }
      ]
    }
  ],
  "meta": {
    "total": 2,
    "page": 1,
    "limit": 25,
    "next_page": 0
  }
}

Possible errors

Extreme points

Products

Orderable products, categories, add-ons and ordering requirements. The prices here are list prices.

Product categories

#
GET/products/categories

Returns product categories. parent is the ID of the parent category; The total number of records is in meta.total .

Parametreler

This tip takes no parameters.

Sample request

curl "https://vatanhosting.com/api/v1/client/products/categories" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": [
    {
      "id": 3,
      "parent": 0,
      "type": "server",
      "name": "VDS Sunucular"
    },
    {
      "id": 5,
      "parent": 0,
      "type": "server",
      "name": "Oyun Sunucuları"
    }
  ],
  "meta": {
    "total": 2
  }
}

Possible errors

and common authentication and boundary errors for all ends

List products

#
GET/products

Returns products with list prices ; Dealer discount does not apply. For the net purchase price, use GET /reseller/prices or POST /orders/preview . The currency of the prices is in meta.currency .

Parametreler

ParametreTypeCompulsoryExplanation
category queryintegeroptionalFilter by category ID.
search querystringoptionalSearch in product name.
type querystringoptionalFilter by product type.
page queryintegeroptionalPage number (≥ 1, default 1).
limit queryintegeroptionalRecords per page (1–100, default 25).

Sample request

curl "https://vatanhosting.com/api/v1/client/products?category=3" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": [
    {
      "id": 41,
      "type": "server",
      "title": "VDS Başlangıç",
      "tagline": "2 vCPU · 4 GB RAM · 60 GB NVMe",
      "category": {
        "id": 3,
        "name": "VDS Sunucular"
      },
      "in_stock": true,
      "stock": null,
      "pricing": [
        {
          "cycle": "monthly",
          "price": {
            "amount": 500,
            "currency": "TRY"
          },
          "setup": null,
          "promo": false
        },
        {
          "cycle": "annually",
          "price": {
            "amount": 5000,
            "currency": "TRY"
          },
          "setup": null,
          "promo": false
        }
      ]
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 25,
    "next_page": 0,
    "currency": "TRY"
  }
}

Possible errors

Product detail

#
GET/products/{id}

Returns a single product with list fields plus description, quantity rules, order limit per user, addons , order requirements and domain mode (domain.mode : none , chooser , required …). Get the IDs from the order item here.

Parametreler

ParametreTypeCompulsoryExplanation
id pathintegerCompulsoryProduct ID.

Sample request

curl "https://vatanhosting.com/api/v1/client/products/41" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": {
    "id": 41,
    "type": "server",
    "title": "VDS Başlangıç",
    "tagline": "2 vCPU · 4 GB RAM · 60 GB NVMe",
    "category": {
      "id": 3,
      "name": "VDS Sunucular"
    },
    "in_stock": true,
    "stock": null,
    "pricing": [
      {
        "cycle": "monthly",
        "price": {
          "amount": 500,
          "currency": "TRY"
        },
        "setup": null,
        "promo": false
      }
    ],
    "description": "NVMe disk, DDoS koruması ve tam root erişimi.",
    "quantity": {
      "allowed": false,
      "mode": "single"
    },
    "order_limit_per_user": 0,
    "addons": [
      {
        "id": 14,
        "name": "İşlemci",
        "description": "Ek vCPU çekirdeği",
        "field_type": "select",
        "required": false,
        "options": [
          {
            "id": 31,
            "name": "+2 vCPU",
            "cycle": "monthly",
            "price": {
              "amount": 120,
              "currency": "TRY"
            }
          }
        ]
      }
    ],
    "requirements": [
      {
        "id": 7,
        "name": "İşletim sistemi",
        "field_type": "select",
        "required": true,
        "options": [
          {
            "id": 21,
            "name": "Ubuntu 24.04"
          },
          {
            "id": 22,
            "name": "Windows Server 2022"
          }
        ]
      }
    ],
    "domain": {
      "mode": "none"
    }
  }
}

Possible errors

Extreme points

Orders

Preview the cart, create wallet-paid order and follow the setup.

Order item object

Every element of items array has this structure. A maximum of 20 items can be submitted in one request.

Order item object
ParametreTypeCompulsoryExplanation
product_idintegerCompulsoryProduct ID.
cyclestringCompulsoryBilling period (e.g. monthly ).
quantityintegeroptionalQuantity, default 1 .
domain.optionstringoptionalowned (your own domain) or none .
domain.namestringoptionalDomain name.
addonsobjectoptionalMapping from plugin ID to option ID: {"<addon_id>": "<option_id>"} or ["<id>", …] in multi-select.
requirementsobjectoptionalRequirement field ID to value mapping: {"<field_id>": "değer"} .

Order preview

#
POST/orders/preview

It calculates the basket without creating any records: item amounts, dealer discount , VAT (tax ) and total payable. All amounts are money objects. Call before ordering and compare total value with your balance.

Parametreler

ParametreTypeCompulsoryExplanation
items bodyarrayCompulsoryOrder items (up to 20). See the Order item object below for the structure.
billing_profile_id bodyintegeroptionalBilling profile ID.

Sample request

curl -X POST "https://vatanhosting.com/api/v1/client/orders/preview" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "product_id": 41,
        "cycle": "monthly",
        "quantity": 1,
        "requirements": {
          "7": "21"
        }
      }
    ]
  }'

Sample answer

200Response
{
  "data": {
    "items": [
      {
        "kind": "product",
        "product_id": 41,
        "name": "VDS Başlangıç",
        "cycle": "monthly",
        "quantity": 1,
        "domain": null,
        "unit_price": {
          "amount": 500,
          "currency": "TRY"
        },
        "setup": null,
        "total": {
          "amount": 500,
          "currency": "TRY"
        }
      }
    ],
    "subtotal": {
      "amount": 500,
      "currency": "TRY"
    },
    "discount": {
      "amount": 150,
      "currency": "TRY"
    },
    "tax": {
      "amount": 70,
      "currency": "TRY"
    },
    "fee": null,
    "total": {
      "amount": 420,
      "currency": "TRY"
    }
  }
}

Possible errors

Create order

Idempotency-Key recommended#
POST/orders

It creates the order and collects the amount from your wallet. If the balance does not meet the total 422 insufficient_balance is returned without any records being created. Services are automatically installed when payment is received. The successful response is coded 201 .

Submit a unique Idempotency-Key for each order. In case of timeout or connection error, try again with the same key and the same body; Double orders do not occur. payment.status value becomes paid or failed , and in case of error, payment.error is added.

Parametreler

ParametreTypeCompulsoryExplanation
Idempotency-Key headerstringRecommendedUnique key of 8–191 characters. Send the same key and the same body on the next try.
items bodyarrayCompulsoryOrder items (up to 20).
payment.method bodystringCompulsoryHer zaman balance.
terms bodybooleanCompulsorytrue to confirm the service agreement.
notes bodystringoptionalOrder note (e.g. your own customer reference).

Sample request

curl -X POST "https://vatanhosting.com/api/v1/client/orders" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: siparis-a1042-7f3c9e2b" \
  -d '{
    "items": [
      {
        "product_id": 41,
        "cycle": "monthly",
        "quantity": 1,
        "requirements": {
          "7": "21"
        }
      }
    ],
    "payment": {
      "method": "balance"
    },
    "terms": true,
    "notes": "Müşteri ref: A-1042"
  }'

Sample answer

201Response
{
  "data": {
    "order_id": 10234,
    "number": "10234",
    "status": "inprocess",
    "total": {
      "amount": 420,
      "currency": "TRY"
    },
    "payment": {
      "method": "balance",
      "status": "paid"
    },
    "invoice": {
      "invoice_id": 55120,
      "number": "55120",
      "status": "paid",
      "state": "paid",
      "total": {
        "amount": 420,
        "currency": "TRY"
      },
      "created_at": "2026-12-05",
      "paid_at": "2026-12-05",
      "due_date": "2026-12-05"
    }
  }
}

Possible errors

List orders

#
GET/orders

It lists your orders in pages.

Parametreler

ParametreTypeCompulsoryExplanation
status querystringoptionalwaiting , inprocess , active or cancelled .
page queryintegeroptionalPage number (≥ 1, default 1).
limit queryintegeroptionalRecords per page (1–100, default 25).

Sample request

curl "https://vatanhosting.com/api/v1/client/orders?status=active" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": [
    {
      "id": 10234,
      "number": "10234",
      "status": "active",
      "total": {
        "amount": 420,
        "currency": "TRY"
      },
      "payment_method": "balance",
      "invoice_id": 55120,
      "items_count": 1,
      "created_at": "2026-12-05"
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 25,
    "next_page": 0
  }
}

Possible errors

Order detail

#
GET/orders/{id}

In addition to the list fields, it returns items, services , invoice summary, and notes. To monitor the installation, query this end at intervals until the services are active .

Parametreler

ParametreTypeCompulsoryExplanation
id pathintegerCompulsoryOrder ID.

Sample request

curl "https://vatanhosting.com/api/v1/client/orders/10234" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": {
    "id": 10234,
    "number": "10234",
    "status": "active",
    "total": {
      "amount": 420,
      "currency": "TRY"
    },
    "payment_method": "balance",
    "invoice_id": 55120,
    "items_count": 1,
    "created_at": "2026-12-05",
    "items": [
      {
        "name": "VDS Başlangıç",
        "quantity": 1,
        "total": {
          "amount": 420,
          "currency": "TRY"
        }
      }
    ],
    "services": [
      {
        "id": 77,
        "name": "VDS Başlangıç",
        "type": "server",
        "status": "active"
      }
    ],
    "invoice": {
      "invoice_id": 55120,
      "number": "55120",
      "status": "paid",
      "state": "paid",
      "total": {
        "amount": 420,
        "currency": "TRY"
      },
      "created_at": "2026-12-05",
      "paid_at": "2026-12-05",
      "due_date": "2026-12-05"
    },
    "notes": "Müşteri ref: A-1042"
  }
}

Possible errors

Extreme points

Services

Active services, access information, renewal, cancellation, tools and password change.

Hizmetleri listele

#
GET/services

It lists your services in pages.

Parametreler

ParametreTypeCompulsoryExplanation
status querystringoptionalactive , pending , suspended , expired or cancelled .
search querystringoptionalSearch in the service name or server address.
page queryintegeroptionalPage number (≥ 1, default 1).
limit queryintegeroptionalRecords per page (1–100, default 25).

Sample request

curl "https://vatanhosting.com/api/v1/client/services?status=active" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": [
    {
      "id": 77,
      "type": "server",
      "name": "VDS Başlangıç",
      "status": "active",
      "host": "203.0.113.77",
      "product_id": 41,
      "auto_renew": false,
      "price": {
        "amount": 350,
        "currency": "TRY"
      },
      "cycle": "monthly",
      "created_at": "2026-12-05",
      "due_date": "2027-01-05"
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 25,
    "next_page": 0
  }
}

Possible errors

Service detail

#
GET/services/{id}

In addition to the list fields, it returns the product, order ID, access information, renewal options and cancellation request, if any. renewal.cycles prices are amounts with dealer discount applied.

Access information is confidential data: process only on the server side, do not write to log files.

Parametreler

ParametreTypeCompulsoryExplanation
id pathintegerCompulsoryService ID.

Sample request

curl "https://vatanhosting.com/api/v1/client/services/77" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": {
    "id": 77,
    "type": "server",
    "name": "VDS Başlangıç",
    "status": "active",
    "host": "203.0.113.77",
    "product_id": 41,
    "auto_renew": false,
    "price": {
      "amount": 350,
      "currency": "TRY"
    },
    "cycle": "monthly",
    "created_at": "2026-12-05",
    "due_date": "2027-01-05",
    "product": {
      "id": 41,
      "name": "VDS Başlangıç"
    },
    "order_id": 10234,
    "access": {
      "domain": null,
      "hostname": "vds77.example.net",
      "ip": "203.0.113.77",
      "assigned_ips": [
        "203.0.113.78"
      ],
      "username": "root",
      "password": "XXXXXXXXXXXX",
      "server": "node-1"
    },
    "renewal": {
      "available": true,
      "cycles": [
        {
          "cycle": "monthly",
          "price": {
            "amount": 350,
            "currency": "TRY"
          }
        },
        {
          "cycle": "annually",
          "price": {
            "amount": 3500,
            "currency": "TRY"
          }
        }
      ]
    },
    "cancellation": null
  }
}

Possible errors

Create renewal invoice

#
POST/services/{id}/renew

Creates a renewal invoice for the service and returns 201 and existing: false . If there is already an open renewal invoice, it returns it with 200 and existing: true . Pay the invoice with POST /invoices/ {id} /pay .

Parametreler

ParametreTypeCompulsoryExplanation
id pathintegerCompulsoryService ID.

Sample request

curl -X POST "https://vatanhosting.com/api/v1/client/services/77/renew" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

201Response
{
  "data": {
    "invoice_id": 55188,
    "number": "55188",
    "status": "unpaid",
    "state": "unpaid",
    "total": {
      "amount": 420,
      "currency": "TRY"
    },
    "created_at": "2026-12-29",
    "paid_at": null,
    "due_date": "2027-01-05",
    "existing": false
  }
}

Possible errors

Create cancellation request

#
POST/services/{id}/cancellation

Creates a cancellation request for the service and returns 201 and the cancellation object.

Parametreler

ParametreTypeCompulsoryExplanation
id pathintegerCompulsoryService ID.
urgency bodystringCompulsorynow (immediately) or period-ending (at the end of the period).
reason bodystringCompulsorynot-needed , too-expensive , switching , missing-features or other .
reason_detail bodystringoptionalWhy explanation.
note bodystringoptionalEk not.

Sample request

curl -X POST "https://vatanhosting.com/api/v1/client/services/77/cancellation" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{
    "urgency": "period-ending",
    "reason": "not-needed",
    "reason_detail": "Müşteri projeyi kapattı."
  }'

Sample answer

201Response
{
  "data": {
    "status": "pending",
    "urgency": "period-ending",
    "reason": "not-needed",
    "requested_at": "2026-12-05"
  }
}

Possible errors

Undo cancellation request

#
DELETE/services/{id}/cancellation

Withdraws the pending cancellation request. Clients that cannot send DELETE can use POST and X-Http-Method-Override: DELETE header.

Parametreler

ParametreTypeCompulsoryExplanation
id pathintegerCompulsoryService ID.

Sample request

curl -X DELETE "https://vatanhosting.com/api/v1/client/services/77/cancellation" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": {
    "revoked": true,
    "service_id": 77
  }
}

Possible errors

Service vehicles

#
GET/services/{id}/tools

Lists the tools available in the service. If the module supports it, power tools come with start-server , stop-server and restart-server switches.

Parametreler

ParametreTypeCompulsoryExplanation
id pathintegerCompulsoryService ID.

Sample request

curl "https://vatanhosting.com/api/v1/client/services/77/tools" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": [
    {
      "key": "start-server",
      "group": "power",
      "label": "Başlat",
      "capabilities": [
        "index"
      ]
    },
    {
      "key": "stop-server",
      "group": "power",
      "label": "Durdur",
      "capabilities": [
        "index"
      ]
    },
    {
      "key": "restart-server",
      "group": "power",
      "label": "Yeniden başlat",
      "capabilities": [
        "index"
      ]
    }
  ]
}

Possible errors

Start vehicle

#
POST/services/{id}/tools/{tool}/{action}

Operates a vehicle. Example: POST /services/77/tools/restart-server/index to restart the server.

Parametreler

ParametreTypeCompulsoryExplanation
id pathintegerCompulsoryService ID.
tool pathstringCompulsoryTool key (key in GET /services/ {id} /tools response).
action pathstringCompulsoryAction name (index in power tools).

Sample request

curl -X POST "https://vatanhosting.com/api/v1/client/services/77/tools/restart-server/index" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": {
    "status": "successful",
    "message": "Sunucu yeniden başlatılıyor."
  }
}

Possible errors

Change service password

#
POST/services/{id}/password

Changes the service's access password.

Parametreler

ParametreTypeCompulsoryExplanation
id pathintegerCompulsoryService ID.
password bodystringCompulsoryNew Password.

Sample request

curl -X POST "https://vatanhosting.com/api/v1/client/services/77/password" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{
    "password": "YeniSifre_2026x"
  }'

Sample answer

200Response
{
  "data": {
    "changed": true,
    "service_id": 77
  }
}

Possible errors

Extreme points

Faturalar

List invoices, see their details and pay from wallet.

Invoice summary object

Invoice lists, order and renewal responses use this summary.

Invoice summary object
ParametreTypeCompulsoryExplanation
invoice_idintegerCompulsoryInvoice ID.
numberstringCompulsoryInvoice number.
statusstringCompulsorypaid , unpaid , refund or cancelled .
statestringCompulsorypaid , unpaid , overdue , refunded or cancelled ; Overdue invoices become overdue .
totalmoneyCompulsoryInvoice total.
created_atdateCompulsoryCreation date.
paid_atdate|nullCompulsoryPayment date.
due_datedateCompulsoryPayment due date.

List invoices

#
GET/invoices

It lists your invoices in pages. Each record contains the invoice summary, first item (first_item ) and remaining due (amount_due ).

Parametreler

ParametreTypeCompulsoryExplanation
status querystringoptionalpaid , unpaid , overdue , refunded or cancelled .
page queryintegeroptionalPage number (≥ 1, default 1).
limit queryintegeroptionalRecords per page (1–100, default 25).

Sample request

curl "https://vatanhosting.com/api/v1/client/invoices?status=unpaid" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": [
    {
      "invoice_id": 55188,
      "number": "55188",
      "status": "unpaid",
      "state": "unpaid",
      "total": {
        "amount": 420,
        "currency": "TRY"
      },
      "created_at": "2026-12-29",
      "paid_at": null,
      "due_date": "2027-01-05",
      "first_item": "VDS Başlangıç (2027-01-05 - 2027-02-05)",
      "amount_due": {
        "amount": 420,
        "currency": "TRY"
      }
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 25,
    "next_page": 0
  }
}

Possible errors

Invoice detail

#
GET/invoices/{id}

In addition to the invoice summary, it returns items, sum summary (subtotal, dealer discount, VAT, total, paid, remaining) and payment transactions.

Parametreler

ParametreTypeCompulsoryExplanation
id pathintegerCompulsoryInvoice ID.

Sample request

curl "https://vatanhosting.com/api/v1/client/invoices/55188" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Sample answer

200Response
{
  "data": {
    "invoice_id": 55188,
    "number": "55188",
    "status": "unpaid",
    "state": "unpaid",
    "total": {
      "amount": 420,
      "currency": "TRY"
    },
    "created_at": "2026-12-29",
    "paid_at": null,
    "due_date": "2027-01-05",
    "items": [
      {
        "item_id": 81200,
        "description": "VDS Başlangıç",
        "service_id": 77,
        "cycle": "monthly",
        "period_start": "2027-01-05",
        "period_end": "2027-02-05",
        "quantity": 1,
        "unit_price": {
          "amount": 500,
          "currency": "TRY"
        },
        "total": {
          "amount": 500,
          "currency": "TRY"
        }
      }
    ],
    "summary": {
      "subtotal": {
        "amount": 500,
        "currency": "TRY"
      },
      "discounts": {
        "reseller": {
          "amount": 150,
          "currency": "TRY"
        },
        "coupon": null
      },
      "tax": {
        "rate": 20,
        "amount": {
          "amount": 70,
          "currency": "TRY"
        }
      },
      "total": {
        "amount": 420,
        "currency": "TRY"
      },
      "paid": {
        "amount": 0,
        "currency": "TRY"
      },
      "amount_due": {
        "amount": 420,
        "currency": "TRY"
      }
    },
    "transactions": []
  }
}

Possible errors

Pay the bill

Idempotency-Key recommended#
POST/invoices/{id}/pay

Pays the bill from wallet balance. If the balance is insufficient, insufficient_balance is returned (required and available in the details), if the invoice is not payable, invoice_not_payable is returned.

Parametreler

ParametreTypeCompulsoryExplanation
Idempotency-Key headerstringRecommendedUnique key of 8–191 characters. Send the same key and the same body on the next try.
id pathintegerCompulsoryInvoice ID.
payment.method bodystringCompulsoryHer zaman balance.

Sample request

curl -X POST "https://vatanhosting.com/api/v1/client/invoices/55188/pay" \
  -H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: fatura-55188-odeme" \
  -d '{
    "payment": {
      "method": "balance"
    }
  }'

Sample answer

200Response
{
  "data": {
    "invoice": {
      "invoice_id": 55188,
      "number": "55188",
      "status": "paid",
      "state": "paid",
      "total": {
        "amount": 420,
        "currency": "TRY"
      },
      "created_at": "2026-12-29",
      "paid_at": "2026-12-29",
      "due_date": "2027-01-05",
      "amount_due": {
        "amount": 0,
        "currency": "TRY"
      }
    },
    "payment": {
      "method": "balance",
      "status": "paid"
    }
  }
}

Possible errors