Integrating without WHMCS
This guide is for a reseller whose customer portal and billing are its own software (PHP/Laravel, Python, Node.js, Go, a billing panel, an automation system). WHMCS on your side is optional: ServerBike ships WHMCS modules for resellers who use WHMCS, and everything those modules do is available through this public API.
ServerBike's own commercial system remains the authority for your wholesale account: products, wholesale prices, your credit, purchases, renewals, escrow and paid-through dates. You never need access to it, to ServerBike's databases, or to the virtualization platform. Your retail prices and your customers' billing are entirely yours.
What your system must provide
| You own | Why |
|---|---|
| Customer accounts and authorization | ServerBike authenticates you, not your customers. Check that a customer owns a service before every action you perform for them. |
| Retail billing and invoices | ServerBike charges your credit at wholesale price; your prices and invoices are independent. |
| A durable order record | Store each operation_uuid and its exact request body before sending, and the service_uuid you receive. |
| A scheduler | Poll lookups after ambiguity, renew on time (when you hold renewal authority), reconcile settlements. |
| A secret store | Keep the API secret server-side only. |
1. Enrollment (done by ServerBike)
ServerBike creates your reseller account and gives you:
- A credential ID and a one-time secret (see
AUTHENTICATION.md). - Registration of your public egress addresses (IPv4 and/or IPv6, exact addresses). Send ServerBike every address your backend uses to reach the API.
- Registration of your portal hostname (an FQDN you control, for example
portal.example.com). It does not need to run WHMCS. It is used as the default allowed browserOriginfor the console (https://portal.example.com). Additional console origins (another host, a non-default port) are added by ServerBike on request. - Your credit (prepaid balance or limit), the products, terms and images you may buy, any per-reseller price rules (fixed override, else percentage discount, else the standard wholesale price) and purchase limits.
2. First calls
export SB_API_BASE=https://bridge.serverbike.com SB_CREDENTIAL_ID=... SB_SECRET=... # from your secret store
python3 examples/python/serverbike_client.py verify # proves credential, clock and source address
python3 examples/python/serverbike_client.py account # eligibility and credit balance
python3 examples/python/serverbike_client.py catalog # products, terms, wholesale prices, images, capabilitiesUse the opaque external_product_ref, term_ref and image_ref values exactly as returned. list_price (when
present) is ServerBike's public price, offered as a reference for your retail pricing; you are never charged it.
capabilities tell you which customer controls to show (vps.start, vps.stop, vps.restart, vps.poweroff,
vps.reinstall, vps.changepassword, vps.console).
3. Purchase and provisioning
- Generate a random UUID v4
operation_uuid. Write it and the exact JSON body to your order record first. POST /api/v1/purchaseswith{operation_uuid, external_product_ref, term_ref, requested_image_ref}.committedmeans your credit was debited once and a commercial service exists. Storebusiness_transaction_ref,commercial_service_refandservice_uuid(if not present yet, read it fromGET /api/v1/operations/{operation_uuid}later).- If the response is lost, times out, or is not a Bridge JSON answer: do not buy again. Poll
GET /api/v1/operations/{operation_uuid}untilcommittedorrejected. - Provisioning is automatic. Follow
GET /api/v1/services/{service_uuid}/runtime-state:queued,authorization_pending,provisioning,installing→running. Typical Linux delivery takes a few minutes. - Reconcile the debit:
GET /api/v1/operations/{operation_uuid}/settlementreturns the recorded amount, currency and transaction reference. If provisioning fails definitively, the debit is refunded once ServerBike has proven that nothing was created (automatically where enabled, otherwise by support); the refund appears in the same settlement as acredittransaction.
4. Delivering the server to your customer
GET /api/v1/services/{service_uuid}/guest-accessreports the effective image's OS family and login details. The configured Linux login isssh/root/22 and the configured Windows login isrdp/Administrator/3389. A reinstall updates the projection only after the provider's successful completion is verified. An unresolved reinstall or a historical reinstall without a recorded technical target can returnos_family: "unknown"andlogin: null.- While
initial_credential.stateisavailable, reveal it once withPOST /api/v1/services/{service_uuid}/access/initial-credential{"confirm":true}and show it to the customer once (do not store it). Exactly one call ever gets the password; a lost response consumes it. - A verified password replacement or reinstall supersedes the original password. A reveal already consumed still
reports
revealedin guest access and never returns the plaintext again. - While a replacement is unresolved, an unused initial credential reports
unavailablewithrecovery: null. Poll the existing operation before choosing a recovery action. A definitive no-effect outcome preserves an unused original credential if it is still valid. recovery: password_changeidentifies the recovery route when the old password cannot be shown. UsePOST /api/v1/services/{service_uuid}/passwordwhen the product grantsvps.changepassword, or use the offered recovery options for that service.
5. Customer controls
| Customer action | Call | Follow with |
|---|---|---|
| Start / Stop / Restart / Power off | POST /services/{s}/power/{action} {operation_uuid} | GET /services/{s}/power/operations/{o} until complete or failed_* |
| Reinstall | POST /services/{s}/reinstall {operation_uuid, image_ref, new_password} | GET /services/{s}/reinstall/operations/{o} |
| Change password | POST /services/{s}/password {operation_uuid, new_password} | GET /services/{s}/password/operations/{o} |
| Status and usage | GET /services/{s}/runtime-state | — |
| History | GET /services/{s}/activity | — |
| Console | POST /services/{s}/console-sessions {origin} | see CONSOLE.md |
One runtime action at a time per service. The platform continues restarts and provider-requested power cycles on its own; your polling only observes. Passwords: 16–128 bytes, no control characters; never log them.
6. Renewals
GET /api/v1/services/{service_uuid}/commercial tells you paid_through and renewal.authority:
reseller_api— you renew:POST /api/v1/renewals{operation_uuid, commercial_service_ref, service_uuid, term_ref}beforepaid_through. The settlement reports the newpaid_through.serverbike_automatic— ServerBike renews from your credit; API renewals are refused (409). Keep enough credit.
Your customers' billing cycle is yours; never derive ServerBike's paid-through date from your retail schedule.
7. Upgrades (deferred plan change)
GET /api/v1/services/{service_uuid}/commercial→plan_change.availableandtargets(each with the wholesale difference andqualified). This is a preview: it reserves nothing.POST /api/v1/commercial-changeswith the target. ServerBike holds the wholesale difference in escrow.- Poll
GET /api/v1/services/{service_uuid}/plan-changes/{operation_uuid}. When bothactivation_readyandcustomer_power_cycle_permittedare true, ask the customer to shut the server down (Stop or Power off) and start it again. The customer controls power for the upgrade. - The platform verifies the new resources, ServerBike captures the held amount exactly once (
completed), or releases it if nothing was applied (released).operator_reviewmeans ServerBike support decides. - Keep the customer on the old retail plan until
completed.
8. Termination
POST /api/v1/commercial-terminations {operation_uuid, commercial_service_ref, service_uuid}. The commercial
termination commits first; the server is then deleted by the platform. Follow runtime-state to terminated.
9. Recovery and reconciliation
- Keep a list of every open
operation_uuid. After any outage, poll each one; never resend under a new UUID. - Reconcile money daily: for each committed operation,
GET /operations/{o}/settlement; compare withGET /account/commercial(credit balance). reconciliation_requiredoroperator_reviewthat persists for more than an hour: contact ServerBike support with theoperation_uuidand theX-Request-Idof the last response.
10. Credential rotation
Ask ServerBike for a new credential; both work during a finite overlap. Switch your secret store, verify with
/auth/verify, then ask ServerBike to revoke the old one. Revocation on request is immediate.
11. Limits
Production limits per minute: 60 reads, 60 polls, 10 mutations, 10 auth probes, 60 per source address, 60 per credential, 60 per reseller, 10 authentication failures. Poll with backoff (3 s, then up to 30 s). Runtime actions also have per-service hourly limits (12 power actions per hour, 3 reinstalls per hour, 5 password changes per day).