# Google Workspace For WHMCS

This article is currently being updated, so you might notice missing images, incomplete sections, or temporarily broken links. Thanks for your patience while we get everything up to date!

# (opens new window) About Google Workspace For WHMCS (opens new window)

Google Workspace For WHMCS will enable all Authorized Resellers of Google Workspace services to provision and manage Google accounts in their very own WHMCS system.

Authenticate through OAuth 2.0, create flexible products and let your clients order ready Google services directly from your website.

  • Admin Area Features

    • Create/Suspend/Unsuspend/Terminate Account
    • Change Package
    • Create Admin User
    • Choose Plan Name
    • Choose Renewal Type
    • Choose Action On Termination
    • Log API Requests
    • Automatically Create Administrator Account
    • Set Administrator Mailbox Name
    • Set Default Company Name
    • Enable Password Visibility
    • Set Configurable Options Per Product:
      • Product SKU ID
      • Number of Seats
  • Client Area Features

    • View Customer Info
    • Log In To Control Panel
    • Log In To Webmail
  • Supported Google Services

    • Google Workspace Enterprise Plus
    • Google Workspace Business Starter
    • Google Workspace Business Standard
    • Google Workspace Business Plus
    • Google Workspace Enterprise Essentials
    • Google Workspace Enterprise Standard
    • Google Workspace Essentials
    • Google Workspace for Education Standard
    • Google Workspace for Education Standard (Staff)
    • Google Workspace for Education Standard (Extra Student)
    • Google Workspace for Education Plus
    • Google Workspace for Education Plus (Staff)
    • Google Workspace for Education Plus (Extra Student)
    • Google Workspace for Education: Teaching and Learning Upgrade
  • General Info

    • Requires Google Cloud Partner Program / Reseller Account
    • Authentication And API Calls Utilize OAuth 2.0
    • Multi-Language Support
    • Supports PHP 8.3 Back To PHP 8.2
    • Supports WHMCS Themes "Six", "Twenty-One" And "Nexus"
    • Supports WHMCS V9.X Back To WHMCS V8.10
    • Requires ionCube Loader V14 Or Later
    • Easy Module Upgrade To Open Source Version (opens new window)

# Installation and Authentication

This tutorial will show you how to successfully install and authenticate Google Workspace For WHMCS. (opens new window)
We will guide you step by step through the whole installation and authentication process.

  1. Log in to our client area and download the module.
Google Workspace For WHMCS: module download page in the client area with the Download button for version 1.5.0
  1. Extract the package and upload its content into the main WHMCS directory.
    The content of the package to upload should look like this.

    Google Workspace For WHMCS: extracted package files with the includes and modules folders and oauth_callback.php
  2. When you install Google Workspace For WHMCS for the first time, you have to rename the 'license_RENAME.php' file.
    The file is located in 'modules/servers/gSuite/license_RENAME.php'. Rename it from 'license_RENAME.php' to 'license.php'.

    Google Workspace For WHMCS: file manager with licenseRENAME.php being renamed to license.php in the gSuite module folder
  3. In order to configure your license key you have to edit the previously renamed 'license.php' file.
    Enter your license key between the quotation marks as presented on the following screen. You can find your license key in our client area → 'My Products'.

Google Workspace For WHMCS: license.php file open in an editor with the license key entered between quotation marks

# API Configuration

  1. To authenticate the module, configure API access in Google API Console.
    Open Google API Console here: https://console.developers.google.com/apis/dashboard (opens new window)

  2. After logging in, create a new project.

Google Workspace For WHMCS: Google Cloud New Project dialog with a project name entered and the Create button
  1. Go to the 'Enable APIs and Services' section.
Google Workspace For WHMCS: Google Cloud APIs and Services page with the Enable APIs and Services button
  1. Search for 'Google Workspace Reseller API'.
Google Workspace For WHMCS: Google Cloud API Library with the Google Workspace Reseller API card highlighted
  1. Open the API details page and click 'Enable'.
Google Workspace For WHMCS: Google Workspace Reseller API product details page in Google Cloud with the Enable button
  1. In the same way, search for 'Admin SDK API'.
Google Workspace For WHMCS: Google Cloud API Library search results for admin sdk with the Admin SDK API result
  1. Open the API details page and click 'Enable'.
Google Workspace For WHMCS: Admin SDK API details page in Google Cloud with the Enable button
  1. Next, go to the 'OAuth consent screen' section.
Google Workspace For WHMCS: Google Cloud Credentials page with the Create credentials menu and the OAuth client ID
Google Workspace For WHMCS: Google Auth Platform Create OAuth client ID page asking to configure the consent screen
  1. Select the user type.
    For Google Workspace accounts, select 'Internal' if the application will only be used within your organization.

    Google Workspace For WHMCS: Google Auth Platform project configuration with the Internal audience option selected
  2. Provide the required application information, such as the application name and support email address.
    Then proceed through the remaining steps and save the configuration.

    Google Workspace For WHMCS: Google Auth Platform project configuration with the contact information email address step
  3. Under the 'Data Access' section, add the scopes required by the module.
    The module requires the following scopes:

    • admin.directory.user
    • apps.order
    • apps.order.readonly
    • userinfo.profile
    Google Workspace For WHMCS: Google Auth Platform Data access page listing the required sensitive and non-sensitive
  4. Then, switch to the 'Credentials' section and create new credentials.

Google Workspace For WHMCS: Google Cloud Credentials page with the Create credentials menu and the OAuth client ID (2)
  1. Select 'OAuth client ID' and choose 'Web application' as the application type.
    Enter your website URL into the 'Authorized JavaScript origins' field.
    Then, enter the full path to the 'oauth_callback.php' file into the 'Authorized redirect URIs' field.
    Confirm the configuration by clicking 'Create'.

    Google Workspace For WHMCS: Google Auth Platform OAuth client form with Web application type, origin and redirect URI
  2. Your Client ID and Client Secret will now be displayed.
    Copy them and keep them in a safe place, as they will be required during module authentication.

Google Workspace For WHMCS: OAuth client created dialog showing the Client ID and Client secret values

# Product Configuration

  1. In order to create and configure a product, go to 'Setup' → 'Products/Services' → 'Products/Services'.
    Click on 'Create a New Group'.

    Google Workspace For WHMCS: WHMCS admin Products/Services page with the Create a New Group button
  2. Enter your product group name and press 'Save Changes'.

Google Workspace For WHMCS: WHMCS Create Group form with the product group name entered and the Save Changes button
  1. Now, create a new product for your GoogleApps.
    To do so, first click on 'Create a New Product'.

    Google Workspace For WHMCS: WHMCS Products/Services page with the Create a New Product button under the G Suite group
  2. Choose the desired product type and product group from the dropdown menus and enter a new name of your products. Press 'Continue'.

Google Workspace For WHMCS: WHMCS Create a New Product form with product type Other, group, name and the GSuite module
  1. Go to 'Module Settings' of your product and choose 'G Suite' from the 'Module Name' dropdown menu.
    After choosing the module, make sure to click on the 'Save Changes' button.

    Google Workspace For WHMCS: WHMCS product Module Settings tab with GSuite chosen in the Module Name dropdown
  2. Enter your previously obtained 'Client ID' as well as 'Client Secret' and make sure that 'Callback URL' is correct.
    Then, press 'Grant access with Google account'.

    Google Workspace For WHMCS: WHMCS Module Settings with Client ID, Client Secret and the Grant Access To Google Account
  3. If the data you entered is correct, you will be redirected to the page with permission request. Press the 'Allow access' button.

Google Workspace For WHMCS: Google permission request dialog for WHMCS Integration with the Allow access button
  1. That is it. You will be now redirected to your WHMCS and you will see the following screen.
Google Workspace For WHMCS: WHMCS Module Settings tab showing the account is authenticated with Google OAuth 2.0
  1. Now, let us move to 'Custom Fields'. Fields with 'GoogleApps Domain', 'GoogleApps PurchaseOrderID', 'GoogleApps Alternate Email', 'Mailbox Name', 'GSuiteSubscriptionId', 'Client Postcode' and 'GSuiteDealCode' variables are added automatically.
    Note: Since 1.3.0 module version you are free to adjust the 'friendly' name part after |, but remember not to change the first part, which is a variable.
Google Workspace For WHMCS: WHMCS product Custom Fields tab with the automatically added Google Workspace fields

# Configuration and Management

Configuration and management of Google Workspace For WHMCS is very intuitive. Read the below sections to see how easy it is.

# Basic Configuration

Let us begin the process of module configuration by choosing Default Product SKU ID. To start with, simply pick one of the available Google services.
A list of the currently supported addons can be found here (opens new window).

Google Workspace For WHMCS: WHMCS Module Settings with the Default Product SKU ID dropdown listing Google Workspace

Plan Name allows you to select the method of payment. You can choose between:

  • ANNUAL - the annual commitment plan with monthly payments
  • ANNUAL_YEARLY_PAY - the annual commitment plan with yearly payments
  • FLEXIBLE - monthly billing for the number of user accounts used in a particular month
  • TRIAL - the 30-day free trial plan
    Note: Since the 1.1.5 version of Google Workspace For WHMCS module, the ANNUAL plan is equivalent to ANNUAL_MONTHLY_PAY in G Suite API.
Google Workspace For WHMCS: WHMCS Module Settings with the Plan Name dropdown listing TRIAL, ANNUAL and FLEXIBLE

Rennewal Type - choose the method of renewing your plan when the current subscription expires. The available options are:

  • AUTO_RENEW_MONTHLY_PAY - at the end of the interval of annual commitment plan, automatically renew the subscription plan with monthly payments and with the same number of user licenses
  • AUTO_RENEW_YEARLY_PAY - at the end of the interval of annual commitment plan, automatically renew the subscription plan with yearly payments and the same number of user licenses
  • CANCEL - at the end of the interval of annual commitment plan, suspend the customer's account
  • RENEW_CURRENT_USERS_MONTHLY_PAY - at the end of the interval of annual commitment plan, renew the subscription plan with monthly payments but use the total number of current active user licenses
  • RENEW_CURRENT_USERS_YEARLY_PAY - at the end of the interval of annual commitment plan, renew the subscription plan with yearly payments but use the total number of current active user licenses
  • SWITCH_TO_PAY_AS_YOU_GO - at the end of the interval of annual commitment plan, change the annual commitment plan to a flexible plan
Google Workspace For WHMCS: WHMCS Module Settings with the Renewal Type dropdown listing the available renewal options

Action On Terminate - here you can decide whether you want to suspend or cancel customer services upon the termination.
Important!: Please remember that once you choose the 'Cancel' option, the subscription will be deleted immediately. It does not apply to the G Suite subscription.

Google Workspace For WHMCS: WHMCS Module Settings with the Action on Termination dropdown open

Create Admin Account & Mailbox Name - select this option to automatically create an administrator account with a given username for the G Suite domain.

Google Workspace For WHMCS: WHMCS Module Settings with the Mailbox Name and Create Admin Account fields marked

# Configurable Options

In order to automatically generate configurable options, simply press the button marked on the screen.

Google Workspace For WHMCS: WHMCS Module Settings with the Generate Configurable Options button marked

In your WHMCS system press 'Setup' → 'Products/Services' → 'Configurable Options'.
Find the 'GoogleApps' options on the list.

Google Workspace For WHMCS: WHMCS Configurable Option Groups list with the generated GSuite Configuration group

Here you can manage and alter added configurable options.

Google Workspace For WHMCS: WHMCS Manage Group page with the Product SKU ID and Number of Seats configurable options

Provide values for your new option and enter the desired price. Press 'Save Changes'.

Google Workspace For WHMCS: WHMCS configurable option window for Number of Seats with quantity limits, price and Save

In the 'Module Settings' tab of your product you can fill out the fields for ' Default Product SKU ID' and 'Default Number of Seats.
Remember however that these values will be used only if configurable options are NOT generated.

Google Workspace For WHMCS: WHMCS Module Settings with the Default Product SKU ID and Default Number of Seats fields

From now on you can easily and quickly change value of your product. Remember that you can add more configurable options for other values.

# Admin Area

Let us check your new product on the product page in admin area. It should look like on the screen below.

Google Workspace For WHMCS: WHMCS admin client profile of a GSuite product with module commands and Google Workspace

# Client Area

This is how the module will be displayed in the client area. Google Workspace For WHMCS also allows your customers to quickly access Google account services.

Google Workspace For WHMCS: WHMCS client area product details with customer info and control panel and webmail login

# Update of Existing Customers

You can link existing customer accounts by filling in the Custom Fields: 'GoogleApps Domain' and 'GoogleApps PurchaseOrderID'.
After your customers order a new subscription, they should insert their primary Google account domain name in the 'GoogleApps Domain' field.
Then, the new subscription will be added to that account.
If you want to manually create an order for an existing subscription, in addition to the above steps, you need to find 'Purchase Order ID' (usually on the invoice).
Copy the ID and paste it to the 'GoogleApps PurchaseOrderID ' field.
Afterward, do not run the create command but just press the 'Save Changes' button. You can also change the status to 'Active'.

Google Workspace For WHMCS: WHMCS product fields GoogleApps Domain and PurchaseOrderID filled in for an existing

# Tips

  1. The module requires a G Suite Reseller account. To check the current status of your Google Reseller account, navigate to the following site: Google Cloud Partner Portal (opens new window).
    There, you can verify the status and request partner authorization if necessary.

  2. Avoid using localhost and Raw IP during the authorization.

  3. Callback URL is fetched from your WHMCS System URL. You can set it in the 'General Settings' of your system.

  4. To change your API access and OAuth, go to the product configuration page and add &logout=1&revoke=1 to the URL.
    Example:

    http://yourwebsite/whmcs/admin/configproducts.php?action=edit&id=28&logout=1&revoke=1   
    
  5. If you want to better understand the concept of G Suite Reseller API and our module, visit this page (opens new window)

  6. Some API actions such as 'suspend' may be subject to additional restrictions or have different results depending on the selected plan or the number of days elapsed.
    You can learn more about them here. (opens new window)

  7. If you want to set different prices for seats depending on the plan, the only way to do that is to create separate products.
    More info about setting prices can be found here (opens new window).

# Update Instructions

An essential guidance through the process of updating the module is offered here.

Ensure successful completion of the module update by carefully following each step, thereby preventing data loss or any unforeseen issues.
Additionally, you will find a current list of supplementary actions necessary for a smooth update process there.

# Upgrade Guide

Seeking a solution that offers greater flexibility, customization tailored to your precise needs, and unrestricted availability?
There is an option that not only proves to be cost-effective in the long run but also includes prioritized support services, making it a truly valuable investment.

Opt for the Open Source version (opens new window) of your Google Workspace For WHMCS module to unlock these benefits.
Simply click on either the Get Source Code or Upgrade To Lifetime button found on the product's page in our client area to complete the one-step upgrade process, with a dedicated discount already applied.

Follow a comprehensive guide covering the transition process, the advantages it brings, and step-by-step instructions on what to do next after the order has been successfully finalized.

# Common Problems

  1. When you have problems with connection, check whether your SELinux or firewall does not block ports.

  2. It is possible to receive such an error while authenticating our module:

    Error: redirect_uri_mismatch   
    

    If such a case, make sure that URLs provided in your Google account and your WHMCS system are the same.
    Keep in mind that addresses with the prefix 'www' vary from addresses without this prefix.

  3. In case you encounter an error similar to the one below, you most probably disabled the output buffering in the PHP configuration.

    Notice: ob_clean(): failed to delete buffer.   
    

    To solve the problem, please set the 'output_buffering' value to 'On' in the php.ini file.

  4. Due Dates in WHMCS and the Google platform might be out of sync if not set up manually after import, causing the service to appear as active in WHMCS, but suspended on Google's side.
    Solution: Try delaying the suspension by a specific number of days after the billing cycle ends, giving clients a grace period.

    • Adjust the 'Suspend Days' value under 'System Settings' → 'Automation Settings' → 'Automatic Module Functions'.
    • Set the 'Renewal Type' of the product to any status other than 'Cancel', as this will cause the account to be suspended as soon as the billing cycle in Google Workspace ends.