API partnerskie
API do integracji proxy mobilnych: zamawianie i przedłużanie portów, zarządzanie dostępem i rozliczenia.
Wartości w przykładach są poglądowe. Aktualne ceny, ID i dane połączenia są zwracane w odpowiedziach API.
Autoryzacja
API jest dostępne po aktywacji konta partnerskiego. Tworzenie i unieważnianie tokenu jest dostępne wyłącznie w panelu GIGABIT. Nowy token zastępuje poprzedni i jest wyświetlany tylko raz.
Token należy przekazywać w nagłówku żądania HTTP Authorization zgodnie ze schematem Bearer.
Authorization: Bearer gbp_PARTNER_TOKENFormat zapytań i odpowiedzi
Treść zapytania jest przekazywana w formacie JSON. Przykłady zapytań i odpowiedzi znajdują się przy każdym endpointzie.
| Element | Format i znaczenie |
|---|---|
| Treść zapytania | Obiekt JSON i Content-Type: application/json. Gdy nie ma parametrów, treść może zostać pominięta. |
| HTTP 202 | Operacja została przyjęta. Serwer zwraca id i status_url do sprawdzania statusu. |
| GET /operations/{id} | queued: w kolejce; processing: w toku; ready: zakończona; failed: błąd. Wynik znajduje się w result, przyczyna błędu w error. |
| Daty | ISO 8601 ze strefą czasową, np. 2026-12-09T22:59:59+00:00. |
| Kwoty | Pola _cents: całkowite eurocenty. 4500 = 45,00 EUR. |
| Limity | Treść do 16 KiB; 600 zapytań na godzinę na konto. Przy HTTP 429 czas oczekiwania wskazuje Retry-After. |
Odpowiedź poprawna
{
"success": true,
"data": {
"currency": "EUR",
"balance_cents": 10000
}
}Odpowiedź z błędem
{
"success": false,
"error": "unauthenticated"
}Saldo i płatności
Zamówienie i przedłużenie przez API obejmuje jeden port na 30 dni. Koszt z indywidualnym rabatem jest pobierany z salda netto. Dostępna kwota z uwzględnieniem limitu kredytowego i rezerwacji jest podana w available_cents.
VAT jest ustalany na podstawie danych rozliczeniowych profilu i doliczany przy doładowaniu przez Stripe. Przy zakupie portów nie jest naliczany ponownie.
Błędy
| HTTP | error | Opis |
|---|---|---|
| 400 | invalid_rotation_token_request | Reset tokenu nie przyjmuje dodatkowych parametrów. |
| 400 | invalid_json | Nieprawidłowy JSON w treści zapytania. |
| 400 | invalid_payment_request | Nieobsługiwane lub nieprawidłowe parametry zapytania. |
| 400 | invalid_payment_orders | Nieprawidłowy numer lub ID portu. |
| 400 | invalid_partner_amount | Kwota nie spełnia ograniczeń. |
| 400 | invalid_pagination | Nieprawidłowe parametry paginacji. |
| 400 | invalid_partner_prefix | Prefiks loginów nie spełnia ograniczeń. |
| 400 | invalid_rotation_interval | Nieprawidłowe pola rotation lub rotation_seconds. |
| 401 | unauthenticated | Brak tokenu, token jest nieprawidłowy lub unieważniony. |
| 403 | partner_required | Wymagane jest aktywne konto partnerskie. |
| 403 | payment_method_unavailable | Metoda płatności jest niedostępna dla tego konta. |
| 403 | origin_not_allowed | Źródło żądania jest niedozwolone. |
| 404 | not_found | Obiekt nie istnieje lub jest niedostępny dla tego konta. |
| 409 | insufficient_partner_balance | Niewystarczające środki po uwzględnieniu limitu kredytowego i rezerwacji. |
| 409 | insufficient_withdrawable_balance | Niewystarczające środki dostępne do zwrotu. |
| 409 | inventory_changed | Dostępność portów zmieniła się od odczytu katalogu. |
| 409 | partner_prefix_taken | Prefiks jest już zajęty. |
| 409 | record_changed_or_in_use | Wpis został zmieniony lub jest używany przez inną operację. |
| 409 | payment_busy | Powiązana operacja jest w toku. |
| 409 | rotation_busy | Zmiana IP jest w toku. |
| 409 | billing_required | Brak wymaganych danych rozliczeniowych w profilu. |
| 409 | rotation_interval_too_short | Interwał jest krótszy niż 20 sekund lub limit serwera portu. |
| 403 / 409 | order_expired | Wynajem jest nieaktywny. Zmiana danych dostępu i IP jest dostępna po przedłużeniu. |
| 429 | too_many_requests | Limit zapytań został przekroczony. Czas oczekiwania wskazuje Retry-After. |
| 502 | proxy_server_unavailable | Serwer proxy jest tymczasowo niedostępny. |
| 502 | rotation_sync_pending | Zastosowanie ustawienia zmiany IP nie zostało jeszcze potwierdzone. |
| 503 | database_unavailable | Baza danych jest tymczasowo niedostępna. |
| 503 | stripe_unavailable | Usługa płatnicza jest tymczasowo niedostępna. |
Status operacji
Zwraca status i wynik operacji konta. Szybkie sprawdzenie bez ponownego wykonania.
Parametry
| Pole | Typ | Opis |
|---|---|---|
idW ścieżce · Wymagane | string | ID operacji z odpowiedzi HTTP 202. |
Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"id": "partner_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"order_ids": [
"a1b2c3d4e5f60123456789abcdef0123"
],
"amount_cents": 4050,
"currency": "EUR",
"price": {
"currency": "EUR",
"base_net_cents": 4500,
"net_cents": 4050,
"vat_cents": 0,
"total_cents": 4050,
"tax_at_topup": true,
"discount_percent": 10,
"months": 1,
"days": 30,
"pricing_version": 1,
"tax": {
"mode": "vat",
"rate_percent": 23,
"vat_code": "23",
"reverse_charge": false
}
}
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "failed",
"error": "insufficient_partner_balance",
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Saldo
Bieżące saldo, limit kredytowy, dostępne środki, rabat i ceny partnera.
Treść nie jest wymagana.
Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/balance' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/balance",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/balance",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"currency": "EUR",
"balance_cents": 10000,
"reserved_cents": 0,
"credit_limit_cents": 10000,
"debt_cents": 0,
"available_cents": 20000,
"withdrawable_cents": 10000,
"discount_percent": 10,
"prefix": "astra",
"api_token_hint": "demo12",
"monthly_net_cents": 4500,
"payment_method": "card",
"connection_domains": {
"host": "",
"api": ""
},
"paid_in_cents": 10000,
"prices": [
{
"currency": "EUR",
"base_net_cents": 4500,
"net_cents": 4050,
"vat_cents": 0,
"total_cents": 4050,
"tax_at_topup": true,
"discount_percent": 10,
"months": 1,
"days": 30,
"pricing_version": 1,
"tax": {
"mode": "vat",
"rate_percent": 23,
"vat_code": "23",
"reverse_charge": false
}
}
],
"topup_tax": {
"mode": "vat",
"rate_percent": 23,
"vat_code": "23",
"reverse_charge": false
},
"can_order_new_ports": true
}
}Doładowanie salda
Tworzy link do płatności przez Stripe. amount_cents to kwota zasilenia salda w eurocentach; total_cents to kwota do zapłaty z uwzględnieniem należnego VAT.
Parametry
| Pole | Typ | Opis |
|---|---|---|
amount_centsTreść JSON · Wymagane | integer100-10000000 | Od 1 do 100 000 EUR w całkowitych eurocentach. |
Przykład zapytania
curl --request POST \
--url 'https://api.gigabit.ltd/api/partner/v1/topups' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"amount_cents": 10000
}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/topups",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount_cents": 10000
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.post(
"https://api.gigabit.ltd/api/partner/v1/topups",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={'amount_cents': 10000},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Wynik po zakończeniu
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"id": "ptop_0123456789abcdef0123456789abcdef",
"state": "pending",
"url": "https://checkout.stripe.com/c/pay/EXAMPLE_SESSION",
"amount_cents": 10000,
"vat_cents": 2300,
"total_cents": 12300,
"currency": "EUR"
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Status doładowania
Zwraca status doładowania konta. paid potwierdza zaksięgowanie środków. Sam powrót ze strony Stripe nie potwierdza płatności.
Statusy: creating, pending, paid, expired, failed.
Parametry
| Pole | Typ | Opis |
|---|---|---|
idW ścieżce · Wymagane | string | ID doładowania z POST /topups. |
Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/topups/ptop_0123456789abcdef0123456789abcdef' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/topups/ptop_0123456789abcdef0123456789abcdef",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/topups/ptop_0123456789abcdef0123456789abcdef",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "ptop_0123456789abcdef0123456789abcdef",
"state": "pending",
"url": "https://checkout.stripe.com/c/pay/EXAMPLE_SESSION",
"amount_cents": 10000,
"vat_cents": 2300,
"total_cents": 12300,
"currency": "EUR"
}
}Historia transakcji
Operacje od najnowszych do najstarszych, źródła, komentarze, kwoty i saldo po każdej operacji. Techniczne rezerwacje zakupu są domyślnie ukryte.
Parametry
| Pole | Typ | Opis |
|---|---|---|
offsetW zapytaniu · Opcjonalne | integer0-∞ | Liczba pomijanych wpisów. |
limitW zapytaniu · Opcjonalne | integer1-100 | Rozmiar strony: 1-100. |
include_reservationsW zapytaniu · Opcjonalne | string1 | 1 uwzględnia purchase_reserve i purchase_release. |
Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/transactions?offset=0&limit=30' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/transactions?offset=0&limit=30",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/transactions?offset=0&limit=30",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"items": [
{
"id": "ptop_0123456789abcdef0123456789abcdef:credit",
"created_at": "2026-11-09T12:05:00+00:00",
"currency": "EUR",
"operation": "topup",
"amount_cents": 10000,
"reserved_delta_cents": 0,
"source": "stripe",
"comment": "",
"reference": "ptop_0123456789abcdef0123456789abcdef",
"balance_after_cents": 10000,
"reserved_after_cents": 0,
"sequence": 1
}
],
"total": 1,
"offset": 0,
"limit": 30
}
}Wniosek o zwrot środków
Tworzy wniosek i rezerwuje kwotę do jego rozpatrzenia. Kwota dostępna do wypłaty jest podana w withdrawable_cents; nie obejmuje limitu kredytowego ani bezzwrotnych rekompensat.
Po przetworzeniu wniosku result.state=requested oznacza oczekiwanie na decyzję. Operacja pozostaje processing do potwierdzenia wypłaty lub odrzucenia.
Parametry
| Pole | Typ | Opis |
|---|---|---|
amount_centsTreść JSON · Wymagane | integer100-100000000 | Kwota EUR w centach, nie większa niż dostępna do wypłaty. |
commentTreść JSON · Wymagane | string1-2000 | Dane do wypłaty lub wyjaśnienie. Niepusty tekst po usunięciu skrajnych spacji. |
Przykład zapytania
curl --request POST \
--url 'https://api.gigabit.ltd/api/partner/v1/withdrawals' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"amount_cents": 5000,
"comment": "Please contact me to confirm payment details."
}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/withdrawals",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount_cents": 5000,
"comment": "Please contact me to confirm payment details."
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.post(
"https://api.gigabit.ltd/api/partner/v1/withdrawals",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={'amount_cents': 5000,
'comment': 'Please contact me to confirm payment details.'},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Wynik po zakończeniu
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"id": "pout_0123456789abcdef0123456789abcdef",
"state": "paid"
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Dostępne porty
Dostępne numery portów pogrupowane według operatora i lokalizacji.
Dostępność jest sprawdzana podczas składania zamówienia. Wyświetlenie katalogu nie rezerwuje portów.
Treść nie jest wymagana.
Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/catalog' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/catalog",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/catalog",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"items": [
{
"operator": {
"id": "operator-orange",
"name": "Orange"
},
"location": {
"id": "location-warsaw",
"name": "Warsaw"
},
"ports": [
{
"id": "b1c2d3e4f5a60123456789abcdef0123",
"number": 10001
},
{
"id": "b2c3d4e5f6a70123456789abcdef0123",
"number": 10002
}
],
"available": 2
}
],
"prices": [
{
"currency": "EUR",
"base_net_cents": 4500,
"net_cents": 4050,
"vat_cents": 0,
"total_cents": 4050,
"tax_at_topup": true,
"discount_percent": 10,
"months": 1,
"days": 30,
"pricing_version": 1,
"tax": {
"mode": "vat",
"rate_percent": 23,
"vat_code": "23",
"reverse_charge": false
}
}
]
}
}Zamówienie portu
Zamówienie jednego dostępnego portu na 30 dni według numeru lub ID z katalogu. Koszt jest pobierany z salda.
Dłuższa operacja zwraca HTTP 202 i id utworzony przez serwer. Status i wynik są dostępne przez GET /operations/{id}. Sprawdzenie statusu nie tworzy nowej operacji.
Parametry
| Pole | Typ | Opis |
|---|---|---|
port_numberTreść JSON · Opcjonalne | integer1-65535 | Numer portu z katalogu. Wymagane jest jedno z pól: port_number lub port_id. |
port_idTreść JSON · Opcjonalne | string1-120 | ID portu z katalogu, zamiast port_number. |
Przykład zapytania
curl --request POST \
--url 'https://api.gigabit.ltd/api/partner/v1/orders' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"port_number": 10001
}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"port_number": 10001
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.post(
"https://api.gigabit.ltd/api/partner/v1/orders",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={'port_number': 10001},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Wynik po zakończeniu
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"id": "partner_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"order_ids": [
"a1b2c3d4e5f60123456789abcdef0123"
],
"amount_cents": 4050,
"currency": "EUR",
"price": {
"currency": "EUR",
"base_net_cents": 4500,
"net_cents": 4050,
"vat_cents": 0,
"total_cents": 4050,
"tax_at_topup": true,
"discount_percent": 10,
"months": 1,
"days": 30,
"pricing_version": 1,
"tax": {
"mode": "vat",
"rate_percent": 23,
"vat_code": "23",
"reverse_charge": false
}
}
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Przykład zapytania
curl --request POST \
--url 'https://api.gigabit.ltd/api/partner/v1/orders' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"port_id": "b1c2d3e4f5a60123456789abcdef0123"
}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"port_id": "b1c2d3e4f5a60123456789abcdef0123"
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.post(
"https://api.gigabit.ltd/api/partner/v1/orders",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={'port_id': 'b1c2d3e4f5a60123456789abcdef0123'},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Wynik po zakończeniu
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"id": "partner_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"order_ids": [
"a1b2c3d4e5f60123456789abcdef0123"
],
"amount_cents": 4050,
"currency": "EUR",
"price": {
"currency": "EUR",
"base_net_cents": 4500,
"net_cents": 4050,
"vat_cents": 0,
"total_cents": 4050,
"tax_at_topup": true,
"discount_percent": 10,
"months": 1,
"days": 30,
"pricing_version": 1,
"tax": {
"mode": "vat",
"rate_percent": 23,
"vat_code": "23",
"reverse_charge": false
}
}
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Lista portów
Bieżące porty konta: termin wynajmu, dane połączenia, IP i timer zmiany IP.
Zmiana IP odbywa się przez zapytanie GET pod pełny adres rotation_url z danych portu. Nagłówek Authorization nie jest wymagany. Link zawiera już token portu.
Treść nie jest wymagana.
Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/orders' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/orders",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"items": [
{
"id": "a1b2c3d4e5f60123456789abcdef0123",
"port_id": "b1c2d3e4f5a60123456789abcdef0123",
"number": 10001,
"host": "l1.gigabit.ltd",
"username": "astra_a1b2c3d4e5f",
"proxy_password": "EXAMPLE_ONLY_22_CHARS_x",
"status": "active",
"expires": "2026-12-09T22:59:59+00:00",
"operator": "Orange",
"cityName": "Warsaw",
"ip": "198.51.100.42",
"rotation_url": "https://api.gigabit.ltd/change_ip?token=EXAMPLE_ROTATION_TOKEN_REPLACE_ME",
"rotation": true,
"rotation_seconds": 120,
"connection_options": {
"custom": {
"host": "proxy.example.com",
"rotation_url": "https://api.example.com/change_ip?token=EXAMPLE_ROTATION_TOKEN_REPLACE_ME"
}
}
}
]
}
}Dane portu
Dane zamówienia przypisanego do konta. Niedostępne lub nieistniejące zamówienie zwraca 404.
Zmiana IP odbywa się przez zapytanie GET pod pełny adres rotation_url z danych portu. Nagłówek Authorization nie jest wymagany. Link zawiera już token portu.
Parametry
| Pole | Typ | Opis |
|---|---|---|
idW ścieżce · Wymagane | string | ID zamówienia (id) lub portu (port_id) z listy portów. |
Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "a1b2c3d4e5f60123456789abcdef0123",
"port_id": "b1c2d3e4f5a60123456789abcdef0123",
"number": 10001,
"host": "l1.gigabit.ltd",
"username": "astra_a1b2c3d4e5f",
"proxy_password": "EXAMPLE_ONLY_22_CHARS_x",
"status": "active",
"expires": "2026-12-09T22:59:59+00:00",
"operator": "Orange",
"cityName": "Warsaw",
"ip": "198.51.100.42",
"rotation_url": "https://api.gigabit.ltd/change_ip?token=EXAMPLE_ROTATION_TOKEN_REPLACE_ME",
"rotation": true,
"rotation_seconds": 120,
"connection_options": {
"custom": {
"host": "proxy.example.com",
"rotation_url": "https://api.example.com/change_ip?token=EXAMPLE_ROTATION_TOKEN_REPLACE_ME"
}
}
}
}Przedłużenie portu
Przedłuża wynajem jednego portu o 30 dni z płatnością z salda. Wymagany jest tylko numer lub ID portu w adresie.
Dłuższa operacja zwraca HTTP 202 i id utworzony przez serwer. Status i wynik są dostępne przez GET /operations/{id}. Sprawdzenie statusu nie tworzy nowej operacji.
Parametry
| Pole | Typ | Opis |
|---|---|---|
idW ścieżce · Wymagane | string | Numer lub ID portu. Akceptowany jest też id zamówienia z GET /orders. |
Przykład zapytania
curl --request POST \
--url 'https://api.gigabit.ltd/api/partner/v1/orders/10001/renew' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders/10001/renew",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.post(
"https://api.gigabit.ltd/api/partner/v1/orders/10001/renew",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Wynik po zakończeniu
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"id": "partner_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"order_ids": [
"a1b2c3d4e5f60123456789abcdef0123"
],
"amount_cents": 4050,
"currency": "EUR",
"price": {
"currency": "EUR",
"base_net_cents": 4500,
"net_cents": 4050,
"vat_cents": 0,
"total_cents": 4050,
"tax_at_topup": true,
"discount_percent": 10,
"months": 1,
"days": 30,
"pricing_version": 1,
"tax": {
"mode": "vat",
"rate_percent": 23,
"vat_code": "23",
"reverse_charge": false
}
}
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Przykład zapytania
curl --request POST \
--url 'https://api.gigabit.ltd/api/partner/v1/orders/b1c2d3e4f5a60123456789abcdef0123/renew' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders/b1c2d3e4f5a60123456789abcdef0123/renew",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.post(
"https://api.gigabit.ltd/api/partner/v1/orders/b1c2d3e4f5a60123456789abcdef0123/renew",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Wynik po zakończeniu
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"id": "partner_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"order_ids": [
"a1b2c3d4e5f60123456789abcdef0123"
],
"amount_cents": 4050,
"currency": "EUR",
"price": {
"currency": "EUR",
"base_net_cents": 4500,
"net_cents": 4050,
"vat_cents": 0,
"total_cents": 4050,
"tax_at_topup": true,
"discount_percent": 10,
"months": 1,
"days": 30,
"pricing_version": 1,
"tax": {
"mode": "vat",
"rate_percent": 23,
"vat_code": "23",
"reverse_charge": false
}
}
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Reset tokenu zmiany IP
Tworzy nowy token zmiany IP i zwraca gotowy link. Poprzedni token i wszystkie linki z nim natychmiast przestają działać. Hasło proxy i timer pozostają bez zmian.
Odpowiedź jest zwracana od razu, bez operacji w tle. Nowy link jest również dostępny w polu rotation_url danych portu.
Parametry
| Pole | Typ | Opis |
|---|---|---|
idW ścieżce · Wymagane | string | ID zamówienia z pola id na liście portów. |
Przykład zapytania
curl --request POST \
--url 'https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation-token' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation-token",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.post(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation-token",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"rotation_token": "0123456789abcdef0123456789abcdef",
"rotation_url": "https://api.gigabit.ltd/change_ip?token=0123456789abcdef0123456789abcdef"
}
}Zmiana danych dostępu według ID
Serwer generuje nowe hasło. Przy change_login=true generuje też nowy login z bieżącym prefiksem partnera. Dostępne wyłącznie dla aktywnego wynajmu.
Nowe dane są dostępne w result po zastosowaniu. Błąd operation_superseded oznacza, że nowsze polecenie zmieniło dane dostępu.
Parametry
| Pole | Typ | Opis |
|---|---|---|
idW ścieżce · Wymagane | string | ID zamówienia (id) lub portu (port_id) z listy portów. |
change_loginTreść JSON · Opcjonalne | boolean | true - nowy login z bieżącym prefiksem i nowe hasło. false - tylko hasło. Starszy wspólny dostęp otrzymuje osobne dane także bez tej flagi. |
Przykład zapytania
curl --request POST \
--url 'https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/password' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"change_login": true
}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/password",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"change_login": true
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.post(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/password",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={'change_login': True},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Wynik po zakończeniu
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"state": "synced",
"username": "astra_b2c3d4e5f6a",
"password": "EXAMPLE_NEW_PASSWORD_xx"
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Przykład zapytania
curl --request POST \
--url 'https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/password' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"change_login": false
}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/password",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"change_login": false
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.post(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/password",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={'change_login': False},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Wynik po zakończeniu
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"state": "synced",
"username": "astra_a1b2c3d4e5f",
"password": "EXAMPLE_NEW_PASSWORD_xx"
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Timer zmiany IP
Bieżący stan timera. Przy rotation=true zwracane jest rotation_seconds. Gdy timer jest wyłączony, zwracane jest tylko rotation=false.
Parametry
| Pole | Typ | Opis |
|---|---|---|
idW ścieżce · Wymagane | string | ID zamówienia (id) lub portu (port_id) z listy portów. |
Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"rotation": true,
"rotation_seconds": 120
}
}Przykład zapytania
curl --request GET \
--url 'https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN"const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`
}
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.get(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"rotation": false
}
}Ustawienia timera
Włączenie wymaga rotation=true oraz rotation_seconds, liczby całkowitej od 20 do 86400 sekund. Wartość poniżej 20 zwraca błąd rotation_interval_too_short. Wyłączenie wymaga tylko rotation=false.
Operacja pozostaje processing do potwierdzenia zastosowania timera.
Parametry
| Pole | Typ | Opis |
|---|---|---|
idW ścieżce · Wymagane | string | ID zamówienia (id) lub portu (port_id) z listy portów. |
rotationTreść JSON · Wymagane | boolean | true włącza timer; false wyłącza. |
rotation_secondsTreść JSON · Opcjonalne | integer20-86400 | Wymagane przy rotation=true. Przy rotation=false pole należy pominąć. |
Przykład zapytania
curl --request PUT \
--url 'https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"rotation": true,
"rotation_seconds": 120
}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation",
{
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"rotation": true,
"rotation_seconds": 120
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.put(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={'rotation': True, 'rotation_seconds': 120},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Wynik po zakończeniu
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"rotation": true,
"rotation_seconds": 120
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Przykład zapytania
curl --request PUT \
--url 'https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"rotation": false
}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation",
{
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"rotation": false
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.put(
"https://api.gigabit.ltd/api/partner/v1/orders/a1b2c3d4e5f60123456789abcdef0123/rotation",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={'rotation': False},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "queued",
"error": null,
"result": null,
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Wynik po zakończeniu
{
"success": true,
"data": {
"id": "op_0123456789abcdef0123456789abcdef",
"state": "ready",
"error": null,
"result": {
"rotation": false
},
"created_at": "2026-11-10T12:00:00+00:00",
"status_url": "/api/partner/v1/operations/op_0123456789abcdef0123456789abcdef"
}
}Prefiks loginów
Prefiks to początek loginów portów, np. nazwa marki. Loginy są generowane w formacie prefix_random: przy prefix=astra nowy port otrzyma login taki jak astra_a1b2c3d4e5f. Losowa część jest tworzona osobno dla każdego portu.
Zmiana prefiksu nie zmienia już wydanych loginów. Nowe porty oraz zmiana loginu przez change_login=true używają bieżącego prefiksu. Prefiks musi być unikalny; zajęty zwraca 409 partner_prefix_taken.
Parametry
| Pole | Typ | Opis |
|---|---|---|
prefixTreść JSON · Wymagane | string2-24 | 2-24 znaki: litery łacińskie, cyfry i myślnik; pierwszy znak to litera. Normalizowany do małych liter. proxy i gigabit są zastrzeżone. |
Przykład zapytania
curl --request PUT \
--url 'https://api.gigabit.ltd/api/partner/v1/profile' \
--header "Authorization: Bearer $GIGABIT_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"prefix": "astra"
}'const response = await fetch(
"https://api.gigabit.ltd/api/partner/v1/profile",
{
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.GIGABIT_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"prefix": "astra"
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error);
console.log(result);# python -m pip install requests
import os
import requests
response = requests.put(
"https://api.gigabit.ltd/api/partner/v1/profile",
headers={"Authorization": f"Bearer {os.environ['GIGABIT_API_TOKEN']}"},
json={'prefix': 'astra'},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(result.get("error", f"HTTP {response.status_code}"))
print(result)Przykład odpowiedzi
{
"success": true,
"data": {
"prefix": "astra"
}
}Środki i statusy
Pola obiektu data. Odpowiedź może być rozszerzana o nowe pola bez zmiany wersji API.
| Pole | Typ | Opis |
|---|---|---|
balance_cents | integer | Bieżące saldo netto; może być ujemne. |
credit_limit_cents | integer | Uzgodniona maksymalna kwota debetu. |
reserved_cents | integer | Środki zarezerwowane na niezakończone operacje, nadal wliczone w saldo. |
available_cents | integer | Dostępne na zamówienia: saldo + limit − rezerwacje, minimum 0. |
withdrawable_cents | integer | Środki konta dostępne do zwrotu po uwzględnieniu rezerwacji. |
debt_cents / paid_in_cents | integer | Odpowiednio zadłużenie i suma wszystkich potwierdzonych wpłat. |
currency / monthly_net_cents / discount_percent | string / integer | EUR; cena bazowa 30 dni przed rabatem; rabat partnera w procentach. |
prices[] / topup_tax | array / object | Cena na 30 dni i zasady podatkowe doładowania. Przy niepełnych danych prices jest puste, pricing_error=billing_required. |
can_order_new_ports | boolean | Czy dostępna kwota wystarcza na jeden port na 30 dni. Nie gwarantuje dostępności. |
payment_method | string | Metoda doładowania: card (Stripe). |
prefix / api_token_hint / connection_domains | string / object | Prefiks nowych loginów, końcówka tokenu (nie sam token) i skonfigurowane domeny host/api. Pusty ciąg oznacza brak konfiguracji domeny. |
Cena portu
Pola obiektu data. Odpowiedź może być rozszerzana o nowe pola bez zmiany wersji API.
| Pole | Typ | Opis |
|---|---|---|
currency / base_net_cents | string / integer | EUR i bazowa cena netto wybranego okresu przed rabatem. |
net_cents / total_cents | integer | Cena netto jednego portu za okres po rabacie; obciążenie salda. |
vat_cents / tax_at_topup | integer / boolean | Przy zakupie vat_cents=0, tax_at_topup=true: VAT uwzględnia się przy doładowaniu. |
months / days / discount_percent / pricing_version | integer | Okres 1 miesiąca (30 dni), indywidualny rabat i wersja ceny. |
tax | object | mode, rate_percent, vat_code, reverse_charge. Profil podatkowy doładowania, nie dodatkowe obciążenie za port. |
Operacja zakupu / przedłużenia
Pola obiektu data. Odpowiedź może być rozszerzana o nowe pola bez zmiany wersji API.
| Pole | Typ | Opis |
|---|---|---|
id / state / error | string / null | ID operacji, status i kod błędu (null przy braku błędu). |
order_ids[] | string[] | ID utworzonych lub przedłużonych zamówień dla GET /orders/{id}. |
amount_cents / currency / price | integer / string / object | Kwota obciążenia netto, waluta EUR i cena portu zapisana dla operacji. |
Port i dane dostępu
Pola obiektu data. Odpowiedź może być rozszerzana o nowe pola bez zmiany wersji API.
| Pole | Typ | Opis |
|---|---|---|
id / port_id / number | string / integer | ID zamówienia, ID portu z katalogu i numer portu. |
host / username / proxy_password | string | Host, login i hasło do połączenia z proxy. |
status / expires | string | active lub due; data zakończenia wynajmu w ISO 8601. |
operator / cityName / ip | string | Operator, miasto i bieżący wyjściowy IP. ip może być pusty, gdy sprawdzenie jest niedostępne. |
rotation_url | string | Zmiana IP odbywa się przez zapytanie GET pod pełny adres rotation_url z danych portu. Nagłówek Authorization nie jest wymagany. Link zawiera już token portu. |
rotation / rotation_seconds | boolean / integer | Czy timer jest włączony; interwał w sekundach jest zwracany tylko przy rotation=true. |
connection_options | object | Dodatkowe adresy połączenia, jeśli skonfigurowane: ip i custom, każdy z host i rotation_url. |
Timer zmiany IP
Pola obiektu data. Odpowiedź może być rozszerzana o nowe pola bez zmiany wersji API.
| Pole | Typ | Opis |
|---|---|---|
rotation | boolean | true oznacza włączony timer; false wyłączony. |
rotation_seconds | integer | Interwał w sekundach, od 20 do 86400. Zwracany tylko przy rotation=true. |
Doładowanie salda
Pola obiektu data. Odpowiedź może być rozszerzana o nowe pola bez zmiany wersji API.
| Pole | Typ | Opis |
|---|---|---|
id / state / url | string / null | Stripe: ID, status, link Checkout. url może być null podczas tworzenia płatności. |
amount_cents / vat_cents / total_cents / currency | integer / string | Stripe: kwota na saldo, VAT, suma do zapłaty i EUR. |
Transakcja
Pola obiektu data. Odpowiedź może być rozszerzana o nowe pola bez zmiany wersji API.
| Pole | Typ | Opis |
|---|---|---|
items[] / total / offset / limit | array / integer | Wpisy, łączna liczba z uwzględnieniem filtra rezerwacji, przesunięcie i rozmiar strony. |
id / created_at / sequence / currency | string / integer | ID wpisu, data, numer sekwencyjny i EUR. |
operation / source | string | Operacja: topup, purchase, renewal, correction, compensation, credit_limit, withdrawal_reserve, withdrawal_paid, withdrawal_rejected; techniczne purchase_reserve/purchase_release na żądanie. Źródła: stripe, admin, api, customer, system. |
amount_cents / reserved_delta_cents | integer | Zmiana salda i rezerwacji. Obciążenie jest ujemne. Rezerwacja może mieć amount_cents=0; nie jest wpłatą. |
balance_after_cents / reserved_after_cents | integer | Saldo i rezerwacja po tym wpisie. |
comment / reference | string / null | Komentarz tekstowy i powiązana płatność lub operacja. Komentarz może być pusty. |
Operacja w tle
Pola obiektu data. Odpowiedź może być rozszerzana o nowe pola bez zmiany wersji API.
| Pole | Typ | Opis |
|---|---|---|
id / status_url | string | ID operacji utworzony przez serwer i adres sprawdzania statusu. |
state | string | queued, processing, ready lub failed. |
result | object / null | Wynik operacji: dane dostępu, zamówienie lub link do płatności zależnie od metody. |
error / created_at | string / null | Kod błędu w razie niepowodzenia i czas utworzenia operacji. |