Skip to content

Reseller workflow

A reseller integration joins two account systems: your customer and billing records, and the ProxyRequest resources that enforce proxy access. Persist the mapping explicitly at every creation step.

WORKFLOW

Provision one reseller customer

  1. Read your reseller profile

    Confirm the authenticated account and role before exposing provisioning controls.

    GET /profile
  2. Load available packages

    Present only products and targeting options returned for the deployment.

    GET /packages
  3. Create the sub-user

    Use your own customer ID as correlation metadata where supported, then store the returned API ID.

    POST /users
  4. Allocate bytes

    Convert the purchased amount to integer bytes and attach it to the created user.

    POST /users/{id}/data/add
  5. Generate proxy access

    Generate credentials for the package and targeting selected by the customer.

    POST /proxies/generate
  6. Activate synchronization

    Consume reseller webhook batches and schedule analytics reconciliation.

    POST /webhooks
const api = `https://${process.env.PROXYREQUEST_API_HOST}/api/v1`;
const headers = {
Authorization: `Static ${process.env.PROXYREQUEST_API_KEY}`,
'Content-Type': 'application/json',
};
const userResponse = await fetch(`${api}/users`, {
method: 'POST',
headers,
body: JSON.stringify({ username: 'customer-reference' }),
});
if (!userResponse.ok) throw new Error(`Create user: ${userResponse.status}`);
const user = await userResponse.json();
await fetch(`${api}/users/${user.id}/data/add`, {
method: 'POST',
headers,
body: JSON.stringify({ data: 10 * 1024 ** 3 }),
});

The snippets illustrate orchestration only. Use the operation schemas in the API Reference for the exact required fields enabled by your deployment.

  1. Generate an internal operation ID before the first API call and attach it to your logs.
  2. Persist the ProxyRequest user ID immediately after creation succeeds.
  3. Record the exact byte allocation request and its confirmed result.
  4. If the client times out, read the resource state before repeating a write.
  5. Mark the customer active only after credentials can be generated and tested.
  6. Reconcile billing totals independently from webhook arrival.

When a customer leaves, stop new commercial activity first, revoke or reset proxy access, remove obsolete API-visible resources as allowed, and retain the accounting records required by your own policy. Never delete your user-ID mapping before the external cleanup is confirmed.