Proxy Renewal - Step 1

Proxy Renewal

The method is used to calculate the cost of renewal. To calculate the cost, you need to pass the proxy type and proxy ID

Request for getting available renewal options:

URL

https://api.belurk.com/proxy/create-renewal

Sending Method

POST

CURL

  1. 1.curl --location 'https://api.belurk.com/proxy/create-renewal'
  2. 2.--header 'Content-Type: application/json'
  3. 3.--header 'x-api-token: {{API_TOKEN}}'
  4. 4.--data '{
  5. 5. "proxy_type": "ipv6",
  6. 6. "selected_proxy": [
  7. 7. 10001,
  8. 8. 10002
  9. 9. ]
  10. 10.}'

Response in case of successful retrieval of options

Response Status: HTTP 200 OK

  1. 1.{
  2. 2. "data": {
  3. 3. "amount": 0,
  4. 4. "count": 10,
  5. 5. "periods": [
  6. 6. {
  7. 7. "label": "1 день",
  8. 8. "key": "1_day"
  9. 9. },
  10. 10. {
  11. 11. "label": "3 дня",
  12. 12. "key": "3_day"
  13. 13. },
  14. 14. {
  15. 15. "label": "1 неделя",
  16. 16. "key": "1_week"
  17. 17. },
  18. 18. {
  19. 19. "label": "2 недели",
  20. 20. "key": "2_week"
  21. 21. },
  22. 22. {
  23. 23. "label": "1 месяц",
  24. 24. "key": "1_month"
  25. 25. },
  26. 26. {
  27. 27. "label": "2 месяца",
  28. 28. "key": "2_month"
  29. 29. },
  30. 30. {
  31. 31. "label": "3 месяца",
  32. 32. "key": "3_month"
  33. 33. }
  34. 34. ]
  35. 35. }
  36. 36.}

Failure Response

Response Status: HTTP 404 Not Found

  1. 1.{
  2. 2. "data": null
  3. 3. "error": "По заданному фильтру ничего не найдено"
  4. 4.}

Request for calculating the cost:

After receiving information about available renewal tariffs, you need to pass a value from the proposed renewal options to calculate the cost

CURL

  1. 1.curl --location 'https://api.belurk.com/proxy/create-renewal'
  2. 2.--header 'Content-Type: application/json'
  3. 3.--header 'x-api-token: {{API_TOKEN}}'
  4. 4.--data '{
  5. 5. "period": "1_month",
  6. 6. "proxy_type": "ipv6",
  7. 7. "selected_proxy": [
  8. 8. 10001,
  9. 9. 10002
  10. 10. ]
  11. 11.}'

Response in case of successful cost calculation

Response Status: HTTP 200 OK

  1. 1.{
  2. 2. "data": {
  3. 3. "amount": 21, //renewal amount
  4. 4. "count": 10,
  5. 5. "periods": [
  6. 6. {
  7. 7. "label": "1 день",
  8. 8. "key": "1_day"
  9. 9. },
  10. 10. {
  11. 11. "label": "3 дня",
  12. 12. "key": "3_day"
  13. 13. },
  14. 14. {
  15. 15. "label": "1 неделя",
  16. 16. "key": "1_week"
  17. 17. },
  18. 18. {
  19. 19. "label": "2 недели",
  20. 20. "key": "2_week"
  21. 21. },
  22. 22. {
  23. 23. "label": "1 месяц",
  24. 24. "key": "1_month"
  25. 25. },
  26. 26. {
  27. 27. "label": "2 месяца",
  28. 28. "key": "2_month"
  29. 29. },
  30. 30. {
  31. 31. "label": "3 месяца",
  32. 32. "key": "3_month"
  33. 33. }
  34. 34. ]
  35. 35. }
  36. 36.}