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.
Example orchestration
Section titled “Example orchestration”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 }),});import osimport requests
api = f"https://{os.environ['PROXYREQUEST_API_HOST']}/api/v1"headers = { "Authorization": f"Static {os.environ['PROXYREQUEST_API_KEY']}", "Content-Type": "application/json",}
user_response = requests.post( f"{api}/users", headers=headers, json={"username": "customer-reference"}, timeout=15,)user_response.raise_for_status()user = user_response.json()
allocation = requests.post( f"{api}/users/{user['id']}/data/add", headers=headers, json={"data": 10 * 1024**3}, timeout=15,)allocation.raise_for_status()The snippets illustrate orchestration only. Use the operation schemas in the API Reference for the exact required fields enabled by your deployment.
Make the workflow recoverable
Section titled “Make the workflow recoverable”- Generate an internal operation ID before the first API call and attach it to your logs.
- Persist the ProxyRequest user ID immediately after creation succeeds.
- Record the exact byte allocation request and its confirmed result.
- If the client times out, read the resource state before repeating a write.
- Mark the customer active only after credentials can be generated and tested.
- Reconcile billing totals independently from webhook arrival.
Deprovisioning order
Section titled “Deprovisioning order”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.