Proxy./ docs

Build a reseller business on HProxy

The reseller loop over the HProxy API: fund a wallet, sell residential GB or dedicated IPs, deliver programmatically, get pushed on fulfillment and renew.

Everything a proxy storefront needs, over one API: prepaid wallet, server-authoritative quotes, idempotent orders, programmatic delivery for both residential lines and dedicated IPs, webhooks on fulfillment, and renewals. Your customers never see HProxy: every response is white-label by construction.

  1. 1
    Fund the wallet
    POST /deposits returns a hosted payUrl (card or crypto). Everything below prepays from this balance and fails with an honest 402 when it's short. No surprise card charges, ever.
  2. 2
    Quote before you sell
    GET /products/{id}/price returns the exact amount the order will charge. For dedicated IPs pass country and period_days too. Put your margin on top and show YOUR price.
  3. 3
    Buy on demand
    POST /orders with an Idempotency-Key. Wallet-paid orders return in seconds; a retry with the same key can never double-charge.
  4. 4
    Deliver
    Residential: POST /plans/{id}/generate per customer request. Dedicated: GET /proxies?order_id=… once the order completes.
  5. 5
    Attribute
    PATCH /plans/{id} with a label. Your customer reference rides on every read and every webhook after that.
  6. 6
    Get pushed, don't poll
    Register a webhook: order.fulfilled fulfills the sale, plan.low_traffic prompts the top-up.
  7. 7
    Renew
    POST /orders with fulfillment_meta: {"kind": "extension", "ids": […]} renews exactly the proxies your customer keeps.

Selling residential GB, one plan per customer

Each purchase provisions its own isolated plan: its own upstream credentials and its own hard GB cap. So the sub-user model is built into the buy flow: buy one (small) plan per customer, and customers can never drain each other. Label each plan with YOUR customer reference, read its remaining GB any time, and get pushed plan.low_traffic when a customer needs a top-up. Generation is free and repeatable; the plan's balance is consumed by actual traffic only.

Residential loop, per customer
# 1. Buy 10 GB for customer 1042 (their own isolated plan + credentials)
curl -X POST https://hproxy.com/api/v1/orders \
  -H "X-API-Key: hpx_your_key_here" -H "Idempotency-Key: cust-1042-resi-10gb" \
  -H "Content-Type: application/json" \
  -d '{"product_id": "residential-premium", "quantity": 10}'

# 2. The new plan id shows up here (newest first)
curl https://hproxy.com/api/v1/plans -H "X-API-Key: hpx_your_key_here"

# 3. Tag it with YOUR customer reference
curl -X PATCH https://hproxy.com/api/v1/plans/{planId} \
  -H "X-API-Key: hpx_your_key_here" -H "Content-Type: application/json" \
  -d '{"label": "customer-1042"}'

# 4. Generate lines per customer request (free, repeatable)
curl -X POST https://hproxy.com/api/v1/plans/{planId}/generate \
  -H "X-API-Key: hpx_your_key_here" -H "Content-Type: application/json" \
  -d '{"count": 100, "country": "US", "stickyMinutes": 10}'

# 5. Show the customer their balance (synced ~every 30 min)
curl https://hproxy.com/api/v1/plans/{planId} -H "X-API-Key: hpx_your_key_here"
Shared plan vs plan per customer
Pooling one big plan across many customers also works (generate distinct lines per customer), but the GB balance is shared, so use it for trials and burst capacity, and one-plan-per-customer for real isolation.

Selling dedicated IPs (IPv4 / IPv6 / ISP / Mobile)

Dedicated loop
# 1. Quote the exact charge for the targeting your customer picked
curl "https://hproxy.com/api/v1/products/ipv4/price?quantity=5&country=DEU&period_days=30" \
  -H "X-API-Key: hpx_your_key_here"

# 2. Buy with the same targeting
curl -X POST https://hproxy.com/api/v1/orders \
  -H "X-API-Key: hpx_your_key_here" -H "Idempotency-Key: cust-1042-ipv4-de-5" \
  -H "Content-Type: application/json" \
  -d '{"product_id": "ipv4", "quantity": 5,
       "fulfillment_meta": {"country": "DEU", "period_days": 30}}'

# 3. On the order.fulfilled webhook (or once GET /orders/{id} says completed):
curl "https://hproxy.com/api/v1/proxies?order_id={orderId}" -H "X-API-Key: hpx_your_key_here"
# -> ip, ports, username, password per proxy. Hand them to your customer.

# 4. Renewal, 30 more days for the proxies the customer kept
curl -X POST https://hproxy.com/api/v1/orders \
  -H "X-API-Key: hpx_your_key_here" -H "Idempotency-Key: cust-1042-renew-jul" \
  -H "Content-Type: application/json" \
  -d '{"product_id": "ipv4", "quantity": 2,
       "fulfillment_meta": {"kind": "extension", "ids": ["9214321", "9214322"], "period_days": 30}}'

Renewals are ownership-checked server-side: the ids (from GET /proxies) must belong to the calling account, and the renewal is priced for exactly those proxies. quantity should match the number of ids.

Safety rails for production

Send an Idempotency-Key on every write, so retries converge instead of double-charging. Put a daily spend cap on the key in your dashboard, so a leak can't drain the wallet. Verify webhook signatures before trusting a delivery. Branch on the machine code in error bodies (402 = top up, 429 = back off per Retry-After). And generate your client from the OpenAPI spec instead of hand-writing one.

White-label by construction
Responses never name upstream networks or infrastructure partners, so your storefront stays fully white-label.

Need a hand wiring this up? Email support@hproxy.com. A real person reads every message.