Erste Schritte
Schnellstart
Geben Sie in vier Schritten Ihre erste Bestellung über API auf.
Bewerben Sie sich als Händler
Füllen Sie das Bewerbungsformular aus (Einzelperson oder Unternehmen). Wenn Ihr Guthaben 2.000 ₺ erreicht (aktuelles Guthaben oder Gesamtaufladungen nach Antragstellung), wird Ihr Händler automatisch aktiviert . Die Aktivierung ist einmalig; Folgekosten schmälern Ihren Händlerbetrieb nicht.
API -Schlüssel generieren
Generieren Sie einen neuen Schlüssel über das Händlerpanel . Der Schlüssel beginnt mit wck_ und wird nur einmal angezeigt ; Bewahren Sie es sofort an einem sicheren Ort auf. Sie können bis zu 20 Schlüssel pro Konto erstellen und jeden Schlüssel auf bestimmte IP-Adressen beschränken.
Senden Sie Ihre erste Anfrage
GET /me gibt Ihr Konto und Ihren Kontostand zurück. Wenn Sie eine Antwort 200 erhalten, funktioniert Ihr Schlüssel.
cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/me" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/me' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/me' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/me" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())
Geben Sie Ihre erste Bestellung auf
Sehen Sie sich zuerst den Nettobetrag mit POST /orders/preview an und senden Sie dann POST /orders mit denselben Artikeln. Verwenden Sie in der Bestellung immer einen eindeutigen Idempotency-Key .
cURL PHP Node.js Python
Kopie Kopiert 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"
}
]
}'<?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$body = <<<'JSON'
{
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly"
}
]
}
JSON;
$ch = curl_init('https://vatanhosting.com/api/v1/client/orders/preview' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
'Content-Type: application/json' ,
],
CURLOPT_POSTFIELDS => $body ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/orders/preview' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
'Content-Type' : 'application/json' ,
},
body: JSON.stringify({
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly"
}
]
}),
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/orders/preview" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
json={
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
},
],
},
timeout=30 ,
)
print (res.status_code, res.json())
cURL PHP Node.js Python
Kopie Kopiert 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
}'<?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$body = <<<'JSON'
{
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly"
}
],
"payment" : {
"method" : "balance"
},
"terms" : true
}
JSON;
$ch = curl_init('https://vatanhosting.com/api/v1/client/orders' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
'Content-Type: application/json' ,
'Idempotency-Key: siparis-a1042-7f3c9e2b' ,
],
CURLOPT_POSTFIELDS => $body ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/orders' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
'Content-Type' : 'application/json' ,
'Idempotency-Key' : 'siparis-a1042-7f3c9e2b' ,
},
body: JSON.stringify({
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly"
}
],
"payment" : {
"method" : "balance"
},
"terms" : true
}),
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/orders" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
"Idempotency-Key" : "siparis-a1042-7f3c9e2b" ,
},
json={
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
},
],
"payment" : {
"method" : "balance" ,
},
"terms" : True ,
},
timeout=30 ,
)
print (res.status_code, res.json())
Temeller
Authentifizierung
Fügen Sie Ihren API Schlüssel zu jeder Anfrage als Bearer-Token im Authorization Header hinzu. Clients, die den Header nicht festlegen können, können den X-Api-Key Header verwenden. Nur GET /ping erfordert keine Authentifizierung.
Header anfordern Kopie Kopiert Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# alternatif
X-Api-Key: wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Schlüsselformat: wck_ +32 Zeichen (0-9A-Za-z ). Der Schlüssel wird bei der Erstellung nur einmal angezeigt; Nur der Digest (SHA-256) wird im System gespeichert, sodass der verlorene Schlüssel nicht wiederhergestellt werden kann.
Schlüssel werden über das Händlerpanel erstellt und gelöscht. Pro Konto können maximal 20 Schlüssel definiert werden.
Sie können für jeden Switch eine optionale IP-Zulassungsliste (vollständige IP-Adressen) definieren. Anfragen von Adressen, die nicht auf der Liste stehen, erhalten 403 ip_not_allowed .
API funktioniert nur bei aktiven Reseller -Konten; Andere Konten erhalten 403 client_api_not_allowed .
Geben Sie Ihren Schlüssel nicht in clientseitigen Code wie einen Browser, eine mobile App oder ein öffentliches Repository ein. Senden Sie Anfragen immer von Ihrem eigenen Server. Wenn der Schlüssel undicht ist, entfernen Sie ihn sofort aus dem Bedienfeld und erstellen Sie einen neuen.
Anfrage- und Antwortstruktur
API empfängt UTF-8 -codiertes JSON und gibt es zurück. Verwenden Sie Content-Type: application/json in Anfragen, an die Sie Textkörper senden. Alle Pfade beziehen sich auf die Basis-URL: https://vatanhosting.com/api/v1/client/orders .
Erfolgreiche Antwort
Daten befinden sich immer im data (Objekt, Array oder null ). In seitenbasierten Listen wird meta hinzugefügt; Es ist nur bei Bedarf verfügbar. Der Statuscode 200 und wird für Anfragen, die neue Datensätze erstellen, zu 201 .
200 Erfolgreiche Antwort Kopie Kopiert {
"data" : {
"id" : 77 ,
"status" : "active"
},
"meta" : {
"total" : 1 ,
"page" : 1 ,
"limit" : 25 ,
"next_page" : 0
}
} Fehlerreaktion
Bei Fehlern enthält der Textkörper ein einzelnes error : code für Maschinenlesbarkeit, message für Menschenlesbarkeit und details für zusätzliche Informationen, falls vorhanden. Entscheiden Sie in Ihrer Integration immer anhand code .
422 Fehlerreaktion Kopie Kopiert {
"error" : {
"code" : "insufficient_balance" ,
"message" : "Bakiye yetersiz." ,
"details" : {
"required" : {
"amount" : 420 ,
"currency" : "TRY"
},
"available" : {
"amount" : 180.5 ,
"currency" : "TRY"
}
}
}
} Methodenüberschreibung und CORS
Clients, die PATCH, PUT oder DELETE nicht senden können, können die Anfrage als POST senden und X-Http-Method-Override: PATCH|PUT|DELETE hinzufügen. Access-Control-Allow-Origin: * für API CORS: * gibt OPTIONS Anfragen zurück und antwortet mit 204 ; Verwenden Sie jedoch nicht Ihren Schlüssel im Browser.
Fehlercodes
Der HTTP-Statuscode gibt die Klasse des Fehlers an und error.code gibt die genaue Ursache an. Die Fehler 401 , 403 und 429 können an allen Enden zurückgegeben werden, die eine Authentifizierung erfordern.
Fehlercodes
Kod HTTP Bedeutung
bad_request400 Die Anfrage konnte nicht geparst werden (z. B. ungültiger JSON-Text).
operation_failed400 Der Vorgang konnte nicht abgeschlossen werden; Der Grund steht im message .
missing_token401 Es wurde kein Authorization oder X-Api-Key Header gesendet.
invalid_token401 Der Schlüssel ist ungültig oder wird nicht erkannt.
key_revoked401 Der Schlüssel wurde storniert. Erstellen Sie im Bedienfeld einen neuen Schlüssel.
owner_inactive401 Das Konto, dem der Schlüssel gehört, ist inaktiv.
ip_not_allowed403 Die Anfrage kam von einer Adresse, die nicht in der IP-Berechtigungsliste des Switches enthalten ist.
client_api_not_allowed403 Das Konto ist kein aktiver Händler; Kein API Zugriff.
insufficient_scope403 Der Schlüssel ist für diesen Vorgang nicht berechtigt.
not_found404 Der angeforderte Datensatz wurde nicht gefunden.
endpoint_not_found404 Es gibt kein solches Extrem; Überprüfen Sie den Pfad und die Version.
method_not_allowed405 Der Endpunkt unterstützt diese HTTP-Methode nicht.
idempotency_in_flight409 Die mit demselben Idempotency-Key gesendete Anfrage wird noch verarbeitet; Versuchen Sie es nach kurzer Zeit erneut.
idempotency_key_reuse422 Derselbe Idempotency-Key wurde mit einem anderen Körper verwendet.
validation_failed422 Ein oder mehrere Felder sind ungültig; Details finden Sie im details .
insufficient_balance422 Das Guthaben auf der Brieftasche reicht nicht aus. details.required und details.available Beträge werden zurückgegeben.
cycle_invalid422 Das Produkt wird in diesem Zeitraum nicht verkauft. Gültige Zeiträume finden Sie unter details.allowed .
product_not_orderable422 Das Produkt ist derzeit nicht bestellbar.
out_of_stock422 Das Produkt ist nicht vorrätig.
addon_invalid422 Das Plugin ist für dieses Produkt ungültig.
addon_option_invalid422 Plugin-Option ist ungültig.
requirement_missing422 Eine zwingende Bestellanforderung (requirements ) fehlt.
terms_required422 Vertragsbestätigung (terms: true ) wurde nicht gesendet.
payment_method_invalid422 Die Zahlungsmethode ist ungültig; Es wird nur balance akzeptiert.
invoice_not_payable422 Die Rechnung ist nicht zahlbar.
not_renewable422 Hizmet yenilenemiyor.
cancellation_exists422 Für diesen Service liegt bereits eine Stornierungsanfrage vor.
tool_action_failed422 Fahrzeugaktion fehlgeschlagen.
password_too_short422 Das Passwort ist zu kurz.
rate_limited429 Minutenanforderungslimit überschritten; Warten Sie auf Retry-After “-Sekunden.
too_many_auth_failures429 Zu viele fehlgeschlagene Authentifizierungsversuche; warte eine Weile.
server_error500 Unerwarteter Serverfehler. Versuchen Sie es erneut; Wenn das Problem weiterhin besteht, wenden Sie sich an den Support.
Idempotency
Fügen Sie Idempotency-Key Header (8–191 Zeichen) zu POST-Anfragen hinzu, damit Sie eine Anfrage im Falle eines Netzwerkausfalls oder einer Zeitüberschreitung sicher wiederholen können. Senden Sie immer POST /orders und POST /invoices/ {id} /pay .
Idempotenzverhalten
Status Abschluss
Gleicher Schlüssel und gleiche Karosserie, innerhalb von 24 Stunden Der Vorgang wird nicht wiederholt; Die erste Antwort wird unverändert zurückgegeben und Idempotency-Replayed: true wird hinzugefügt.
Gleicher Schlüssel, anderer Körper 422 idempotency_key_reuse
Erste Anfrage wird noch bearbeitet 409 idempotency_in_flight ; Versuchen Sie es nach kurzer Zeit erneut.
Generieren Sie den Schlüssel einmal pro Transaktion (z. B. aus Ihrer eigenen Bestellnummer oder einer UUID) und ändern Sie ihn bei Wiederholungsversuchen nicht.
Anforderungslimit
Für jeden API Schlüssel gilt ein Limit von 60 Anfragen pro Minute (festes 60-Sekunden-Fenster). Jede authentifizierte Antwort enthält Kopfzeilen, die Ihre verbleibenden Rechte angeben.
Anforderungslimit-Header
Titel Erläuterung
X-RateLimit-LimitGesamtzahl der Anfragen im Fenster (60).
X-RateLimit-RemainingRestliche Anfrage direkt im Fenster.
X-RateLimit-ResetDer Zeitpunkt, zu dem das Fenster zurückgesetzt wird (Unix-Zeitstempel).
Retry-AfterNur bei 429 Antworten: Sekunden warten, bevor Sie es erneut versuchen.
429 Wenn der Grenzwert überschritten wird Kopie Kopiert 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." }} Führen Sie alle paar Sekunden Statusabfragen durch und warten Sie auf Retry-After wenn Sie 429 erhalten. Wiederholte fehlgeschlagene Authentifizierungsversuche werden vorübergehend mit too_many_auth_failures blockiert.
Abrechnungszeiträume
In Bestellpositionen und Preislisten nimmt cycle Zyklusfeld einen der folgenden Werte an. Die Zeiträume, in denen ein Produkt angeboten wird, sind in pricing aufgeführt. Wenn ein Zeitraum übermittelt wird, der nicht angeboten wird, wird 422 cycle_invalid zurückgegeben und gültige Werte kommen in details.allowed .
Abrechnungszeiträume
Wert Zeitraum
hourlyStündliche Nutzung
monthlyMonatlich
quarterly3 Monate alt
semiannually6 Monate alt
annuallyJährlich
biennially2 Jahre
triennially3 Jahre
onetimeEinmal
Händlerpreise
Der Händlerrabatt wird automatisch auf alle Bestellungen angewendet, die Sie über API und Panel aufgeben. Erhalten Sie immer den genauen Nettopreis mit GET /reseller/prices oder POST /orders/preview .
Privathändler bis zu 30 % Rabatt
Firmenhändler bis zu 35 % Rabatt
Der Rabatt gilt für Produkte, Add-ons und Installationsgebühren.
Der ermäßigte Preis liegt nie unter der Kostenbasis des Produkts; Daher ist der tatsächliche Rabattsatz bei einigen Produkten niedriger. Der produktbasierte Preis wird im Feld discount_pct angezeigt.
Domainnamen und stündliche Nutzungsgebühren sind vom Rabatt ausgeschlossen.
Zusätzlich zum Händlerrabatt wird kein Coupon oder Gruppenrabatt gewährt.
Zum rabattierten Betrag kommt die Mehrwertsteuer hinzu.
API -Bestellungen werden nur aus dem Wallet-Guthaben (payment.method = "balance" ) bezahlt.
Sie können zu jedem gewünschten Preis an Ihre eigenen Kunden verkaufen.
Listenpreis (monatlich) 500,00 ₺
Händlerrabatt (30 % auf dieses Produkt) −150,00 ₺
MwSt. (20 % auf den ermäßigten Betrag) +70,00 ₺
420,00 ₺ , zahlbar aus dem Portemonnaie
Das Beispiel bezieht sich auf ein Produkt, für das der volle Rabatt gewährt wird. Die Preise variieren je nach Produkt und Händlertyp.
Ende bis Ende
Beispiel für einen vollständigen Ablauf
Anrufe sind erforderlich, um für einen Kunden VDS zu erwerben, Zugangsinformationen bereitzustellen und nach einem Monat zu verlängern.
Listenhändlerpreise
Wählen Sie das Produkt und den Zeitraum aus; reseller Betrag ist Ihr Netto-Einkaufspreis.
cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/reseller/prices?search=VDS" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/reseller/prices?search=VDS' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/reseller/prices?search=VDS' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/reseller/prices?search=VDS" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())
Sehen Sie sich die Bestellung in der Vorschau an
Vergleichen Sie total mit Ihrem Kontostand (GET /balance ); Wenn es nicht ausreicht, laden Sie zuerst das Guthaben auf.
cURL PHP Node.js Python
Kopie Kopiert 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"
}
}
]
}'<?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$body = <<<'JSON'
{
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"requirements" : {
"7" : "21"
}
}
]
}
JSON;
$ch = curl_init('https://vatanhosting.com/api/v1/client/orders/preview' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
'Content-Type: application/json' ,
],
CURLOPT_POSTFIELDS => $body ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/orders/preview' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
'Content-Type' : 'application/json' ,
},
body: JSON.stringify({
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"requirements" : {
"7" : "21"
}
}
]
}),
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/orders/preview" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
json={
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"requirements" : {
"7" : "21" ,
},
},
],
},
timeout=30 ,
)
print (res.status_code, res.json())
Geben Sie die Bestellung bei Idempotency-Key auf
Lautet die Antwort 201 und payment.status: "paid" wurde der Betrag von Ihrem Wallet abgebucht und die Installation gestartet. Wenn die Verbindung unterbrochen wird, versuchen Sie es erneut mit demselben Schlüssel und demselben Körper.
cURL PHP Node.js Python
Kopie Kopiert 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"
}'<?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$body = <<<'JSON'
{
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"requirements" : {
"7" : "21"
}
}
],
"payment" : {
"method" : "balance"
},
"terms" : true ,
"notes" : "Müşteri ref: A-1042"
}
JSON;
$ch = curl_init('https://vatanhosting.com/api/v1/client/orders' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
'Content-Type: application/json' ,
'Idempotency-Key: siparis-a1042-7f3c9e2b' ,
],
CURLOPT_POSTFIELDS => $body ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/orders' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
'Content-Type' : 'application/json' ,
'Idempotency-Key' : 'siparis-a1042-7f3c9e2b' ,
},
body: JSON.stringify({
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"requirements" : {
"7" : "21"
}
}
],
"payment" : {
"method" : "balance"
},
"terms" : true ,
"notes" : "Müşteri ref: A-1042"
}),
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/orders" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
"Idempotency-Key" : "siparis-a1042-7f3c9e2b" ,
},
json={
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"requirements" : {
"7" : "21" ,
},
},
],
"payment" : {
"method" : "balance" ,
},
"terms" : True ,
"notes" : "Müşteri ref: A-1042" ,
},
timeout=30 ,
)
print (res.status_code, res.json())
Kurulumu takip edin
Abfrage alle 15 Sekunden, bis services -Array in der GET /orders/ {id} -Antwort voll ist und alle Services active .
cURL PHP Node.js Python
Kopie Kopiert # 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' <?php
$base = 'https://vatanhosting.com/api/v1/client' ;
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
do {
$ch = curl_init($base . '/orders/10234' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $token ],
]);
$order = json_decode (curl_exec($ch ), true )['data' ];
curl_close($ch );
$services = $order ['services' ];
$active = array_filter ($services , function ($s ) { return $s ['status' ] === 'active' ; });
$ready = $services && count ($active ) === count ($services );
if (!$ready ) {
sleep (15 );
}
} while (!$ready );
print_r (array_column ($services , 'id' ));const BASE = 'https://vatanhosting.com/api/v1/client' ;
const headers = { Authorization: 'Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' };
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
(async () => {
let order;
for (;;) {
const res = await fetch (`${BASE}/orders/10234` , { headers });
order = (await res.json()).data;
const s = order.services;
if (s.length && s.every((x) => x.status === 'active' )) break ;
await sleep(15000 );
}
console.log(order.services.map((x) => x.id));
})();import time
import requests
BASE = "https://vatanhosting.com/api/v1/client"
HEADERS = {"Authorization" : "Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }
while True :
res = requests.get(f"{BASE}/orders/10234" , headers=HEADERS, timeout=30 )
order = res.json()["data" ]
services = order["services" ]
if services and all (s["status" ] == "active" for s in services):
break
time.sleep(15 )
print ([s["id" ] for s in services])
Erhalten Sie Zugangsinformationen
Übermitteln Sie die Serveradresse, den Benutzernamen und das Passwort im access über einen sicheren Kanal an Ihren Client.
cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/services/77" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/services/77' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/services/77' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/services/77" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())
Erneuern Sie die Rechnung und bezahlen Sie sie
Erstellen Sie eine Verlängerungsrechnung (wenn eine offene Rechnung vorhanden ist, wird diese zurückgegeben) und bezahlen Sie dann die Rechnung aus dem Wallet mit der zurückgegebenen invoice_id .
cURL PHP Node.js Python
Kopie Kopiert curl -X POST "https://vatanhosting.com/api/v1/client/services/77/renew" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/services/77/renew' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/services/77/renew' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/services/77/renew" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())
cURL PHP Node.js Python
Kopie Kopiert 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"
}
}'<?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$body = <<<'JSON'
{
"payment" : {
"method" : "balance"
}
}
JSON;
$ch = curl_init('https://vatanhosting.com/api/v1/client/invoices/55188/pay' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
'Content-Type: application/json' ,
'Idempotency-Key: fatura-55188-odeme' ,
],
CURLOPT_POSTFIELDS => $body ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/invoices/55188/pay' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
'Content-Type' : 'application/json' ,
'Idempotency-Key' : 'fatura-55188-odeme' ,
},
body: JSON.stringify({
"payment" : {
"method" : "balance"
}
}),
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/invoices/55188/pay" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
"Idempotency-Key" : "fatura-55188-odeme" ,
},
json={
"payment" : {
"method" : "balance" ,
},
},
timeout=30 ,
)
print (res.status_code, res.json())
Extrempunkte
Sistem
Überprüfen Sie die Verbindung und Ihren API Schlüssel.
Verbindungstest Keine Authentifizierung erforderlich # GET /ping
Überprüft, ob auf API zugegriffen werden kann. Erfordert keine Authentifizierung; Geeignet zur Überwachung (Gesundheitscheck).
Parametreler Dieser Tipp benötigt keine Parameter.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/ping" <?php
$ch = curl_init('https://vatanhosting.com/api/v1/client/ping' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/ping' );
console.log(res.status, await res.json());
})();import requests
res = requests.get(
"https://vatanhosting.com/api/v1/client/ping" ,
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"data" : {
"pong" : true ,
"version" : "v1" ,
"time" : "2026-12-05 14:30:00"
}
}Mögliche Fehler GET /whoami
Gibt API Schlüssel und den Besitzer zurück, der die Anfrage gestellt hat. id ist die ID des Schlüssels, owner_id ist die ID des Kontos. Verwenden Sie es, um beim Einrichten der Integration zu überprüfen, ob der Schalter funktioniert.
Parametreler Dieser Tipp benötigt keine Parameter.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/whoami" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/whoami' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/whoami' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/whoami" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"data" : {
"id" : 12 ,
"type" : "client" ,
"name" : "Mağaza entegrasyonu" ,
"permissions" : [
"*"
],
"last_access" : "2026-12-05 14:28:11" ,
"owner_id" : 4821
}
}Mögliche Fehler
Extrempunkte
Konto und Kontostand
Ihr Kontoprofil, Ihr Wallet-Guthaben und Ihre Kontostandbewegungen.
GET /me
Gibt das Profil und den aktuellen Wallet-Saldo des Kontos zurück, das den Schlüssel besitzt. Der Wert kind ist individual oder corporate . Firmeninformationen befinden sich im company .
Parametreler Dieser Tipp benötigt keine Parameter.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/me" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/me' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/me' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/me" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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"
}
}Mögliche Fehler GET /balance
Gibt das Wallet-Guthaben zurück. API -Bestellungen werden nur aus diesem Guthaben bezahlt; Bitte überprüfen Sie vor der Bestellung, ob Sie den Gesamtbetrag einhalten. Die Flags wallet_empty und low_balance können zum Anzeigen von Warnungen verwendet werden.
Parametreler Dieser Tipp benötigt keine Parameter.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/balance" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/balance' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/balance' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/balance" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"data" : {
"balance" : {
"amount" : 2450.75 ,
"currency" : "TRY"
},
"wallet_empty" : false ,
"low_balance" : false
}
}Mögliche Fehler GET /balance/transactions
Es listet Saldo-Uploads (up ) und Ausgaben (down ) auf Seiten auf. created_at liegt im ISO 8601-Format vor.
Parametreler Parametre Typ Obligatorisch Erläuterung type query string optional up (laden) oder down (ausgeben).page query integer optional Seitenzahl (≥ 1, Standard 1). limit query integer optional Datensätze pro Seite (1–100, Standard 25).
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/balance/transactions?type=down&limit=25" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/balance/transactions?type=down&limit=25' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/balance/transactions?type=down&limit=25' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/balance/transactions?type=down&limit=25" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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
}
}Mögliche Fehler
Extrempunkte
Händler
Ihr Händlerstatus und die für Sie spezifischen Nettokaufpreise. Bei diesen beiden Enden handelt es sich um Reseller-Erweiterungen, die der Client API hinzugefügt wurden.
Reseller-Status Reseller-Erweiterung # GET /reseller
Gibt Ihren Händlerstatus, -typ, -rabattsatz und den für die Aktivierung erforderlichen Kontostand zurück. status : pending , active , suspended , rejected oder none . rate ist der höchste Diskontsatz, der je nach Typ erreicht werden kann; Für den tatsächlichen Preis pro Produkt verwenden Sie GET /reseller/prices .
Parametreler Dieser Tipp benötigt keine Parameter.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/reseller" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/reseller' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/reseller' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/reseller" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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"
}
}Mögliche Fehler Händlerpreise Reseller-Erweiterung # GET /reseller/prices
Es gibt den Listenpreis (list ), Ihren spezifischen Nettoeinkaufspreis (reseller ) und den angewendeten Rabattsatz (discount_pct ) für jedes Produkt und jeden Zeitraum zurück. Die Kostenbasis ist der angewandte Endpreis; Die Mehrwertsteuer ist ausgeschlossen. Paging ist dasselbe wie GET /products .
Für das zweite Produkt im Beispiel bleibt der Rabatt bei 22 %: Der rabattierte Preis unterschreitet die Kostenbasis nicht.
Parametreler Parametre Typ Obligatorisch Erläuterung category query integer optional Nach Kategorie-ID filtern. search query string optional Suche im Produktnamen. page query integer optional Seitenzahl (≥ 1, Standard 1). limit query integer optional Datensätze pro Seite (1–100, Standard 25).
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/reseller/prices?search=VDS" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/reseller/prices?search=VDS' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/reseller/prices?search=VDS' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/reseller/prices?search=VDS" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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
}
}Mögliche Fehler
Extrempunkte
Produkte
Bestellbare Produkte, Kategorien, Add-ons und Bestellvoraussetzungen. Die Preise hier sind Listenpreise.
GET /products/categories
Gibt Produktkategorien zurück. parent ist die ID der übergeordneten Kategorie; Die Gesamtzahl der Datensätze ist in meta.total .
Parametreler Dieser Tipp benötigt keine Parameter.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/products/categories" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/products/categories' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/products/categories' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/products/categories" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"data" : [
{
"id" : 3 ,
"parent" : 0 ,
"type" : "server" ,
"name" : "VDS Sunucular"
},
{
"id" : 5 ,
"parent" : 0 ,
"type" : "server" ,
"name" : "Oyun Sunucuları"
}
],
"meta" : {
"total" : 2
}
}Mögliche Fehler GET /products
Gibt Produkte mit Listenpreisen zurück; Der Händlerrabatt gilt nicht. Für den Nettokaufpreis verwenden Sie GET /reseller/prices oder POST /orders/preview . Die Währung der Preise ist meta.currency .
Parametreler Parametre Typ Obligatorisch Erläuterung category query integer optional Nach Kategorie-ID filtern. search query string optional Suche im Produktnamen. type query string optional Filtern Sie nach Produkttyp. page query integer optional Seitenzahl (≥ 1, Standard 1). limit query integer optional Datensätze pro Seite (1–100, Standard 25).
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/products?category=3" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/products?category=3' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/products?category=3' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/products?category=3" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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"
}
}Mögliche Fehler GET /products/{id}
Gibt ein einzelnes Produkt mit Listenfeldern plus Beschreibung, quantity , Bestelllimit pro Benutzer, addons , requirements und Domänenmodus (domain.mode : none , chooser , required …) zurück. Hier erhalten Sie die IDs der Bestellposition.
Parametreler Parametre Typ Obligatorisch Erläuterung id path integer Obligatorisch Produkt-ID.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/products/41" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/products/41' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/products/41' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/products/41" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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"
}
}
}Mögliche Fehler
Extrempunkte
Bestellungen
Sehen Sie sich den Warenkorb in der Vorschau an, erstellen Sie eine per Wallet bezahlte Bestellung und folgen Sie der Einrichtung.
Bestellartikelobjekt
Jedes Element des items -Arrays hat diese Struktur. In einer Anfrage können maximal 20 Artikel eingereicht werden.
Bestellartikelobjekt Parametre Typ Obligatorisch Erläuterung product_idinteger Obligatorisch Produkt-ID. cyclestring Obligatorisch Abrechnungszeitraum (z. B. monthly ). quantityinteger optional Menge, Standard 1 . domain.optionstring optional owned (Ihre eigene Domain) oder none .domain.namestring optional Domainname. addonsobject optional Zuordnung von Plugin-ID zu Options-ID: {"<addon_id>": "<option_id>"} oder ["<id>", …] in Mehrfachauswahl. requirementsobject optional Zuordnung von Anforderungsfeld-ID zu Wert: {"<field_id>": "değer"} .
POST /orders/preview
Der Warenkorb wird berechnet, ohne dass Aufzeichnungen erstellt werden: Artikelbeträge, discount , tax und zu total Gesamtbetrag. Alle Beträge sind Geldgegenstände. Rufen Sie vor der Bestellung an und vergleichen Sie total Gesamtwert mit Ihrem Guthaben.
Parametreler Parametre Typ Obligatorisch Erläuterung items body array Obligatorisch Bestellen Sie Artikel (bis zu 20). Die Struktur finden Sie weiter unten im Objekt „Bestellartikel“. billing_profile_id body integer optional Abrechnungsprofil-ID.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert 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"
}
}
]
}'<?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$body = <<<'JSON'
{
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"quantity" : 1 ,
"requirements" : {
"7" : "21"
}
}
]
}
JSON;
$ch = curl_init('https://vatanhosting.com/api/v1/client/orders/preview' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
'Content-Type: application/json' ,
],
CURLOPT_POSTFIELDS => $body ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/orders/preview' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
'Content-Type' : 'application/json' ,
},
body: JSON.stringify({
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"quantity" : 1 ,
"requirements" : {
"7" : "21"
}
}
]
}),
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/orders/preview" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
json={
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"quantity" : 1 ,
"requirements" : {
"7" : "21" ,
},
},
],
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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"
}
}
}Mögliche Fehler Ordnung schaffen Idempotency-Key empfohlen # POST /orders
Es erstellt die Bestellung und zieht den Betrag von Ihrem Wallet ein. Wenn der Saldo den Gesamtwert nicht erreicht 422 insufficient_balance zurückgegeben, ohne dass Datensätze erstellt werden. Bei Zahlungseingang werden die Dienste automatisch installiert. Die erfolgreiche Antwort wird mit 201 codiert.
Geben Sie für jede Bestellung einen eindeutigen Idempotency-Key an. Im Falle einer Zeitüberschreitung oder eines Verbindungsfehlers versuchen Sie es erneut mit demselben Schlüssel und demselben Textkörper. Doppelbestellungen kommen nicht vor. payment.status lautet paid oder failed und im Fehlerfall wird payment.error hinzugefügt.
Parametreler Parametre Typ Obligatorisch Erläuterung Idempotency-Key header string Empfohlen Eindeutiger Schlüssel mit 8–191 Zeichen. Senden Sie beim nächsten Versuch denselben Schlüssel und denselben Text. items body array Obligatorisch Bestellen Sie Artikel (bis zu 20). payment.method body string Obligatorisch Her zaman balance. terms body boolean Obligatorisch true , um die Servicevereinbarung zu bestätigen.notes body string optional Bestellvermerk (z. B. Ihre eigene Kundenreferenz).
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert 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"
}'<?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$body = <<<'JSON'
{
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"quantity" : 1 ,
"requirements" : {
"7" : "21"
}
}
],
"payment" : {
"method" : "balance"
},
"terms" : true ,
"notes" : "Müşteri ref: A-1042"
}
JSON;
$ch = curl_init('https://vatanhosting.com/api/v1/client/orders' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
'Content-Type: application/json' ,
'Idempotency-Key: siparis-a1042-7f3c9e2b' ,
],
CURLOPT_POSTFIELDS => $body ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/orders' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
'Content-Type' : 'application/json' ,
'Idempotency-Key' : 'siparis-a1042-7f3c9e2b' ,
},
body: JSON.stringify({
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"quantity" : 1 ,
"requirements" : {
"7" : "21"
}
}
],
"payment" : {
"method" : "balance"
},
"terms" : true ,
"notes" : "Müşteri ref: A-1042"
}),
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/orders" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
"Idempotency-Key" : "siparis-a1042-7f3c9e2b" ,
},
json={
"items" : [
{
"product_id" : 41 ,
"cycle" : "monthly" ,
"quantity" : 1 ,
"requirements" : {
"7" : "21" ,
},
},
],
"payment" : {
"method" : "balance" ,
},
"terms" : True ,
"notes" : "Müşteri ref: A-1042" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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"
}
}
}Mögliche Fehler GET /orders
Es listet Ihre Bestellungen seitenweise auf.
Parametreler Parametre Typ Obligatorisch Erläuterung status query string optional waiting , inprocess , active oder cancelled .page query integer optional Seitenzahl (≥ 1, Standard 1). limit query integer optional Datensätze pro Seite (1–100, Standard 25).
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/orders?status=active" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/orders?status=active' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/orders?status=active' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/orders?status=active" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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
}
}Mögliche Fehler GET /orders/{id}
Zusätzlich zu den Listenfeldern werden Artikel, services , Rechnungszusammenfassung und Notizen zurückgegeben. Um die Installation zu überwachen, fragen Sie diese in regelmäßigen Abständen ab, bis die Dienste active sind.
Parametreler Parametre Typ Obligatorisch Erläuterung id path integer Obligatorisch Bestell-ID.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/orders/10234" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/orders/10234' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/orders/10234' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/orders/10234" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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"
}
}Mögliche Fehler
Extrempunkte
Dienstleistungen
Aktive Dienste, Zugangsinformationen, Verlängerung, Kündigung, Tools und Passwortänderung.
GET /services
Es listet Ihre Dienste in Seiten auf.
Parametreler Parametre Typ Obligatorisch Erläuterung status query string optional active , pending , suspended , expired oder cancelled .search query string optional Suchen Sie nach dem Dienstnamen oder der Serveradresse. page query integer optional Seitenzahl (≥ 1, Standard 1). limit query integer optional Datensätze pro Seite (1–100, Standard 25).
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/services?status=active" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/services?status=active' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/services?status=active' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/services?status=active" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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
}
}Mögliche Fehler GET /services/{id}
Zusätzlich zu den Listenfeldern werden das Produkt, die Bestell-ID, access , renewal und ggf. eine cancellation zurückgegeben. Bei den Preisen renewal.cycles handelt es sich um Beträge mit gewährtem Händlerrabatt.
Zugriffsinformationen sind vertrauliche Daten: Nur serverseitig verarbeiten, nicht in Logdateien schreiben.
Parametreler Parametre Typ Obligatorisch Erläuterung id path integer Obligatorisch Dienst-ID.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/services/77" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/services/77' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/services/77' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/services/77" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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
}
}Mögliche Fehler Erneuerungsrechnung erstellen # POST /services/{id}/renew
Erstellt eine Verlängerungsrechnung für den Service und gibt 201 zurück und existing: false . Wenn bereits eine offene Verlängerungsrechnung vorhanden ist, wird diese mit 200 und existing: true zurückgegeben. Bezahlen Sie die Rechnung mit POST /invoices/ {id} /pay .
Parametreler Parametre Typ Obligatorisch Erläuterung id path integer Obligatorisch Dienst-ID.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl -X POST "https://vatanhosting.com/api/v1/client/services/77/renew" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/services/77/renew' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/services/77/renew' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/services/77/renew" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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
}
}Mögliche Fehler POST /services/{id}/cancellation
Erstellt eine Stornierungsanforderung für den Dienst und gibt 201 und das Stornierungsobjekt zurück.
Parametreler Parametre Typ Obligatorisch Erläuterung id path integer Obligatorisch Dienst-ID. urgency body string Obligatorisch now (sofort) oder period-ending (am Ende der Periode).reason body string Obligatorisch not-needed , too-expensive , switching , missing-features oder other .reason_detail body string optional Warum Erklärung. note body string optional Ek not.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert 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ı."
}'<?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$body = <<<'JSON'
{
"urgency" : "period-ending" ,
"reason" : "not-needed" ,
"reason_detail" : "Müşteri projeyi kapattı."
}
JSON;
$ch = curl_init('https://vatanhosting.com/api/v1/client/services/77/cancellation' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
'Content-Type: application/json' ,
],
CURLOPT_POSTFIELDS => $body ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/services/77/cancellation' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
'Content-Type' : 'application/json' ,
},
body: JSON.stringify({
"urgency" : "period-ending" ,
"reason" : "not-needed" ,
"reason_detail" : "Müşteri projeyi kapattı."
}),
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/services/77/cancellation" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
json={
"urgency" : "period-ending" ,
"reason" : "not-needed" ,
"reason_detail" : "Müşteri projeyi kapattı." ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"data" : {
"status" : "pending" ,
"urgency" : "period-ending" ,
"reason" : "not-needed" ,
"requested_at" : "2026-12-05"
}
}Mögliche Fehler Stornierungsanfrage rückgängig machen # DELETE /services/{id}/cancellation
Zieht die ausstehende Stornierungsanfrage zurück. Clients, die DELETE nicht senden können, können POST und X-Http-Method-Override: DELETE Header verwenden.
Parametreler Parametre Typ Obligatorisch Erläuterung id path integer Obligatorisch Dienst-ID.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl -X DELETE "https://vatanhosting.com/api/v1/client/services/77/cancellation" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/services/77/cancellation' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'DELETE' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/services/77/cancellation' , {
method: 'DELETE' ,
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.delete(
"https://vatanhosting.com/api/v1/client/services/77/cancellation" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"data" : {
"revoked" : true ,
"service_id" : 77
}
}Mögliche Fehler GET /services/{id}/tools
Listet die im Dienst verfügbaren Tools auf. Wenn das Modul dies unterstützt, sind Elektrowerkzeuge mit den Schaltern start-server , stop-server und restart-server ausgestattet.
Parametreler Parametre Typ Obligatorisch Erläuterung id path integer Obligatorisch Dienst-ID.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/services/77/tools" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/services/77/tools' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/services/77/tools' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/services/77/tools" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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"
]
}
]
}Mögliche Fehler POST /services/{id}/tools/{tool}/{action}
Betreibt ein Fahrzeug. Beispiel: POST /services/77/tools/restart-server/index um den Server neu zu starten.
Parametreler Parametre Typ Obligatorisch Erläuterung id path integer Obligatorisch Dienst-ID. tool path string Obligatorisch Werkzeugschlüssel (key in der GET /services/ {id} /tools -Antwort). action path string Obligatorisch Aktionsname (index in Elektrowerkzeugen).
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl -X POST "https://vatanhosting.com/api/v1/client/services/77/tools/restart-server/index" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/services/77/tools/restart-server/index' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/services/77/tools/restart-server/index' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/services/77/tools/restart-server/index" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"data" : {
"status" : "successful" ,
"message" : "Sunucu yeniden başlatılıyor."
}
}Mögliche Fehler POST /services/{id}/password
Ändert das Zugangspasswort des Dienstes.
Parametreler Parametre Typ Obligatorisch Erläuterung id path integer Obligatorisch Dienst-ID. password body string Obligatorisch Neues Passwort.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert 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"
}'<?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$body = <<<'JSON'
{
"password" : "YeniSifre_2026x"
}
JSON;
$ch = curl_init('https://vatanhosting.com/api/v1/client/services/77/password' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
'Content-Type: application/json' ,
],
CURLOPT_POSTFIELDS => $body ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/services/77/password' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
'Content-Type' : 'application/json' ,
},
body: JSON.stringify({
"password" : "YeniSifre_2026x"
}),
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/services/77/password" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
json={
"password" : "YeniSifre_2026x" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"data" : {
"changed" : true ,
"service_id" : 77
}
}Mögliche Fehler
Extrempunkte
Faturalar
Listen Sie Rechnungen auf, sehen Sie sich deren Details an und bezahlen Sie aus der Brieftasche.
Rechnungszusammenfassungsobjekt
Rechnungslisten, Bestell- und Verlängerungsantworten nutzen diese Zusammenfassung.
Rechnungszusammenfassungsobjekt Parametre Typ Obligatorisch Erläuterung invoice_idinteger Obligatorisch Rechnungs-ID. numberstring Obligatorisch Rechnungsnummer. statusstring Obligatorisch paid , unpaid , refund oder cancelled .statestring Obligatorisch paid , unpaid , overdue , refunded oder cancelled ; Überfällige Rechnungen werden overdue .totalmoney Obligatorisch Rechnungssumme. created_atdate Obligatorisch Erstellungsdatum. paid_atdate|null Obligatorisch Zahlungsdatum. due_datedate Obligatorisch Fälligkeitsdatum der Zahlung.
GET /invoices
Es listet Ihre Rechnungen seitenweise auf. Jeder Datensatz enthält die Rechnungszusammenfassung, den ersten Posten (first_item ) und die verbleibende Fälligkeit (amount_due ).
Parametreler Parametre Typ Obligatorisch Erläuterung status query string optional paid , unpaid , overdue , refunded oder cancelled .page query integer optional Seitenzahl (≥ 1, Standard 1). limit query integer optional Datensätze pro Seite (1–100, Standard 25).
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/invoices?status=unpaid" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/invoices?status=unpaid' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/invoices?status=unpaid' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/invoices?status=unpaid" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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
}
}Mögliche Fehler GET /invoices/{id}
Zusätzlich zur Rechnungszusammenfassung werden Artikel, summary (Zwischensumme, Händlerrabatt, Mehrwertsteuer, Gesamt, bezahlt, verbleibend) und Zahlungsvorgänge zurückgegeben.
Parametreler Parametre Typ Obligatorisch Erläuterung id path integer Obligatorisch Rechnungs-ID.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert curl "https://vatanhosting.com/api/v1/client/invoices/55188" \
-H "Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" <?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$ch = curl_init('https://vatanhosting.com/api/v1/client/invoices/55188' );
curl_setopt_array($ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
],
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/invoices/55188' , {
headers: {
Authorization: `Bearer ${token}` ,
},
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.get(
"https://vatanhosting.com/api/v1/client/invoices/55188" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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" : []
}
}Mögliche Fehler Die Rechnung bezahlen Idempotency-Key empfohlen # POST /invoices/{id}/pay
Bezahlt die Rechnung aus dem Guthaben der Brieftasche. Wenn der Saldo nicht ausreicht, wird insufficient_balance zurückgegeben (required und in den Details available ). Wenn die Rechnung nicht zahlbar ist, wird invoice_not_payable zurückgegeben.
Parametreler Parametre Typ Obligatorisch Erläuterung Idempotency-Key header string Empfohlen Eindeutiger Schlüssel mit 8–191 Zeichen. Senden Sie beim nächsten Versuch denselben Schlüssel und denselben Text. id path integer Obligatorisch Rechnungs-ID. payment.method body string Obligatorisch Her zaman balance.
Musteranfrage cURL PHP Node.js Python
Kopie Kopiert 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"
}
}'<?php
$token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
$body = <<<'JSON'
{
"payment" : {
"method" : "balance"
}
}
JSON;
$ch = curl_init('https://vatanhosting.com/api/v1/client/invoices/55188/pay' );
curl_setopt_array($ch , [
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_TIMEOUT => 30 ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token ,
'Content-Type: application/json' ,
'Idempotency-Key: fatura-55188-odeme' ,
],
CURLOPT_POSTFIELDS => $body ,
]);
$response = curl_exec($ch );
$status = curl_getinfo($ch , CURLINFO_HTTP_CODE);
curl_close($ch );
echo $status , PHP_EOL;
print_r (json_decode ($response , true ));const token = 'wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
(async () => {
const res = await fetch ('https://vatanhosting.com/api/v1/client/invoices/55188/pay' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${token}` ,
'Content-Type' : 'application/json' ,
'Idempotency-Key' : 'fatura-55188-odeme' ,
},
body: JSON.stringify({
"payment" : {
"method" : "balance"
}
}),
});
console.log(res.status, await res.json());
})();import requests
TOKEN = "wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
res = requests.post(
"https://vatanhosting.com/api/v1/client/invoices/55188/pay" ,
headers={
"Authorization" : f"Bearer {TOKEN}" ,
"Idempotency-Key" : "fatura-55188-odeme" ,
},
json={
"payment" : {
"method" : "balance" ,
},
},
timeout=30 ,
)
print (res.status_code, res.json())Beispielantwort {
"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"
}
}
}Mögliche Fehler