### Предварительный заказ Преобразуйте свой заказ в запрос на покупку, затем отправьте __order_id__,__total_price__ в [v2/cart/purchaser](/apidocs/cart/purchase).

Список всех доступных методов для взаимодействия с 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();
}

Примеры ответов