Aan de slag
Snel beginnen
Plaats in vier stappen uw eerste bestelling via API.
Dealerschap aanvragen
Vul het aanvraagformulier in (individu of bedrijf). Wanneer uw portemonneesaldo 2.000 ₺ bereikt (huidige saldo of totale opwaarderingen na aanvraag), wordt uw dealerschap automatisch geactiveerd . Activering is eenmalig; De daaropvolgende kosten zullen uw dealerschap niet verminderen.
Genereer API sleutel
Genereer een nieuwe sleutel via het dealerpaneel . De sleutel begint met wck_ en wordt slechts één keer getoond ; Bewaar het onmiddellijk op een veilige plaats. U kunt maximaal 20 sleutels per account aanmaken, waarbij u elke sleutel beperkt tot specifieke IP-adressen.
Dien uw eerste aanvraag in
GET /me retourneert uw account en saldo. Als u een antwoord 200 krijgt, werkt uw sleutel.
cURL PHP Node.js Python
Kopiëren Gekopieerd 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())
Plaats uw eerste bestelling
Bekijk eerst het nettobedrag met POST /orders/preview en verstuur vervolgens POST /orders met dezelfde artikelen. Gebruik altijd een unieke Idempotency-Key in de bestelling.
cURL PHP Node.js Python
Kopiëren Gekopieerd 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
Kopiëren Gekopieerd 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
Authenticatie
Voeg uw API sleutel aan elk verzoek toe als een Bearer-token in de Authorization header. Clients die de header niet kunnen instellen, kunnen de X-Api-Key header gebruiken. Alleen GET /ping vereist geen authenticatie.
Vraag headers aan Kopiëren Gekopieerd Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# alternatif
X-Api-Key: wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Sleutelformaat: wck_ +32 tekens (0-9A-Za-z ). De sleutel wordt slechts één keer getoond wanneer deze wordt aangemaakt; Alleen de samenvatting (SHA-256) wordt in het systeem opgeslagen, de verloren sleutel kan dus niet worden hersteld.
Sleutels worden aangemaakt en geannuleerd via het dealerpaneel. Per account kunnen maximaal 20 sleutels worden gedefinieerd.
U kunt voor elke switch een optionele lijst met toegestane IP-adressen (volledige IP-adressen) definiëren. Verzoeken van adressen die niet op de lijst staan, ontvangen 403 ip_not_allowed .
API werkt alleen op actieve reselleraccounts ; andere accounts krijgen 403 client_api_not_allowed .
Plaats uw sleutel niet in code aan de clientzijde, zoals een browser, mobiele app of openbare opslagplaats. Verstuur verzoeken altijd vanaf uw eigen server; Als de sleutel lekt, annuleert u deze onmiddellijk via het paneel en maakt u een nieuwe aan.
Vraag- en antwoordstructuur
API ontvangt en retourneert UTF-8 -gecodeerde JSON. Gebruik Content-Type: application/json in verzoeken waarbij u hoofdteksten verzendt. Alle paden zijn relatief ten opzichte van de basis-URL: https://vatanhosting.com/api/v1/client/orders .
Succesvolle reactie
Gegevens bevinden zich altijd in het data (object, array of null ). In gepagineerde lijsten wordt meta toegevoegd; Het is alleen beschikbaar als het nodig is. De statuscode 200 en wordt 201 voor verzoeken waarbij nieuwe records worden gemaakt.
200 Succesvolle reactie Kopiëren Gekopieerd {
"data" : {
"id" : 77 ,
"status" : "active"
},
"meta" : {
"total" : 1 ,
"page" : 1 ,
"limit" : 25 ,
"next_page" : 0
}
} Foutreactie
Voor fouten bevat de hoofdtekst één error : code voor machineleesbaarheid, message voor menselijke leesbaarheid en eventuele details voor aanvullende informatie. Bepaal altijd per code in uw integratie.
422 Foutreactie Kopiëren Gekopieerd {
"error" : {
"code" : "insufficient_balance" ,
"message" : "Bakiye yetersiz." ,
"details" : {
"required" : {
"amount" : 420 ,
"currency" : "TRY"
},
"available" : {
"amount" : 180.5 ,
"currency" : "TRY"
}
}
}
} Methode overschrijven en CORS
Clients die geen PATCH, PUT of DELETE kunnen verzenden, kunnen het verzoek als POST verzenden en X-Http-Method-Override: PATCH|PUT|DELETE header toevoegen. Access-Control-Allow-Origin: * voor API CORS: * retourneert en reageert op OPTIONS verzoeken met 204 ; Gebruik uw sleutel echter niet in de browser.
Foutcodes
De HTTP-statuscode geeft de klasse van de fout aan, en error.code geeft de exacte oorzaak aan. 401 , 403 en 429 fouten kunnen worden geretourneerd aan alle uiteinden waarvoor authenticatie vereist is.
Foutcodes
Kod HTTP Betekenis
bad_request400 Het verzoek kan niet worden geparseerd (bijvoorbeeld ongeldige JSON-tekst).
operation_failed400 De operatie kon niet worden voltooid; De reden staat in message berichtveld.
missing_token401 Er is geen Authorization of X-Api-Key header verzonden.
invalid_token401 De sleutel is ongeldig of wordt niet herkend.
key_revoked401 De sleutel is geannuleerd. Maak een nieuwe sleutel via het paneel.
owner_inactive401 Het account dat eigenaar is van de sleutel is inactief.
ip_not_allowed403 Het verzoek kwam van een adres dat niet in de IP-toestemmingslijst van de switch staat.
client_api_not_allowed403 Het account is geen actieve dealer; Geen API toegang.
insufficient_scope403 De sleutel is niet geautoriseerd voor deze handeling.
not_found404 Het gevraagde record is niet gevonden.
endpoint_not_found404 Zo’n extreem bestaat niet; controleer het pad en de versie.
method_not_allowed405 Het eindpunt ondersteunt deze HTTP-methode niet.
idempotency_in_flight409 Het verzoek verzonden met dezelfde Idempotency-Key wordt nog verwerkt; Probeer het na korte tijd opnieuw.
idempotency_key_reuse422 Dezelfde Idempotency-Key werd gebruikt met een ander lichaam.
validation_failed422 Een of meer velden zijn ongeldig; details zitten in details .
insufficient_balance422 Het Wallet-saldo is onvoldoende. details.required en details.available bedragen worden geretourneerd.
cycle_invalid422 Gedurende deze periode wordt het product niet verkocht. Geldige perioden staan in details.allowed .
product_not_orderable422 Het product is momenteel niet te bestellen.
out_of_stock422 Het product is niet op voorraad.
addon_invalid422 Plug-in is ongeldig voor dit product.
addon_option_invalid422 Plug-inoptie is ongeldig.
requirement_missing422 Er ontbreekt een verplichte bestelvereiste (requirements ).
terms_required422 Contractbevestiging (terms: true ) is niet verzonden.
payment_method_invalid422 Betaalmethode is ongeldig; Alleen balance wordt geaccepteerd.
invoice_not_payable422 De factuur is niet betaalbaar.
not_renewable422 Hizmet yenilenemiyor.
cancellation_exists422 Er is al een annuleringsverzoek voor deze dienst.
tool_action_failed422 Voertuigactie mislukt.
password_too_short422 Wachtwoord is te kort.
rate_limited429 Minuutverzoeklimiet overschreden; Wacht op Retry-After seconden.
too_many_auth_failures429 Te veel mislukte authenticatiepogingen; wacht even.
server_error500 Onverwachte serverfout. Probeer het opnieuw; Als het probleem zich blijft voordoen, neem dan contact op met de ondersteuning.
Idempotency
Voeg Idempotency-Key (8-191 tekens) toe aan POST-verzoeken, zodat u een verzoek veilig kunt herhalen in het geval van een netwerkstoring of time-out. Stuur altijd POST /orders en POST /invoices/ {id} /pay in.
Idempotentie gedrag
Status Conclusie
Dezelfde sleutel en hetzelfde lichaam, binnen 24 uur De procedure wordt niet herhaald; Het eerste antwoord wordt geretourneerd zoals het is, en Idempotency-Replayed: true wordt toegevoegd.
Dezelfde sleutel, ander lichaam 422 idempotency_key_reuse
Eerste aanvraag wordt nog verwerkt 409 idempotency_in_flight ; Probeer het na korte tijd opnieuw.
Genereer de sleutel één keer per transactie (bijvoorbeeld op basis van uw eigen bestelnummer of een UUID) en wijzig deze niet bij nieuwe pogingen.
Limiet aanvragen
Er geldt een limiet van 60 verzoeken per minuut voor elke API sleutel (vast venster van 60 seconden). Elk geverifieerd antwoord bevat headers die uw resterende rechten aangeven.
Limietheaders aanvragen
Titel Uitleg
X-RateLimit-LimitTotaal aantal verzoeken in het venster (60).
X-RateLimit-RemainingResterende aanvraag direct in het venster.
X-RateLimit-ResetHet tijdstip waarop het venster opnieuw wordt ingesteld (Unix-tijdstempel).
Retry-AfterAlleen bij 429 reacties: seconden wachten voordat u het opnieuw probeert.
429 Wanneer de limiet wordt overschreden Kopiëren Gekopieerd 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." }} Voer elke paar seconden een statuspeiling uit en wacht op Retry-After tijd waarop u 429 ontvangt. Herhaalde mislukte authenticatiepogingen worden tijdelijk geblokkeerd met too_many_auth_failures .
Factureringsperioden
Bij bestelartikelen en prijslijsten heeft cycle cyclusveld een van de volgende waarden. De periodes waarin een product wordt aangeboden, staan vermeld in pricing ; Als er een periode wordt ingediend die niet wordt aangeboden, wordt 422 cycle_invalid geretourneerd en komen er geldige waarden in details.allowed .
Factureringsperioden
Waarde Periode
hourlyGebruik per uur
monthlyMaandelijks
quarterly3 maanden oud
semiannually6 maanden oud
annuallyJaarlijks
biennially2 jaar
triennially3 jaar
onetimeÉén keer
Dealerprijzen
Dealerkorting wordt automatisch toegepast op alle bestellingen die u via API en paneel plaatst. Ontvang altijd de exacte nettoprijs met GET /reseller/prices of POST /orders/preview .
Particuliere dealer tot 30% korting
Bedrijfsdealer tot 35% korting
Korting geldt voor producten, add-ons en installatiekosten.
De kortingsprijs gaat nooit onder de kostenbasis van het product; Daarom is het werkelijke kortingspercentage op sommige producten lager. Het productgebaseerde tarief wordt weergegeven in het veld discount_pct .
Domeinnamen en gebruiksuren per uur zijn uitgesloten van de korting.
Er wordt geen coupon- of groepskorting toegepast bovenop de dealerkorting.
BTW wordt toegevoegd aan het kortingsbedrag.
API bestellingen worden alleen betaald vanaf het portemonneesaldo (payment.method = "balance" ).
U kunt tegen elke gewenste prijs aan uw eigen klanten verkopen.
Catalogusprijs (maandelijks) 500,00 ₺
Dealerkorting (30% op dit product) −150,00 ₺
BTW (20% op kortingsbedrag) +70,00 ₺
420,00 ₺ te betalen uit portemonnee
Het voorbeeld is voor een product waarvoor de volledige korting wordt toegepast; tarieven variëren per product en uw dealertype.
Eind tot eind
Voorbeeld van een volledige stroom
Gesprekken die nodig zijn om VDS voor een klant aan te schaffen, toegangsinformatie te leveren en na één maand te verlengen.
Lijst dealerprijzen
Selecteer het product en de periode; reseller is uw netto aankoopprijs.
cURL PHP Node.js Python
Kopiëren Gekopieerd 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())
Bekijk een voorbeeld van de bestelling
vergelijk het total met uw saldo (GET /balance ); Als dit niet genoeg is, laadt u eerst het saldo.
cURL PHP Node.js Python
Kopiëren Gekopieerd 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())
Plaats de bestelling met Idempotency-Key
Als het antwoord 201 is en payment.status: "paid" is het bedrag van uw portemonnee afgeschreven en is de installatie gestart. Als de verbinding verloren gaat, probeer het dan opnieuw met dezelfde sleutel en hetzelfde lichaam.
cURL PHP Node.js Python
Kopiëren Gekopieerd 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
Voer elke 15 seconden een query uit totdat services array in het GET /orders/ {id} -antwoord vol is en alle services active .
cURL PHP Node.js Python
Kopiëren Gekopieerd # 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])
Toegangsinformatie verkrijgen
Verzend het serveradres, de gebruikersnaam en het wachtwoord in access via een beveiligd kanaal naar uw client.
cURL PHP Node.js Python
Kopiëren Gekopieerd 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())
Verlengen en de rekening betalen
Maak een verlengingsfactuur aan (als er een openstaande factuur is, wordt deze geretourneerd) en betaal vervolgens de factuur vanuit de portemonnee met de geretourneerde invoice_id .
cURL PHP Node.js Python
Kopiëren Gekopieerd 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
Kopiëren Gekopieerd 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())
Extreme punten
Sistem
Controleer de verbinding en uw API sleutel.
Verbindingstest Geen authenticatie vereist # GET /ping
Controleert of API toegankelijk is. Vereist geen authenticatie; Geschikt voor monitoring (gezondheidscontrole).
Parametreler Deze tip heeft geen parameters.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"data" : {
"pong" : true ,
"version" : "v1" ,
"time" : "2026-12-05 14:30:00"
}
}Mogelijke fouten GET /whoami
Retourneert API sleutel en de eigenaar die het verzoek heeft gedaan. id is de ID van de sleutel, owner_id is de ID van het account. Gebruik het om te verifiëren dat de switch werkt bij het instellen van de integratie.
Parametreler Deze tip heeft geen parameters.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"data" : {
"id" : 12 ,
"type" : "client" ,
"name" : "Mağaza entegrasyonu" ,
"permissions" : [
"*"
],
"last_access" : "2026-12-05 14:28:11" ,
"owner_id" : 4821
}
}Mogelijke fouten
Extreme punten
Rekening & Saldo
Uw accountprofiel, portemonneesaldo en saldobewegingen.
GET /me
Retourneert het profiel en het huidige portemonneesaldo van het account dat eigenaar is van de sleutel. kind is individual of corporate ; Bedrijfsinformatie bevindt zich in het company .
Parametreler Deze tip heeft geen parameters.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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"
}
}Mogelijke fouten GET /balance
Retourneert het portemonneesaldo. API bestellingen worden uitsluitend vanaf dit saldo betaald; Controleer voordat u bestelt of u aan het totaalbedrag voldoet. wallet_empty en low_balance vlaggen kunnen worden gebruikt om waarschuwingen weer te geven.
Parametreler Deze tip heeft geen parameters.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"data" : {
"balance" : {
"amount" : 2450.75 ,
"currency" : "TRY"
},
"wallet_empty" : false ,
"low_balance" : false
}
}Mogelijke fouten GET /balance/transactions
Het geeft een overzicht van de saldo-uploads (up ) en de uitgaven (down ) op pagina's. created_at heeft de ISO 8601-indeling.
Parametreler Parametre Type Verplicht Uitleg type query string optioneel up (laden) of down (uitgaven).page query integer optioneel Paginanummer (≥ 1, standaard 1). limit query integer optioneel Records per pagina (1–100, standaard 25).
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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
}
}Mogelijke fouten
Extreme punten
Dealer
Uw dealerstatus en nettoaankoopprijzen die specifiek voor u zijn. Deze twee uiteinden zijn resellerextensies die aan de client- API zijn toegevoegd.
Resellerstatus Reseller-extensie # GET /reseller
Retourneert uw dealerstatus, type, kortingspercentage en saldovoortgang die vereist is voor activering. status : pending , active , suspended , rejected of none . rate is het hoogste kortingspercentage dat kan worden bereikt op basis van uw type; Gebruik GET /reseller/prices voor het werkelijke tarief per product.
Parametreler Deze tip heeft geen parameters.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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"
}
}Mogelijke fouten Dealerprijzen Reseller-extensie # GET /reseller/prices
Het retourneert de catalogusprijs (list ), uw specifieke netto aankoopprijs (reseller ) en het toegepaste kortingspercentage (discount_pct ) voor elk product en elke periode. De kostenbasis is de uiteindelijke toegepaste prijs; BTW is uitgesloten. Paging is hetzelfde als GET /products .
Voor het tweede product uit het voorbeeld blijft de korting 22%: de kortingsprijs gaat niet onder de kostenbasis.
Parametreler Parametre Type Verplicht Uitleg category query integer optioneel Filter op categorie-ID. search query string optioneel Zoek op productnaam. page query integer optioneel Paginanummer (≥ 1, standaard 1). limit query integer optioneel Records per pagina (1–100, standaard 25).
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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
}
}Mogelijke fouten
Extreme punten
Producten
Bestelbare producten, categorieën, add-ons en bestelvereisten. De prijzen hier zijn catalogusprijzen.
GET /products/categories
Retourneert productcategorieën. parent is de ID van de bovenliggende categorie; Het totale aantal records staat in meta.total .
Parametreler Deze tip heeft geen parameters.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"data" : [
{
"id" : 3 ,
"parent" : 0 ,
"type" : "server" ,
"name" : "VDS Sunucular"
},
{
"id" : 5 ,
"parent" : 0 ,
"type" : "server" ,
"name" : "Oyun Sunucuları"
}
],
"meta" : {
"total" : 2
}
}Mogelijke fouten GET /products
Retourneert producten met catalogusprijzen ; Dealerkorting is niet van toepassing. Voor de netto aankoopprijs gebruikt u GET /reseller/prices of POST /orders/preview . De valuta van de prijzen is in meta.currency .
Parametreler Parametre Type Verplicht Uitleg category query integer optioneel Filter op categorie-ID. search query string optioneel Zoek op productnaam. type query string optioneel Filter op producttype. page query integer optioneel Paginanummer (≥ 1, standaard 1). limit query integer optioneel Records per pagina (1–100, standaard 25).
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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"
}
}Mogelijke fouten GET /products/{id}
Retourneert een enkel product met lijstvelden plus beschrijving, quantity , bestellimiet per gebruiker, addons , requirements en domeinmodus (domain.mode : none , chooser , required …). Haal hier de ID's van het orderitem op.
Parametreler Parametre Type Verplicht Uitleg id path integer Verplicht Product-ID.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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"
}
}
}Mogelijke fouten
Extreme punten
Bestellingen
Bekijk een voorbeeld van de winkelwagen, maak een portemonnee-betaalde bestelling en volg de instellingen.
Bestelartikelobject
Elk element van items heeft deze structuur. Er kunnen maximaal 20 artikelen per aanvraag worden ingediend.
Bestelartikelobject Parametre Type Verplicht Uitleg product_idinteger Verplicht Product-ID. cyclestring Verplicht Factureringsperiode (bijvoorbeeld monthly ). quantityinteger optioneel Aantal, standaard 1 . domain.optionstring optioneel owned (uw eigen domein) of none .domain.namestring optioneel Domeinnaam. addonsobject optioneel Toewijzing van plug-in-ID naar optie-ID: {"<addon_id>": "<option_id>"} of ["<id>", …] in meervoudige selectie. requirementsobject optioneel Vereiste veld-ID voor waardetoewijzing: {"<field_id>": "değer"} .
POST /orders/preview
Het berekent het winkelmandje zonder enige registratie aan te maken: artikelbedragen, discount , BTW (tax ) en total te betalen totaal. Alle bedragen zijn geldobjecten. Bel voordat u bestelt en vergelijk total met uw saldo.
Parametreler Parametre Type Verplicht Uitleg items body array Verplicht Artikelen bestellen (maximaal 20). Zie het object Bestelitem hieronder voor de structuur. billing_profile_id body integer optioneel Factureringsprofiel-ID.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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"
}
}
}Mogelijke fouten Orde creëren Idempotentiesleutel aanbevolen # POST /orders
Het maakt de bestelling aan en haalt het bedrag uit uw portemonnee. Als het saldo niet aan het totaal voldoet 422 insufficient_balance geretourneerd zonder dat er records zijn gemaakt. Services worden automatisch geïnstalleerd wanneer de betaling is ontvangen. Het succesvolle antwoord wordt gecodeerd met 201 .
Dien voor elke bestelling een unieke Idempotency-Key in. In geval van een time-out of verbindingsfout, probeer het opnieuw met dezelfde sleutel en dezelfde body; Dubbele bestellingen komen niet voor. payment.status wordt paid of failed en in geval van een fout wordt payment.error toegevoegd.
Parametreler Parametre Type Verplicht Uitleg Idempotency-Key header string Aanbevolen Unieke sleutel van 8–191 tekens. Stuur bij de volgende poging dezelfde sleutel en dezelfde tekst. items body array Verplicht Artikelen bestellen (maximaal 20). payment.method body string Verplicht Her zaman balance. terms body boolean Verplicht true om de serviceovereenkomst te bevestigen.notes body string optioneel Bestelnotitie (bijvoorbeeld uw eigen klantreferentie).
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 201 Antwoord Kopiëren Gekopieerd {
"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"
}
}
}Mogelijke fouten GET /orders
Het vermeldt uw bestellingen op pagina's.
Parametreler Parametre Type Verplicht Uitleg status query string optioneel waiting , inprocess , active of cancelled .page query integer optioneel Paginanummer (≥ 1, standaard 1). limit query integer optioneel Records per pagina (1–100, standaard 25).
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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
}
}Mogelijke fouten GET /orders/{id}
Naast de lijstvelden worden items, services , factuuroverzicht en notities geretourneerd. Om de installatie te controleren, vraagt u dit met tussenpozen op totdat de services active zijn.
Parametreler Parametre Type Verplicht Uitleg id path integer Verplicht Bestel-ID.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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"
}
}Mogelijke fouten
Extreme punten
Diensten
Actieve services, toegangsinformatie, verlenging, annulering, tools en wachtwoordwijziging.
GET /services
Het vermeldt uw services op pagina's.
Parametreler Parametre Type Verplicht Uitleg status query string optioneel active , pending , suspended , expired of cancelled .search query string optioneel Zoek in de servicenaam of het serveradres. page query integer optioneel Paginanummer (≥ 1, standaard 1). limit query integer optioneel Records per pagina (1–100, standaard 25).
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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
}
}Mogelijke fouten GET /services/{id}
Naast de lijstvelden worden het product, de bestel-ID, access , renewal en eventuele cancellation geretourneerd. De prijzen renewal.cycles zijn bedragen waarop dealerkorting is toegepast.
Toegangsinformatie betreft vertrouwelijke gegevens: alleen verwerken op de server, niet naar logbestanden schrijven.
Parametreler Parametre Type Verplicht Uitleg id path integer Verplicht Service-ID.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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
}
}Mogelijke fouten Verlengingsfactuur maken # POST /services/{id}/renew
Creëert een verlengingsfactuur voor de service en retourneert 201 en existing: false . Als er al een openstaande verlengingsfactuur is, wordt deze geretourneerd met 200 en existing: true . Betaal de factuur met POST /invoices/ {id} /pay .
Parametreler Parametre Type Verplicht Uitleg id path integer Verplicht Service-ID.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 201 Antwoord Kopiëren Gekopieerd {
"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
}
}Mogelijke fouten Annuleringsverzoek maken # POST /services/{id}/cancellation
Creëert een annuleringsverzoek voor de service en retourneert 201 en het annuleringsobject.
Parametreler Parametre Type Verplicht Uitleg id path integer Verplicht Service-ID. urgency body string Verplicht now (onmiddellijk) of period-ending (aan het einde van de periode).reason body string Verplicht not-needed , too-expensive , switching , missing-features of other .reason_detail body string optioneel Waarom uitleg. note body string optioneel Ek not.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 201 Antwoord Kopiëren Gekopieerd {
"data" : {
"status" : "pending" ,
"urgency" : "period-ending" ,
"reason" : "not-needed" ,
"requested_at" : "2026-12-05"
}
}Mogelijke fouten Annuleringsverzoek ongedaan maken # DELETE /services/{id}/cancellation
Trekt het lopende annuleringsverzoek in. Clients die DELETE niet kunnen verzenden, kunnen POST en X-Http-Method-Override: DELETE header gebruiken.
Parametreler Parametre Type Verplicht Uitleg id path integer Verplicht Service-ID.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"data" : {
"revoked" : true ,
"service_id" : 77
}
}Mogelijke fouten GET /services/{id}/tools
Geeft een overzicht van de tools die beschikbaar zijn in de service. Als de module dit ondersteunt, worden elektrische gereedschappen geleverd met schakelaars start-server , stop-server en restart-server .
Parametreler Parametre Type Verplicht Uitleg id path integer Verplicht Service-ID.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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"
]
}
]
}Mogelijke fouten POST /services/{id}/tools/{tool}/{action}
Bestuurt een voertuig. Voorbeeld: POST /services/77/tools/restart-server/index om de server opnieuw op te starten.
Parametreler Parametre Type Verplicht Uitleg id path integer Verplicht Service-ID. tool path string Verplicht Toolsleutel (key in GET /services/ {id} /tools antwoord). action path string Verplicht Actienaam (index in elektrisch gereedschap).
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"data" : {
"status" : "successful" ,
"message" : "Sunucu yeniden başlatılıyor."
}
}Mogelijke fouten Servicewachtwoord wijzigen # POST /services/{id}/password
Wijzigt het toegangswachtwoord van de service.
Parametreler Parametre Type Verplicht Uitleg id path integer Verplicht Service-ID. password body string Verplicht Nieuw wachtwoord.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"data" : {
"changed" : true ,
"service_id" : 77
}
}Mogelijke fouten
Extreme punten
Faturalar
Maak een lijst van facturen, bekijk hun gegevens en betaal vanuit uw portemonnee.
Factuuroverzichtobject
Factuurlijsten, bestel- en verlengingsreacties gebruiken dit overzicht.
Factuuroverzichtobject Parametre Type Verplicht Uitleg invoice_idinteger Verplicht Factuur-ID. numberstring Verplicht Factuurnummer. statusstring Verplicht paid , unpaid , refund of cancelled .statestring Verplicht paid , unpaid , overdue , refunded of cancelled ; Achterstallige facturen worden overdue .totalmoney Verplicht Factuur totaal. created_atdate Verplicht Aanmaakdatum. paid_atdate|null Verplicht Betalingsdatum. due_datedate Verplicht Vervaldatum van betaling.
Maak een lijst van facturen # GET /invoices
Het vermeldt uw facturen op pagina's. Elke record bevat het factuuroverzicht, het eerste item (first_item ) en het resterende bedrag (amount_due ).
Parametreler Parametre Type Verplicht Uitleg status query string optioneel paid , unpaid , overdue , refunded of cancelled .page query integer optioneel Paginanummer (≥ 1, standaard 1). limit query integer optioneel Records per pagina (1–100, standaard 25).
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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
}
}Mogelijke fouten GET /invoices/{id}
Naast het factuuroverzicht retourneert het artikelen, summary (subtotaal, dealerkorting, BTW, totaal, betaald, resterend) en betalingstransacties.
Parametreler Parametre Type Verplicht Uitleg id path integer Verplicht Factuur-ID.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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" : []
}
}Mogelijke fouten Betaal de rekening Idempotentiesleutel aanbevolen # POST /invoices/{id}/pay
Betaalt de rekening met het portemonneesaldo. Als het saldo onvoldoende is, wordt er insufficient_balance geretourneerd (required en available in de details). Als de factuur niet betaalbaar is, wordt invoice_not_payable geretourneerd.
Parametreler Parametre Type Verplicht Uitleg Idempotency-Key header string Aanbevolen Unieke sleutel van 8–191 tekens. Stuur bij de volgende poging dezelfde sleutel en dezelfde tekst. id path integer Verplicht Factuur-ID. payment.method body string Verplicht Her zaman balance.
Monster aanvraag cURL PHP Node.js Python
Kopiëren Gekopieerd 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())Voorbeeld antwoord 200 Antwoord Kopiëren Gekopieerd {
"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"
}
}
}Mogelijke fouten
Hulp nodig?
Open een supportaanvraag voor integratiegerelateerde vragen. Door het tijdstip van het verzoek, het eindpunt en de geretourneerde error.code toe te voegen, wordt de oplossing versneld. Schrijf nooit uw sleutel op het verzoek.
Open een ondersteuningsverzoek