Iniziare
Avvio rapido
Effettua il tuo primo ordine tramite API in quattro passaggi.
Richiedi la concessionaria
Compila il modulo di richiesta (individuo o azienda). Quando il saldo del tuo portafoglio raggiunge 2.000 ₺ (saldo attuale o ricariche totali dopo la richiesta), la tua concessionaria verrà attivata automaticamente . L'attivazione è una tantum; Le spese successive non ridurranno la tua concessionaria.
Genera chiave API
Genera una nuova chiave dal pannello del rivenditore . La chiave inizia con wck_ e viene mostrata una sola volta ; Conservatelo immediatamente in un luogo sicuro. Puoi creare fino a 20 chiavi per account, limitando ciascuna chiave a indirizzi IP specifici.
Invia la tua prima richiesta
GET /me restituisce il tuo account e il tuo saldo. Se ricevi una risposta 200 , la tua chiave funziona.
cURL PHP Node.js Python
Copia Copiato 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())
Effettua il tuo primo ordine
Per prima cosa vedi l'importo netto con POST /orders/preview , quindi invia POST /orders con gli stessi articoli. Utilizzare sempre una Idempotency-Key univoca nell'ordine.
cURL PHP Node.js Python
Copia Copiato 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
Copia Copiato 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
Autenticazione
Aggiungi la tua chiave API a ciascuna richiesta come token Bearer nell'intestazione Authorization . I client che non possono impostare l'intestazione possono utilizzare l'intestazione X-Api-Key . Solo GET /ping non richiede l'autenticazione.
Richiedi intestazioni Copia Copiato Authorization: Bearer wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# alternatif
X-Api-Key: wck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Formato chiave: wck_ +32 caratteri (0-9A-Za-z ). La chiave viene visualizzata una sola volta al momento della creazione; Solo il digest (SHA-256) viene archiviato nel sistema, quindi la chiave persa non può essere recuperata.
Le chiavi vengono create e cancellate dal pannello del dealer. È possibile definire un massimo di 20 chiavi per account.
È possibile definire un elenco IP consentito opzionale (indirizzi IP completi) per ciascuno switch. Le richieste provenienti da indirizzi non presenti nell'elenco ricevono 403 ip_not_allowed .
API funziona solo su account rivenditore attivi ; altri account ottengono 403 client_api_not_allowed .
Non inserire la chiave nel codice lato client come un browser, un'app mobile o un repository pubblico. Invia sempre richieste dal tuo server; Se la chiave perde, cancellatela immediatamente dal pannello e createne una nuova.
Struttura di richiesta e risposta
API riceve e restituisce JSON con codifica UTF-8. Utilizza Content-Type: application/json nelle richieste in cui invii corpi. Tutti i percorsi sono relativi all'URL di base: https://vatanhosting.com/api/v1/client/orders .
Risposta riuscita
I dati sono sempre nel campo data (oggetto, array o null ). Negli elenchi paginati viene aggiunto meta ; È disponibile solo quando necessario. Il codice di stato 200 e diventa 201 per le richieste che creano nuovi record.
200 Risposta riuscita Copia Copiato {
"data" : {
"id" : 77 ,
"status" : "active"
},
"meta" : {
"total" : 1 ,
"page" : 1 ,
"limit" : 25 ,
"next_page" : 0
}
} Risposta all'errore
Per gli errori, il corpo contiene un singolo oggetto error : code per la leggibilità della macchina, message per la leggibilità umana e details per informazioni aggiuntive, se presenti. Decidi sempre in base al campo code nella tua integrazione.
422 Risposta all'errore Copia Copiato {
"error" : {
"code" : "insufficient_balance" ,
"message" : "Bakiye yetersiz." ,
"details" : {
"required" : {
"amount" : 420 ,
"currency" : "TRY"
},
"available" : {
"amount" : 180.5 ,
"currency" : "TRY"
}
}
}
} Metodo override e CORS
I client che non possono inviare PATCH, PUT o DELETE possono inviare la richiesta come POST e aggiungere X-Http-Method-Override: PATCH|PUT|DELETE . Access-Control-Allow-Origin: * per API CORS: * restituisce e risponde alle richieste OPTIONS con 204 ; Tuttavia, non utilizzare la chiave nel browser.
Codici di errore
Il codice di stato HTTP indica la classe dell'errore e error.code indica la causa esatta. Gli errori 401 , 403 e 429 possono essere restituiti su tutte le estremità che richiedono l'autenticazione.
Codici di errore
Kod HTTP Senso
bad_request400 Non è stato possibile analizzare la richiesta (ad esempio corpo JSON non valido).
operation_failed400 Impossibile completare l'operazione; Il motivo è nel campo message .
missing_token401 Non è stata inviata alcuna Authorization o intestazione X-Api-Key .
invalid_token401 La chiave non è valida o non è riconosciuta.
key_revoked401 La chiave è stata cancellata. Crea una nuova chiave dal pannello.
owner_inactive401 L'account che possiede la chiave è inattivo.
ip_not_allowed403 La richiesta proviene da un indirizzo che non è presente nell'elenco delle autorizzazioni IP dello switch.
client_api_not_allowed403 L'account non è un dealer attivo; Nessun accesso API.
insufficient_scope403 La chiave non è autorizzata per questa operazione.
not_found404 Il record richiesto non è stato trovato.
endpoint_not_found404 Non esiste un tale estremo; controlla il percorso e la versione.
method_not_allowed405 L'endpoint non supporta questo metodo HTTP.
idempotency_in_flight409 La richiesta inviata con la stessa Idempotency-Key è ancora in fase di elaborazione; Riprovare dopo poco.
idempotency_key_reuse422 La stessa Idempotency-Key è stata utilizzata con un corpo diverso.
validation_failed422 Uno o più campi non sono validi; i dettagli sono nei details .
insufficient_balance422 Il saldo del portafoglio è insufficiente. Vengono restituiti gli importi details.required e details.available .
cycle_invalid422 Il prodotto non viene venduto durante questo periodo. I periodi validi sono indicati nei details.allowed .
product_not_orderable422 Il prodotto non è attualmente disponibile per l'ordine.
out_of_stock422 Il prodotto è esaurito.
addon_invalid422 Il plugin non è valido per questo prodotto.
addon_option_invalid422 L'opzione del plugin non è valida.
requirement_missing422 Manca un requisito obbligatorio dell'ordine (requirements ).
terms_required422 La conferma del contratto (terms: true ) non è stata inviata.
payment_method_invalid422 Il metodo di pagamento non è valido; Si accetta solo balance .
invoice_not_payable422 La fattura non è pagabile.
not_renewable422 Hizmet yenilenemiyor.
cancellation_exists422 Esiste già una richiesta di cancellazione per questo servizio.
tool_action_failed422 L'azione del veicolo non è riuscita.
password_too_short422 La password è troppo corta.
rate_limited429 Limite di richieste in minuti superato; Attendi Retry-After secondi.
too_many_auth_failures429 Troppi tentativi di autenticazione falliti; aspetta un po'.
server_error500 Errore imprevisto del server. Riprova; Se persiste, contatta l'assistenza.
Idempotency
Aggiungi Idempotency-Key (8–191 caratteri) alle richieste POST in modo da poter ripetere in sicurezza una richiesta in caso di errore di rete o timeout. Invia sempre POST /orders e POST /invoices/ {id} /pay .
Comportamento di idempotenza
Stato Conclusione
Stessa chiave e stessa carrozzeria, entro 24 ore La procedura non viene ripetuta; La prima risposta viene restituita così com'è e viene aggiunta Idempotency-Replayed: true .
Stessa chiave, corpo diverso 422 idempotency_key_reuse
Prima richiesta ancora in elaborazione 409 idempotency_in_flight ; Riprovare dopo poco.
Genera la chiave una volta per transazione (ad esempio dal tuo numero d'ordine o da un UUID) e non modificarla ai nuovi tentativi.
Limite di richiesta
Esiste un limite di 60 richieste al minuto per ciascuna chiave API (finestra fissa di 60 secondi). Ogni risposta autenticata contiene intestazioni che indicano i tuoi diritti rimanenti.
Richiedi intestazioni limite
Titolo Spiegazione
X-RateLimit-LimitNumero totale di richieste nella finestra (60).
X-RateLimit-RemainingRichiesta rimanente direttamente nella finestra.
X-RateLimit-ResetL'ora in cui la finestra verrà ripristinata (timestamp Unix).
Retry-AfterSolo sulle risposte 429 : secondi di attesa prima di riprovare.
429 Quando il limite viene superato Copia Copiato 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." }} Effettua sondaggi sullo stato ogni pochi secondi e attendi Retry-After quando ricevi 429 . Ripetuti tentativi di autenticazione falliti vengono temporaneamente bloccati con too_many_auth_failures .
Periodi di fatturazione
Negli articoli dell'ordine e nei listini prezzi, cycle assume uno dei seguenti valori. I periodi in cui viene offerto un prodotto sono elencati nella matrice pricing ; Se viene inviato un periodo non offerto, viene restituito 422 cycle_invalid e i valori validi vengono forniti in details.allowed .
Periodi di fatturazione
Valore Periodo
hourlyUtilizzo orario
monthlyMensile
quarterly3 mesi
semiannually6 mesi
annuallyAnnuale
biennially2 anni
triennially3 anni
onetimeUna volta
Prezzi del rivenditore
Lo sconto del rivenditore viene applicato automaticamente a tutti gli ordini effettuati tramite API e pannello. Ottieni sempre il prezzo netto esatto con GET /reseller/prices o POST /orders/preview .
Rivenditore privato fino al 30% di sconto
Rivenditore aziendale fino al 35% di sconto
Lo sconto si applica a prodotti, componenti aggiuntivi e costi di installazione.
Il prezzo scontato non scende mai al di sotto della base di costo del prodotto; Pertanto, il tasso di sconto effettivo è inferiore su alcuni prodotti. La tariffa basata sul prodotto viene visualizzata nel campo discount_pct .
Dallo sconto sono esclusi i nomi di dominio e le tariffe orarie di utilizzo.
Nessun coupon o sconto di gruppo viene applicato oltre allo sconto del rivenditore.
All'importo scontato va aggiunta l'IVA.
Gli ordini API vengono pagati solo dal saldo del portafoglio (payment.method = "balance" ).
Puoi vendere ai tuoi clienti a qualsiasi prezzo tu voglia.
Prezzo di listino (mensile) 500,00 ₺
Sconto rivenditore (30% su questo prodotto) −150,00 ₺
IVA (20% sull'importo scontato) +70,00 ₺
420,00 ₺ da pagare dal portafoglio
L'esempio riguarda un prodotto per il quale viene applicato lo sconto totale; le tariffe variano in base al prodotto e al tipo di rivenditore.
Dall'inizio alla fine
Esempio di flusso completo
Chiamate necessarie per acquistare VDS per un cliente, fornire informazioni di accesso e rinnovare dopo un mese.
Elenca i prezzi dei rivenditori
Seleziona il prodotto e il periodo; reseller corrisponde al prezzo di acquisto netto.
cURL PHP Node.js Python
Copia Copiato 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())
Anteprima dell'ordine
confrontare total con il saldo (GET /balance ); Se non è sufficiente caricare prima la bilancia.
cURL PHP Node.js Python
Copia Copiato 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())
Effettua l'ordine con Idempotency-Key
Se la risposta è 201 e payment.status: "paid" l'importo è stato detratto dal tuo portafoglio e l'installazione è iniziata. Se la connessione viene persa, riprovare con la stessa chiave e lo stesso corpo.
cURL PHP Node.js Python
Copia Copiato 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
Esegui una query ogni 15 secondi fino a quando services nella risposta GET /orders/ {id} è piena e tutti i servizi active .
cURL PHP Node.js Python
Copia Copiato # 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])
Ottieni informazioni di accesso
Trasmetti l'indirizzo del server, il nome utente e la password access al tuo client attraverso un canale sicuro.
cURL PHP Node.js Python
Copia Copiato 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())
Rinnova e paga la bolletta
Crea una fattura di rinnovo (se c'è una fattura aperta, verrà restituita), quindi paga la fattura dal portafoglio con la invoice_id restituita.
cURL PHP Node.js Python
Copia Copiato 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
Copia Copiato 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())
Punti estremi
Sistem
Verifica la connessione e la tua chiave API.
Prova di connessione Nessuna autenticazione richiesta # GET /ping
Verifica che API sia accessibile. Non richiede autenticazione; Adatto per il monitoraggio (controllo sanitario).
Parametreler Questo suggerimento non accetta parametri.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"data" : {
"pong" : true ,
"version" : "v1" ,
"time" : "2026-12-05 14:30:00"
}
}Possibili errori GET /whoami
Restituisce API e il proprietario che ha effettuato la richiesta. id è l'ID della chiave, owner_id è l'ID dell'account. Utilizzalo per verificare che lo switch funzioni durante la configurazione dell'integrazione.
Parametreler Questo suggerimento non accetta parametri.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"data" : {
"id" : 12 ,
"type" : "client" ,
"name" : "Mağaza entegrasyonu" ,
"permissions" : [
"*"
],
"last_access" : "2026-12-05 14:28:11" ,
"owner_id" : 4821
}
}Possibili errori
Punti estremi
Conto e saldo
Profilo del tuo account, saldo del portafoglio e movimenti del saldo.
GET /me
Restituisce il profilo e il saldo attuale del portafoglio dell'account che possiede la chiave. il valore kind è individual o corporate ; Le informazioni sull'azienda si trovano nell'oggetto company .
Parametreler Questo suggerimento non accetta parametri.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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"
}
}Possibili errori GET /balance
Restituisce il saldo del portafoglio. Gli ordini API vengono pagati solo da questo saldo; Si prega di verificare di soddisfare il totale prima di ordinare. I flag wallet_empty e low_balance possono essere utilizzati per mostrare avvisi.
Parametreler Questo suggerimento non accetta parametri.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"data" : {
"balance" : {
"amount" : 2450.75 ,
"currency" : "TRY"
},
"wallet_empty" : false ,
"low_balance" : false
}
}Possibili errori Transazioni del portafoglio # GET /balance/transactions
Elenca i caricamenti del saldo (up ) e le spese (down ) nelle pagine. created_at è nel formato ISO 8601.
Parametreler Parametre Tipo Obbligatorio Spiegazione type query string opzionale up (caricare) o down (spendere).page query integer opzionale Numero di pagina (≥ 1, predefinito 1). limit query integer opzionale Record per pagina (1–100, predefinito 25).
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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
}
}Possibili errori
Punti estremi
Rivenditore
Lo stato della tua concessionaria e i prezzi di acquisto netti specifici per te. Queste due estremità sono estensioni del rivenditore aggiunte API client.
Stato del rivenditore Estensione rivenditore # GET /reseller
Restituisce lo stato, il tipo, il tasso di sconto e l'avanzamento del saldo della concessionaria richiesti per l'attivazione. status : pending , active , suspended , rejected o none . rate è il tasso di sconto più alto ottenibile in base alla tua tipologia; Per la tariffa effettiva per prodotto, utilizzare GET /reseller/prices .
Parametreler Questo suggerimento non accetta parametri.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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"
}
}Possibili errori Prezzi del rivenditore Estensione rivenditore # GET /reseller/prices
Restituisce il prezzo di listino (list ), il prezzo di acquisto netto specifico (reseller ) e il tasso di sconto applicato (discount_pct ) per ciascun prodotto e periodo. La base di costo è il prezzo finale applicato; L'IVA è esclusa. Il paging è uguale a GET /products .
Per il secondo prodotto dell'esempio lo sconto rimane al 22%: il prezzo scontato non scende al di sotto della base di costo.
Parametreler Parametre Tipo Obbligatorio Spiegazione category query integer opzionale Filtra per ID categoria. search query string opzionale Cerca nel nome del prodotto. page query integer opzionale Numero di pagina (≥ 1, predefinito 1). limit query integer opzionale Record per pagina (1–100, predefinito 25).
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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
}
}Possibili errori
Punti estremi
Prodotti
Prodotti ordinabili, categorie, componenti aggiuntivi e requisiti di ordinazione. I prezzi qui sono prezzi di listino.
GET /products/categories
Restituisce le categorie di prodotti. parent è l'ID della categoria genitore; Il numero totale di record è in meta.total .
Parametreler Questo suggerimento non accetta parametri.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"data" : [
{
"id" : 3 ,
"parent" : 0 ,
"type" : "server" ,
"name" : "VDS Sunucular"
},
{
"id" : 5 ,
"parent" : 0 ,
"type" : "server" ,
"name" : "Oyun Sunucuları"
}
],
"meta" : {
"total" : 2
}
}Possibili errori GET /products
Restituisce prodotti con prezzi di listino ; Lo sconto del rivenditore non si applica. Per il prezzo di acquisto netto, utilizza GET /reseller/prices o POST /orders/preview . La valuta dei prezzi è in meta.currency .
Parametreler Parametre Tipo Obbligatorio Spiegazione category query integer opzionale Filtra per ID categoria. search query string opzionale Cerca nel nome del prodotto. type query string opzionale Filtra per tipologia di prodotto. page query integer opzionale Numero di pagina (≥ 1, predefinito 1). limit query integer opzionale Record per pagina (1–100, predefinito 25).
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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"
}
}Possibili errori GET /products/{id}
Restituisce un singolo prodotto con campi elenco più descrizione, regole quantity , limite di ordine per utente, addons , requirements di ordine e modalità di dominio (domain.mode : none , chooser , required ...). Ottieni gli ID dell'articolo dell'ordine qui.
Parametreler Parametre Tipo Obbligatorio Spiegazione id path integer Obbligatorio ID prodotto.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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"
}
}
}Possibili errori
Punti estremi
Ordini
Visualizza l'anteprima del carrello, crea un ordine pagato con il portafoglio e segui la configurazione.
Oggetto articolo dell'ordine
Ogni elemento dell'array items ha questa struttura. In una richiesta è possibile inviare un massimo di 20 articoli.
Oggetto articolo dell'ordine Parametre Tipo Obbligatorio Spiegazione product_idinteger Obbligatorio ID prodotto. cyclestring Obbligatorio Periodo di fatturazione (ad esempio monthly ). quantityinteger opzionale Quantità, predefinita 1 . domain.optionstring opzionale owned (il tuo dominio) o none .domain.namestring opzionale Nome di dominio. addonsobject opzionale Mappatura dall'ID plugin all'ID opzione: {"<addon_id>": "<option_id>"} o ["<id>", …] nella selezione multipla. requirementsobject opzionale ID campo requisito per mappatura valore: {"<field_id>": "değer"} .
POST /orders/preview
Calcola il carrello senza creare alcun record: importi degli articoli, discount del rivenditore, IVA (tax ) e total da pagare. Tutti gli importi sono oggetti di denaro. Chiama prima di ordinare e confronta total con il tuo saldo.
Parametreler Parametre Tipo Obbligatorio Spiegazione items body array Obbligatorio Ordina articoli (fino a 20). Vedere l'oggetto Articolo ordine di seguito per la struttura. billing_profile_id body integer opzionale ID del profilo di fatturazione.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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"
}
}
}Possibili errori Crea ordine Consigliata la chiave di idepotenza # POST /orders
Crea l'ordine e preleva l'importo dal tuo portafoglio. Se il saldo non raggiunge il totale 422 insufficient_balance senza che venga creato alcun record. I servizi vengono installati automaticamente al ricevimento del pagamento. La risposta positiva è codificata 201 .
Invia una Idempotency-Key univoca per ciascun ordine. In caso di timeout o errore di connessione riprovare con la stessa chiave e lo stesso body; Non si verificano ordini doppi. payment.status diventa paid o failed e, in caso di errore, viene aggiunto payment.error .
Parametreler Parametre Tipo Obbligatorio Spiegazione Idempotency-Key header string Raccomandato Chiave univoca di 8-191 caratteri. Invia la stessa chiave e lo stesso corpo al prossimo tentativo. items body array Obbligatorio Ordina articoli (fino a 20). payment.method body string Obbligatorio Her zaman balance. terms body boolean Obbligatorio true per confermare il contratto di servizio.notes body string opzionale Nota dell'ordine (ad esempio il proprio riferimento cliente).
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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"
}
}
}Possibili errori GET /orders
Elenca i tuoi ordini in pagine.
Parametreler Parametre Tipo Obbligatorio Spiegazione status query string opzionale waiting , inprocess , active o cancelled .page query integer opzionale Numero di pagina (≥ 1, predefinito 1). limit query integer opzionale Record per pagina (1–100, predefinito 25).
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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
}
}Possibili errori GET /orders/{id}
Oltre ai campi elenco, restituisce articoli, services , riepilogo fatture e note. Per monitorare l'installazione, interrogare periodicamente questa estremità finché i servizi non saranno active .
Parametreler Parametre Tipo Obbligatorio Spiegazione id path integer Obbligatorio ID dell'ordine.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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"
}
}Possibili errori
Punti estremi
Servizi
Servizi attivi, informazioni di accesso, rinnovo, cancellazione, strumenti e cambio password.
GET /services
Elenca i tuoi servizi in pagine.
Parametreler Parametre Tipo Obbligatorio Spiegazione status query string opzionale active , pending , suspended , expired o cancelled .search query string opzionale Cerca nel nome del servizio o nell'indirizzo del server. page query integer opzionale Numero di pagina (≥ 1, predefinito 1). limit query integer opzionale Record per pagina (1–100, predefinito 25).
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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
}
}Possibili errori GET /services/{id}
Oltre ai campi dell'elenco, restituisce il prodotto, l'ID dell'ordine, le informazioni access , le opzioni renewal e la richiesta cancellation , se presente. I prezzi renewal.cycles sono importi con sconto rivenditore applicato.
Le informazioni di accesso sono dati riservati: elaborati solo sul lato server, non scrivere nei file di registro.
Parametreler Parametre Tipo Obbligatorio Spiegazione id path integer Obbligatorio Identificativo del servizio.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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
}
}Possibili errori POST /services/{id}/renew
Crea una fattura di rinnovo per il servizio e restituisce 201 ed existing: false . Se è già presente una fattura di rinnovo aperta, la restituisce con 200 ed existing: true . Paga la fattura con POST /invoices/ {id} /pay .
Parametreler Parametre Tipo Obbligatorio Spiegazione id path integer Obbligatorio Identificativo del servizio.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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
}
}Possibili errori Crea richiesta di cancellazione # POST /services/{id}/cancellation
Crea una richiesta di annullamento per il servizio e restituisce 201 e l'oggetto di annullamento.
Parametreler Parametre Tipo Obbligatorio Spiegazione id path integer Obbligatorio Identificativo del servizio. urgency body string Obbligatorio now (immediatamente) o period-ending (alla fine del periodo).reason body string Obbligatorio not-needed , too-expensive , switching , missing-features o other .reason_detail body string opzionale Perché spiegazione. note body string opzionale Ek not.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"data" : {
"status" : "pending" ,
"urgency" : "period-ending" ,
"reason" : "not-needed" ,
"requested_at" : "2026-12-05"
}
}Possibili errori Annulla la richiesta di annullamento # DELETE /services/{id}/cancellation
Ritira la richiesta di cancellazione pendente. I client che non possono inviare DELETE possono utilizzare POST e X-Http-Method-Override: DELETE .
Parametreler Parametre Tipo Obbligatorio Spiegazione id path integer Obbligatorio Identificativo del servizio.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"data" : {
"revoked" : true ,
"service_id" : 77
}
}Possibili errori GET /services/{id}/tools
Elenca gli strumenti disponibili nel servizio. Se il modulo lo supporta, gli elettroutensili sono dotati di interruttori start-server , stop-server e restart-server .
Parametreler Parametre Tipo Obbligatorio Spiegazione id path integer Obbligatorio Identificativo del servizio.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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"
]
}
]
}Possibili errori POST /services/{id}/tools/{tool}/{action}
Guida un veicolo. Esempio: POST /services/77/tools/restart-server/index per riavviare il server.
Parametreler Parametre Tipo Obbligatorio Spiegazione id path integer Obbligatorio Identificativo del servizio. tool path string Obbligatorio Chiave strumento (key nella risposta GET /services/ {id} /tools ). action path string Obbligatorio Nome dell'azione (index negli utensili elettrici).
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"data" : {
"status" : "successful" ,
"message" : "Sunucu yeniden başlatılıyor."
}
}Possibili errori Cambia password di servizio # POST /services/{id}/password
Modifica la password di accesso al servizio.
Parametreler Parametre Tipo Obbligatorio Spiegazione id path integer Obbligatorio Identificativo del servizio. password body string Obbligatorio Nuova parola d'ordine.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"data" : {
"changed" : true ,
"service_id" : 77
}
}Possibili errori
Punti estremi
Faturalar
Elenca le fatture, visualizza i loro dettagli e paga dal portafoglio.
Oggetto riepilogo fatture
Gli elenchi delle fatture, le risposte agli ordini e ai rinnovi utilizzano questo riepilogo.
Oggetto riepilogo fatture Parametre Tipo Obbligatorio Spiegazione invoice_idinteger Obbligatorio ID fattura. numberstring Obbligatorio Numero della fattura. statusstring Obbligatorio paid , unpaid , refund o cancelled .statestring Obbligatorio paid , unpaid , overdue , refunded o cancelled ; Le fatture scadute diventano overdue .totalmoney Obbligatorio Totale fattura. created_atdate Obbligatorio Data di creazione. paid_atdate|null Obbligatorio Data di pagamento. due_datedate Obbligatorio Data di scadenza del pagamento.
GET /invoices
Elenca le tue fatture in pagine. Ogni record contiene il riepilogo della fattura, il primo articolo (first_item ) e la scadenza rimanente (amount_due ).
Parametreler Parametre Tipo Obbligatorio Spiegazione status query string opzionale paid , unpaid , overdue , refunded o cancelled .page query integer opzionale Numero di pagina (≥ 1, predefinito 1). limit query integer opzionale Record per pagina (1–100, predefinito 25).
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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
}
}Possibili errori GET /invoices/{id}
Oltre al riepilogo fattura, restituisce gli articoli, il summary degli importi (subtotale, sconto rivenditore, IVA, totale, pagato, rimanente) e le transazioni di pagamento.
Parametreler Parametre Tipo Obbligatorio Spiegazione id path integer Obbligatorio ID fattura.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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" : []
}
}Possibili errori Pagare il conto Consigliata la chiave di idepotenza # POST /invoices/{id}/pay
Paga la fattura dal saldo del portafoglio. Se il saldo è insufficiente viene restituito insufficient_balance (required e available nei dettagli), se la fattura non è pagabile viene restituito invoice_not_payable .
Parametreler Parametre Tipo Obbligatorio Spiegazione Idempotency-Key header string Raccomandato Chiave univoca di 8-191 caratteri. Invia la stessa chiave e lo stesso corpo al prossimo tentativo. id path integer Obbligatorio ID fattura. payment.method body string Obbligatorio Her zaman balance.
Richiesta campione cURL PHP Node.js Python
Copia Copiato 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())Risposta di esempio {
"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"
}
}
}Possibili errori