Youproxy

Calculate an order

Updated:

Returns the order price before checkout, including discount, balance check, and warnings. Always call this before Create an order to surface validation issues without spending balance.

Endpoint:

POST/client/api/v1/{apiKey}/calculate/order

Path parameters

Name

Type

Description

apiKey*

String

Your personal API key.

Request body

Name

Type

Description

proxyType*

string

Which proxy type to calculate for.

IPv4 IPv6 MOBILE ISP

quantity*

number

Number of IP addresses to order.

rentPeriodDays*

number

Rental duration in days. Get valid values from Rent period.

country*

string

ISO 3166-1 alpha-3 code (e.g. USA). Get valid values from Country.

goal*

string

Custom goal label for the order.

promoCode

string

Discount promo code. Get valid values from Promo codes.

Additional fields when proxyType=MOBILE

Name

Type

Description

rotationTime*

number

Rotation interval in seconds. Get valid values from Mobile operator.

mobileOperator*

string

Operator tag. Get valid values from Mobile operator.

Examples

curl -X POST https://youproxy.io/client/api/v1/$KEY/calculate/order \
  -H "Content-Type: application/json" \
  -d '{
    "proxyType": "IPv4",
    "quantity": 5,
    "rentPeriodDays": 30,
    "country": "USA",
    "goal": "scraping",
    "promoCode": "SAVE10"
  }'
curl -X POST https://youproxy.io/client/api/v1/$KEY/calculate/order \
  -H "Content-Type: application/json" \
  -d '{
    "proxyType": "IPv6",
    "quantity": 5,
    "rentPeriodDays": 30,
    "country": "USA",
    "goal": "scraping",
    "promoCode": "SAVE10"
  }'
# MOBILE β€” note the extra fields
curl -X POST https://youproxy.io/client/api/v1/$KEY/calculate/order \
  -H "Content-Type: application/json" \
  -d '{
    "proxyType": "MOBILE",
    "quantity": 5,
    "rentPeriodDays": 30,
    "country": "USA",
    "goal": "scraping",
    "rotationTime": 300,
    "mobileOperator": "verizon"
  }'
curl -X POST https://youproxy.io/client/api/v1/$KEY/calculate/order \
  -H "Content-Type: application/json" \
  -d '{
    "proxyType": "ISP",
    "quantity": 5,
    "rentPeriodDays": 30,
    "country": "USA",
    "goal": "scraping",
    "promoCode": "SAVE10"
  }'

Response

{
    "success": true,
    "proxyType": "IPv4",
    "balance": 7.18,
    "price": 1.31,
    "currency": "USD",
    "discount": 0,
    "promoCodeStatus": null,
    "error": null,
    "warnings": null
}

If there're warnings, the order with current data won't be executed.

{
    "success": true,
    "proxyType": "IPv4",
    "balance": 7.18,
    "price": 22.61,
    "currency": "USD",
    "discount": 0,
    "promoCodeStatus": null,
    "error": null,
    "warnings": [
        {
            "code": 14,
            "message": "Incorrect goal"
        },
       
        {
            "code": 16,
            "message": "Insufficient funds on balance"
        }
    ]
}

{
    "success": true,
    "proxyType": "IPv4",
    "balance": 7.18,
    "price": 1.18,
    "currency": "USD",
    "discount": 10,
    "promoCodeStatus": "VALID",
    "error": null,
    "warnings": null
}

{
    "success": true,
    "proxyType": "IPv4",
    "balance": 7.18,
    "price": 1.31,
    "currency": "USD",
    "discount": 0,
    "promoCodeStatus": "NO_VALID",
    "error": null,
    "warnings": null
}

{
    "success": false,
    "proxyType": null,
    "balance": 7.18,
    "price": null,
    "currency": "USD",
    "discount": null,
    "promoCodeStatus": null,
    "error": {
        "code": 4,
        "message": "Incorrect proxy type"
    },
    "warnings": null
}

Response fields

Field

Type

Description

success

boolean

true on success, false if error is populated.

proxyType

string | null

Echoes the requested type. null on error.

balance

number

Account balance in currency.

price

number | null

Calculated total. null on error.

currency

string

ISO currency code (e.g. USD).

discount

number | null

Discount percentage applied (e.g. 10 means 10%). 0 if no promo code.

promoCodeStatus

string | null

VALID, NO_VALID, or null if no promoCode sent.

warnings

array | null

Non-blocking issues. If present, the order won't go through with current data β€” fix and retry.

error

object | null

{ code, message } on failure, null on success.

On this page