Get Tariffs Endpoint
curl --request POST \
--url https://api.example.com/miniapp/subscription/tariffs \
--header 'Content-Type: application/json' \
--data '
{
"initData": "<string>"
}
'import requests
url = "https://api.example.com/miniapp/subscription/tariffs"
payload = { "initData": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({initData: '<string>'})
};
fetch('https://api.example.com/miniapp/subscription/tariffs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/miniapp/subscription/tariffs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'initData' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/miniapp/subscription/tariffs"
payload := strings.NewReader("{\n \"initData\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/miniapp/subscription/tariffs")
.header("Content-Type", "application/json")
.body("{\n \"initData\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/miniapp/subscription/tariffs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"initData\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"sales_mode": "tariffs",
"tariffs": [
{
"id": 123,
"name": "<string>",
"traffic_limit_gb": 123,
"traffic_limit_label": "<string>",
"device_limit": 123,
"servers_count": 123,
"description": "<string>",
"tier_level": 1,
"is_unlimited_traffic": false,
"servers": [
{
"uuid": "<string>",
"name": "<string>"
}
],
"periods": [
{
"days": 123,
"label": "<string>",
"price_kopeks": 123,
"price_label": "<string>",
"months": 123,
"price_per_month_kopeks": 123,
"price_per_month_label": "<string>",
"original_price_kopeks": 123,
"original_price_label": "<string>",
"discount_percent": 0
}
],
"is_current": false,
"is_available": true,
"switch_cost_kopeks": 123,
"switch_cost_label": "<string>",
"is_upgrade": true,
"is_switch_free": true,
"is_daily": false,
"daily_price_kopeks": 0,
"daily_price_label": "<string>"
}
],
"current_tariff": {
"id": 123,
"name": "<string>",
"traffic_limit_gb": 123,
"traffic_limit_label": "<string>",
"device_limit": 123,
"servers_count": 123,
"description": "<string>",
"tier_level": 1,
"is_unlimited_traffic": false,
"monthly_price_kopeks": 0,
"traffic_topup_enabled": false,
"traffic_topup_packages": [
{
"gb": 123,
"price_kopeks": 123,
"price_label": "<string>",
"original_price_kopeks": 123,
"original_price_label": "<string>",
"discount_percent": 0
}
],
"max_topup_traffic_gb": 0,
"available_topup_gb": 123,
"is_daily": false,
"daily_price_kopeks": 0,
"daily_price_label": "<string>"
},
"balance_kopeks": 0,
"balance_label": "<string>",
"promo_group": {
"id": 123,
"name": "<string>",
"server_discount_percent": 0,
"traffic_discount_percent": 0,
"device_discount_percent": 0,
"period_discounts": {},
"apply_discounts_to_addons": true
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}miniapp
Get Tariffs Endpoint
Возвращает список доступных тарифов для пользователя.
POST
/
miniapp
/
subscription
/
tariffs
Get Tariffs Endpoint
curl --request POST \
--url https://api.example.com/miniapp/subscription/tariffs \
--header 'Content-Type: application/json' \
--data '
{
"initData": "<string>"
}
'import requests
url = "https://api.example.com/miniapp/subscription/tariffs"
payload = { "initData": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({initData: '<string>'})
};
fetch('https://api.example.com/miniapp/subscription/tariffs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/miniapp/subscription/tariffs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'initData' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/miniapp/subscription/tariffs"
payload := strings.NewReader("{\n \"initData\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/miniapp/subscription/tariffs")
.header("Content-Type", "application/json")
.body("{\n \"initData\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/miniapp/subscription/tariffs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"initData\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"sales_mode": "tariffs",
"tariffs": [
{
"id": 123,
"name": "<string>",
"traffic_limit_gb": 123,
"traffic_limit_label": "<string>",
"device_limit": 123,
"servers_count": 123,
"description": "<string>",
"tier_level": 1,
"is_unlimited_traffic": false,
"servers": [
{
"uuid": "<string>",
"name": "<string>"
}
],
"periods": [
{
"days": 123,
"label": "<string>",
"price_kopeks": 123,
"price_label": "<string>",
"months": 123,
"price_per_month_kopeks": 123,
"price_per_month_label": "<string>",
"original_price_kopeks": 123,
"original_price_label": "<string>",
"discount_percent": 0
}
],
"is_current": false,
"is_available": true,
"switch_cost_kopeks": 123,
"switch_cost_label": "<string>",
"is_upgrade": true,
"is_switch_free": true,
"is_daily": false,
"daily_price_kopeks": 0,
"daily_price_label": "<string>"
}
],
"current_tariff": {
"id": 123,
"name": "<string>",
"traffic_limit_gb": 123,
"traffic_limit_label": "<string>",
"device_limit": 123,
"servers_count": 123,
"description": "<string>",
"tier_level": 1,
"is_unlimited_traffic": false,
"monthly_price_kopeks": 0,
"traffic_topup_enabled": false,
"traffic_topup_packages": [
{
"gb": 123,
"price_kopeks": 123,
"price_label": "<string>",
"original_price_kopeks": 123,
"original_price_label": "<string>",
"discount_percent": 0
}
],
"max_topup_traffic_gb": 0,
"available_topup_gb": 123,
"is_daily": false,
"daily_price_kopeks": 0,
"daily_price_label": "<string>"
},
"balance_kopeks": 0,
"balance_label": "<string>",
"promo_group": {
"id": 123,
"name": "<string>",
"server_discount_percent": 0,
"traffic_discount_percent": 0,
"device_discount_percent": 0,
"period_discounts": {},
"apply_discounts_to_addons": true
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Запрос списка тарифов.
Response
Successful Response
Ответ со списком тарифов.
Show child attributes
Show child attributes
Текущий тариф пользователя.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I
