Замовлення

Список всіх публично доступних методів для взаємодії з API.

POST

Кошик замовлення -/cart/order

Метод запита

POSThttp://apilocal.stableproxy.com/v2/cart/order

Параметри запиту

ІдентифікаторПравилаПриклад
traffic-unitНе обов'язковоnullablestringin:gb"gb"
period-unitНе обов'язковоnullablestringin:weeks, weeks, months, years"weeks"
traffic-amountrequiredintegerin:25, 100, 400, 800, 5000"25"
period-amountrequiredintegerin"1"
countНе обов'язковоnullableinteger30
countriesНе обов'язковоnullablearray{"UA": 10, "PL": 20}
typerequiredstringin:shared, private, mobile_rotating_gb, residential_gb, datacenter_gb, residential_city_gb, residential_static_gb, mobile_gb, mobile_static, mobile_static_gb"shared"
currencyНе обов'язковоnullablestringcurrency_code"USD"
has-unlimited-auth-ipsНе обов'язковоnullableex-booleanfalse
serviceНе обов'язковоnullablestringilluminate\_validation\_rules\_in97
ip-scoreНе обов'язковоnullablenumeric29

Приклади коду

async function postCartOrder() {
   const baseUrl = 'http://apilocal.stableproxy.com/v2';
   const req = await fetch(baseUrl + '/cart/order', {
         method: 'POST',
         headers: {
            'Content-Type': 'application/json'
         },
         body: JSON.stringify({
            "traffic-unit": "gb",
            "period-unit": "weeks",
            "traffic-amount": "25",
            "period-amount": "1",
            "count": 30,
            "countries": {"UA": 10, "PL": 20},
            "type": "shared",
            "currency": "USD",
            "has-unlimited-auth-ips": false,
            "service": 97,
            "ip-score": 29
         }),
      }
   );
   
   const res = await req.json();
}

Приклади відповідей