Sample Hosting API Flow and some Notes

Buying Process for a Hosting Plan or Custom Package

  1. Retrieve all Product Keys: First get the list of Product Keys from your local store. These Product keys are currently:

    • lhbbudgetusa

    • lhbbudgetplanus

    • w2kbudgetusa

    • w2kbudgetplanus

    • lhbpremiumusa

    • w2kpremiumusa

    • mailboxbudgetusa

    • mailboxbudgetplanus

    • mailboxpremiumusa

  2. Retrieve Hosting Plans for a Product Key: Now use WebHostingOrderData.getHostingPlans() to get the 3 hosting plans (premium, budget and custom) available per product key except for lhbbudgetplanus, w2kbudgetplanus and mailboxpremiumusa. Each of these three product keys have the custom build feature disabled and are associated with only 2 hosting plans, premium and standard. The return value is a hash of hashes with a serial number as the key. Per plan, the most important information is the planid, the planname and the totalprice. Use OrderSetup.getPricingKeyDisplayName() and OrderSetup.getPricingParamsDisplayName() to get the standard names for these values to build you display. You can also use getMonthlyCostAndValidate() under the appropriate HostingOrder class to get the pro-rata pricing for the plan.

  3. Buy a Hosting Plan: Use add() under the appropriate HostingOrder class to add an order. Be sure to pass in planid as the key and the actual plan id as the value. You can specify the invoice options as well.

  4. Buy a Custom Package: Use OrderSetup.getPricingKeyPricingParamMap() to get a list of all pricing keys and their related pricing params. Once more, you can use OrderSetup.getPricingParamsDisplayName() and OrderSetup.getPricingKeyDisplayName() to get the standard names for these values to build you display. You can also use getMonthlyCostAndValidate() under the appropriate HostingOrder class to get the pro-rata pricing for the package. Calling fetchAlternateLocationDetailsAndMonthlyCosts() under the appropriate HostingOrder class will give you the cost for a similiar order configuration at an alternate location. Once everything is set, you call add() under the appropriate HostingOrder class and passing it all the key:value pairs required.

Deleting a Hosting Package

Additional Information

Deleting a Web Hosting package

Simply call del() under the appropriate HostingOrder class with the appropriate orderid.

Renewing a Hosting Package

Additional Information

Renewing a Web Hosting package

Simply call renew() under the appropriate HostingOrder class with the appropriate orderid and the months to renew for.

Note

The system allows you to create an infinite number of Resellers and Sub-Resellers, each with customers under them. Orders can be placed only on behalf of the Customers and cannot be owned by Resellers or their Sub-Resellers directly. You can create as many Customers as you wish.

Additional Information

Customers and Sub-Resellers