API integration guide

Integrate NIDProxy into your application — automate proxy orders, retrieve credentials, and manage gateway access. Get your API key from Settings.

Overview

Base URL
  https://your-domain.com

Request format
  Content-Type: application/json
  Accept: application/json

Response format
  JSON object on success
  { "error": "Human-readable message" } on failure

Authentication

Use an API key for credential and bandwidth endpoints. Order and wallet endpoints require a session obtained via login — run those from your backend and store the cookie securely.

# API key (recommended for server-to-server)
Header: X-API-Key: YOUR_API_KEY

Find your key: Dashboard → Settings → API key
Works on: /api/credentials, /api/bandwidth

# Session cookie (browser or server-side login)
1. POST /api/auth/login  { "email", "password" }
2. Store the proxy_session cookie from the response
3. Send it on subsequent requests: Cookie: proxy_session=...

Required for: orders, wallet, ISP, order management

Workflow — buy proxies

Typical integration flow for purchasing static or residential proxies programmatically.

# 1. Load catalog
GET /api/proxy-seller/reference?type=ipv4

# 2. Get a price quote
PUT /api/upstream-orders
{
  "productType": "ipv4",
  "params": { "countryId": 1, "periodId": "1w", "quantity": 10 }
}

# 3. Place order (wallet pays instantly; stripe/crypto return checkoutUrl)
POST /api/upstream-orders
{
  "productType": "ipv4",
  "params": { "countryId": 1, "periodId": "1w", "quantity": 10 },
  "paymentMethod": "wallet",
  "autoRenew": true
}

# 4. If checkoutUrl returned, redirect user then confirm:
POST /api/upstream-orders/confirm
{ "orderId": "...", "sessionId": "..." }

# 5. Fetch credentials
GET /api/upstream-orders
# Each credential → IP:PORT:USERNAME:PASSWORD

Workflow — gateway credentials

Create rotating or sticky credentials for the shared proxy gateway using only your API key.

# Create a rotating gateway credential
POST /api/credentials
Header: X-API-Key: YOUR_API_KEY
{
  "label": "Scraper pool",
  "sessionMode": "ROTATING",
  "countryFilter": "US,GB"
}

# Response includes username + password
# Connect via your platform gateway:
#   http://USERNAME:PASSWORD@proxy.your-domain.com:8888
#   socks5://USERNAME:PASSWORD@proxy.your-domain.com:1080

# Monitor usage
GET /api/bandwidth?days=30
Header: X-API-Key: YOUR_API_KEY

Proxy connection format

# Purchased proxies (orders) — connect directly
185.134.194.170:12323:14a449cdc5de4:83b9b00317

curl -x http://USER:PASS@185.134.194.170:12323 https://api.ipify.org
curl --socks5 USER:PASS@185.134.194.170:12323 https://api.ipify.org

# Gateway credentials — connect via platform gateway host
curl -x http://USERNAME:PASSWORD@proxy.your-domain.com:8888 https://api.ipify.org

Code example (Node.js)

// Node.js — list credentials with your API key
const API_KEY = process.env.NIDPROXY_API_KEY;
const BASE = "https://your-domain.com";

const res = await fetch(`${BASE}/api/credentials`, {
  headers: { "X-API-Key": API_KEY },
});
const { credentials } = await res.json();

// Node.js — place a wallet order (server-side session)
const login = await fetch(`${BASE}/api/auth/login`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ email: "you@company.com", password: "..." }),
});
const cookie = login.headers.get("set-cookie"); // store proxy_session

const order = await fetch(`${BASE}/api/upstream-orders`, {
  method: "POST",
  headers: { "Content-Type": "application/json", Cookie: cookie },
  body: JSON.stringify({
    productType: "ipv4",
    params: { countryId: 1, periodId: "1w", quantity: 10 },
    paymentMethod: "wallet",
  }),
});
const data = await order.json();

Error handling

HTTP status | Meaning
401          | Missing or invalid API key / session
403          | Valid auth but action not allowed
404          | Resource not found
402          | Insufficient wallet balance
429          | Rate limit (e.g. credential reset cooldown)
503          | Feature unavailable (payments or upstream not configured)

Endpoint reference

All integrator-facing endpoints with request and response shapes.

Gateway credentials

Manage rotating or sticky credentials for the shared proxy gateway. Authenticate with your API key.

GETAPI key/api/credentials

List all gateway credentials on the account.

Response

{ "credentials": [{ "id", "label", "username", "password", "sessionMode", "countryFilter", ... }] }
POSTAPI key/api/credentials

Not supported — credentials are issued automatically when you purchase proxies.

Request body

{ "label": "Campaign A", "sessionMode": "ROTATING", "countryFilter": "US,DE" }

Response

403 { "error": "Credentials are created automatically when you purchase proxies..." }
PATCHSession/api/credentials/:id

Update label, session mode, country filter, or active flag.

Request body

{ "label": "New label", "sessionMode": "STICKY", "countryFilter": "US" }
DELETESession/api/credentials/:id

Permanently delete a credential.

Response

{ "ok": true }
GETAPI key/api/bandwidth?days=30

Daily bandwidth chart and per-credential usage totals.

Response

{ "chart": [...], "summary": { "totalUsed", "totalLimit", "credentials": [...] } }

Proxy orders

Purchase datacenter, ISP, mobile, mix, or residential proxies. Credentials are returned as IP:PORT:USER:PASS.

GETSession/api/proxy-seller/reference?type=ipv4

Catalog metadata — countries, periods, targets, operators (use before quoting).

Response

{ "configured": true, "type": "ipv4", "reference": { "countries", "periods", ... } }
PUTSession/api/upstream-orders

Live price quote for a product configuration.

Request body

{ "productType": "ipv4", "params": { "countryId": 1, "periodId": "1w", "quantity": 10 } }

Response

{ "totalCents", "unitCents", "quantity", "currency": "USD", ... }
POSTSession/api/upstream-orders

Create an order. Pay with wallet, Stripe, or crypto.

Request body

{ "productType": "ipv4", "params": { ... }, "paymentMethod": "wallet", "autoRenew": true }

Response

{ "order": { "id", "status" }, "checkoutUrl?": "..." }
GETSession/api/upstream-orders

List orders with attached proxy credentials.

Response

{ "orders": [{ "id", "status", "credentials": [{ "proxyHost", "proxyHttpPort", "username", "password" }] }] }
POSTSession/api/upstream-orders/confirm

Confirm payment after Stripe/crypto redirect and trigger fulfillment.

Request body

{ "orderId": "...", "sessionId": "..." }

Response

{ "fulfilled": true, "status": "ACTIVE" }
PATCHSession/api/upstream-orders/:id/auto-renew

Enable or disable wallet auto-renew for the order period.

Request body

{ "enabled": true }
POSTSession/api/upstream-orders/renew

Process due auto-renewals for the authenticated account.

Order management

Extend, annotate, or rotate credentials on active orders.

POSTSession/api/my-orders/:orderId/extend

Extend an active order for another billing period (debited from wallet).

Response

{ "ok": true }
POSTSession/api/my-orders/:orderId/reset-credentials

Rotate USER:PASS for selected proxies (once per hour per order).

Request body

{ "credentialIds": ["cred_id_1", "cred_id_2"] }
PATCHSession/api/my-orders/:orderId/note

Save a private note on an order (max 2000 chars).

Request body

{ "note": "Customer ref #1234" }

Wallet & payments

Check balance, top up, and inspect available payment methods.

GETSession/api/billing/balance

Current wallet balance in cents.

Response

{ "balanceCents": 2500 }
GETSession/api/billing/add-funds

Suggested top-up preset amounts in cents.

Response

{ "presetsCents": [1000, 2500, 5000, ...] }
POSTSession/api/billing/add-funds

Start a wallet top-up. Returns a checkout URL for card or crypto.

Request body

{ "amountCents": 2500, "paymentMethod": "stripe" }

Response

{ "topupId", "checkoutUrl", "paymentMethod" }
POSTSession/api/billing/confirm-topup

Confirm a top-up after external payment.

Request body

{ "topupId": "...", "sessionId": "..." }

Response

{ "credited": true }
GETSession/api/payments/methods?context=order

Available payment methods. Use context=topup for add-funds flows.

Response

{ "methods", "balanceCents", "stripe", "crypto" }

ISP proxies

Dedicated ISP lines with direct IP:PORT connection (no shared gateway).

GETSession/api/isp/inventory?supplyMode=UPSTREAM

Per-country stock levels and random-pool availability.

Response

{ "supplyMode", "inventory": [{ "country", "availableProxies" }], "randomAvailable" }
GETSession/api/isp/orders

List ISP orders with proxy lines.

POSTSession/api/isp/orders

Create an ISP order.

Request body

{ "duration": "DAYS_30", "supplyMode": "UPSTREAM", "locations": [{ "country": "US", "quantity": 5 }], "paymentMethod": "stripe" }

Account

Profile and API key retrieval.

GETSession/api/auth/me

Current user profile, role, and API key.

Response

{ "user": { "id", "email", "role", "apiKey" } }