Get cart config

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

GET

Get cart config

/cart/config

Get all config for calculator, like: rules for counts, traffic, paid period, etc. This is used in plan selector to show the rules for the order.

Метод запита

GEThttps://api.stableproxy.com/v2/cart/config

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

1const baseUrl = "https://api.stableproxy.com/v2";
2const response = await fetch(baseUrl + "/cart/config", {
3 method: "GET",
4 headers: {
5 "Content-Type": "application/json"
6 }
7});
8const data = await response.json();

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

Success response200application/json
{
  "data": {
    "pay_for_types": {
      "ip": [],
      "gb": []
    },
    "traffic_unit": [
      "gb"
    ],
    "categories": {
      "datacenter": {
        "types": [
          "shared",
          "private"
        ]
      },
      "residential": {
        "types": [
          "residential_gb",
          "residential_static",
          "residential_static_gb",
          "residential_requests"
        ]
      },
      "mobile": {
        "types": [
          "mobile_gb",
          "mobile_static",
          "residential_requests"
        ]
      }
    },
    "geo_services": {
      "types": [
        "shared",
        "private"
      ]
    },
    "low_fraud_score": {
      "types": [
        "shared",
        "private"
      ]
    },
    "disabled_types": [
      "payasgo",
      "residential_requests",
      "mobile_requests"
    ],
    "verification_types": [],
    "types": {
      "shared": {
        "config": {
          "links": [
            "private"
          ],
          "enabled": true,
          "pay_for": "ip",
          "count_selector": {
            "min": 10,
            "max": 2000,
            "default": 10,
            "ranges": [
              {
                "min": 10,
                "max": 25,
                "if": []
              },
              {
                "min": 10,
                "max": 50,
                "if": [
                  "period_days >= 7"
                ]
              },
              {
                "min": 10,
                "max": 100,
                "if": [
                  "period_days >= 14"
                ]
              },
              {
                "min": 100,
                "max": 9999,
                "if": [
                  "period_days >= 29"
                ]
              }
            ]
          },
          "countries": {
            "select": true,
            "free_countries_key": "shared"
          },
          "paid_period": {
            "select": true,
            "selectors": [
              {
                "type": "weeks",
                "amount": 1,
                "if": []
              },
              {
                "type": "weeks",
                "amount": 2,
                "if": []
              },
              {
                "type": "months",
                "amount": 1,
                "if": [],
                "default": true
              },
              {
                "type": "years",
                "amount": 1,
                "if": []
              }
            ]
          },
          "traffic": {
            "select": true,
            "selectors": [
              {
                "type": "gb",
                "amount": 25,
                "if": [
                  "count < 100"
                ]
              },
              {
                "type": "gb",
                "amount": 100,
                "if": [],
                "default": true
              },
              {
                "type": "gb",
                "amount": 400,
                "if": []
              },
              {
                "type": "gb",
                "amount": 800,
                "if": []
              },
              {
                "type": "gb",
                "amount": 5000,
                "if": []
              }
            ]
          }
        }
      },
      "private": {
        "config": {
          "links": [
            "shared"
          ],
          "enabled": true,
          "pay_for": "ip",
          "count_selector": {
            "min": 5,
            "max": 1250,
            "default": 5,
            "ranges": [
              {
                "min": 5,
                "max": 25,
                "if": []
              },
              {
                "min": 10,
                "max": 50,
                "if": [
                  "period_days >= 7"
                ]
              },
              {
                "min": 10,
                "max": 100,
                "if": [
                  "period_days > 7"
                ]
              },
              {
                "min": 100,
                "max": 9999,
                "if": [
                  "period_days >= 29"
                ]
              }
            ]
          },
          "countries": {
            "select": true,
            "free_countries_key": "private"
          },
          "paid_period": {
            "select": true,
            "selectors": [
              {
                "type": "weeks",
                "amount": 1,
                "if": []
              },
              {
                "type": "weeks",
                "amount": 2,
                "if": []
              },
              {
                "type": "months",
                "amount": 1,
                "if": [],
                "default": true
              },
              {
                "type": "years",
                "amount": 1,
                "if": []
              }
            ]
          },
          "traffic": {
            "select": true,
            "selectors": [
              {
                "type": "gb",
                "amount": 25,
                "if": [
                  "count < 100"
                ]
              },
              {
                "type": "gb",
                "amount": 100,
                "if": [],
                "default": true
              },
              {
                "type": "gb",
                "amount": 400,
                "if": []
              },
              {
                "type": "gb",
                "amount": 800,
                "if": []
              },
              {
                "type": "gb",
                "amount": 0,
                "if": []
              }
            ]
          }
        }
      },
      "residential_gb": {
        "config": {
          "pay_for": "gb",
          "enabled": true,
          "links": [
            "residential_static_gb"
          ],
          "count_selector": {
            "min": 0,
            "max": 0,
            "default": 1,
            "ranges": []
          },
          "countries": {
            "select": false,
            "free_countries_key": "residential_gb"
          },
          "paid_period": {
            "select": false,
            "selectors": [
              {
                "type": "days",
                "amount": 30,
                "if": []
              }
            ]
          },
          "traffic": {
            "select": true,
            "selectors": [
              {
                "type": "gb",
                "amount": 1,
                "if": []
              },
              {
                "type": "gb",
                "amount": 5,
                "if": []
              },
              {
                "type": "gb",
                "amount": 25,
                "if": []
              },
              {
                "type": "gb",
                "amount": 50,
                "if": []
              }
            ]
          }
        }
      },
      "residential_static_gb": {
        "config": {
          "links": [
            "residential_gb"
          ],
          "enabled": true,
          "pay_for": "ip",
          "count_selector": {
            "min": 1,
            "max": 50,
            "default": 1,
            "ranges": []
          },
          "countries": {
            "select": true,
            "select_all": true,
            "disable_without": true,
            "free_countries_key": "residential_static_gb"
          },
          "paid_period": {
            "select": true,
            "selectors": [
              {
                "type": "months",
                "amount": 1,
                "if": []
              }
            ]
          },
          "traffic": {
            "select": true,
            "selectors": [
              {
                "type": "gb",
                "amount": 1,
                "if": [
                  "count < 5"
                ]
              },
              {
                "type": "gb",
                "amount": 5,
                "if": [
                  "count < 10"
                ]
              },
              {
                "type": "gb",
                "amount": 10,
                "if": [
                  "count <= 20"
                ]
              },
              {
                "type": "gb",
                "amount": 25,
                "if": [
                  "count <= 50"
                ]
              },
              {
                "type": "gb",
                "amount": 50,
                "if": []
              },
              {
                "type": "gb",
                "amount": 100,
                "if": []
              }
            ]
          }
        }
      },
      "mobile_gb": {
        "config": {
          "links": [
            "mobile_static_gb",
            "mobile_requests"
          ],
          "enabled": true,
          "pay_for": "gb",
          "count_selector": {
            "min": 1,
            "max": 1,
            "default": 1,
            "ranges": []
          },
          "countries": {
            "select": false,
            "free_countries_key": "mobile_gb"
          },
          "paid_period": {
            "select": false,
            "selectors": [
              {
                "type": "days",
                "amount": 30,
                "if": []
              }
            ]
          },
          "traffic": {
            "select": true,
            "selectors": [
              {
                "type": "gb",
                "amount": 1,
                "if": []
              }
            ]
          }
        }
      },
      "mobile_static": {
        "config": {
          "links": [
            "mobile_gb",
            "mobile_requests"
          ],
          "enabled": false,
          "pay_for": "ip",
          "count_selector": {
            "min": 1,
            "max": 1,
            "default": 1,
            "ranges": []
          },
          "countries": {
            "select": false,
            "free_countries_key": "mobile_static"
          },
          "paid_period": {
            "select": true,
            "selectors": [
              {
                "type": "days",
                "amount": 1,
                "if": []
              },
              {
                "type": "weeks",
                "amount": 2,
                "if": []
              },
              {
                "type": "months",
                "amount": 1,
                "if": []
              }
            ]
          },
          "traffic": {
            "select": false,
            "selectors": [
              {
                "type": "gb",
                "amount": 0,
                "if": []
              }
            ]
          }
        }
      },
      "mobile_static_gb": {
        "config": {
          "links": [
            "mobile_gb",
            "mobile_requests"
          ],
          "enabled": true,
          "pay_for": "ip",
          "count_selector": {
            "min": 1,
            "max": 1,
            "default": 1,
            "ranges": []
          },
          "countries": {
            "select": false,
            "free_countries_key": "mobile_static_gb"
          },
          "paid_period": {
            "select": true,
            "selectors": [
              {
                "type": "days",
                "amount": 1,
                "if": []
              },
              {
                "type": "weeks",
                "amount": 2,
                "if": []
              },
              {
                "type": "months",
                "amount": 1,
                "if": []
              }
            ]
          },
          "traffic": {
            "select": false,
            "selectors": [
              {
                "type": "gb",
                "amount": 1,
                "if": []
              }
            ]
          }
        }
      }
    }
  },
  "good": true,
  "timestamp": 1731313825,
  "cause": {
    "type": "anonymous",
    "user_id": -1
  }
}