# Upgrade customer’s workspace

# Collect workspace ID on checkout page

In this section, we will show you how to upgrade customers’ workspace after your customer pays directly to you.

One of the benefits of the UChat partner program is that you can charge the price you want and get 100% of the profit.

In order to upgrade your customer's workspace after the payment, you will need to ask for a workspace ID from your customers.

title

They can find the workspace ID in their workspace settings. You can also include where to find the workspace ID at your checkout page if you want.

title

Make sure you ask or make this field mandatory on your checkout pages if you want to use our partner API to upgrade automatically for them.

# Manually upgrade customer’s workspace

After you collect the payment from your customer, you will also have their workspace ID. and then you can go to your white label settings under your custom domain or under the UChat domain.

You can search the workspace ID, and then upgrade customers’ workspace or add extra add-ons.

title

If you haven’t collected workspace ID, you can also search by owner’s email address and workspace name.

title

After you identify the workspace, you can upgrade for them manually. Please note that you need to have enough credit balance in your wallet to upgrade for them.

# Upgrade customer’s workspace automatically

UChat offers a partner APi for our partners. You will find more details here (opens new window).

UChat offer different endpoint for our partners, you can easily:

  • Pull more information about the workspace, your plans options, your addon options.
  • Upgrade or downgrade plans
  • Add or remove add ons
  • Enable or disable auto renew

title

Using this partner API, you can automate the sales, refund or cancellation process under your custom domain.

UChat will offer a training course to show you how to set it up step by step. More details in the below section.

# Get your API keys

In order to use our partner APIs, you will need first to get your API keys.

In your main workspace(the workspace has the white-label settings), you can go to the top right corner of your dashboard, and then click the API keys.

title

And then you can give the API key a name, and then select any of the flow in your main workspace:

title

And then copy the API keys generated. You will need this API key to connect with our partner API.

# Authorize with your partner API

After you get your API keys, you can test with our partner APIs (opens new window).

And click the authorization button, and paste your API keys:

title

Now you have authorized successfully, you can test the endpoints we have for our partners now.

You can find more details in the below section.

# Get all workspaces under your custom domain

You can use the /partner/workspaces to pull all the workspaces under your custom domain.

title

This endpoint will return an array of all the workspace under your custom domain.

# Get all the plans under your custom domain.

UChat offers a business plan by default, which comes with 1 bot, 1000 bot users, and 5 members at $10 per month.

But partners will have the option to set up their own pricing/plans according to our basic plan and also add on pricing.

All the custom plans will show up in this API endpoint.

title

You can get the plan name to use in the change plan endpoints.

# Get all add-on pricings

You can use the /partner/addons endpoint to pull all the add-on pricing under your custom domain.

title

Currently, we have 4 add ons offered by default.

  • Extra bot
  • Extra member
  • Extra 1000 bot user
  • Extra 10,000 bot user

# Upgrade or downgrade plans

You can use /partner/workspace/{workspaceId}/change-plan endpoint to upgrade or downgrade the plan.

You will need the workspace ID to upgrade to any of your paid plans or downgrade to the free plan.

title

Please note, that if you use this API endpoint to downgrade the workspace to the free plan, it will be downgraded to the free plan immediately.

If you want your customer still using it until the end of the current billing cycle. You can use another API endpoint to turn the auto-renew off.

In this case, when the current billing cycle ends, we will not charge them for the next month, after 3 days of overdue notifications, their workspace will be downgraded into a free plan.

# Add extra bots, members or bot users.

UChat offers flexible add ons so that your customers can add an extra bot, member or bot users. You can use below API endpoint to do so: /partner/workspace/{workspaceId}/add-addon

If your clients cancel the add on subscription, you can call the below endpoint to remove the add on they purchased. /partner/workspace/{workspaceId}/remove-addon

# Enable or disable auto-renew

You can easily turn on or off auto-renew manually or through partner API. We will charge only the paid workspace that has auto-renew on.

Also, a free plan workspace under your custom domain won’t incur extra charges.

title

The best practice if the user chooses to cancel the subscription is to turn off the auto-renew.

Then the user still gets access to the paid plan until the end of the billing cycle. If you want to automate the cancellation process, what you need to do is after receiving the subscription cancellation event from your payment gateway, and then identify the user’s workspace ID(you might need to maintain a separate database for the purchase & their workspace ID), and then call the disable auto-renew API endpoint.

If the auto-renew is set to off, your client will still have access to their workspace until the end of the current billing cycle.

If the workspace is not set to auto-renew within 3 days, then the workspace will be downgraded to a free plan.(Free plan won’t add extra charges to partners)

If the auto-renew is off, and you have set up your webhook under your partner API.

title

it will trigger overdue at the end of the billing cycle. We will trigger this event for 3 days, 1 day each time.

You can set up reminders by using the owner's email and workspace information to your customers.

After the 3 days reminder, if the workspace is still not turning on auto-renew, the workspace will downgrade to the free plan. If there are extra bot users(more than 200), the extra bot user will be deleted.

And there is no way to get the bot users back once they are deleted. Please make sure your customer is aware of the sequences.

# What if your customer buys extra add ons during the current billing cycle?

In this case, for example, your customer's current billing is $49/month from 1st May to 30th May, and then your customer buys an extra 1 member on 15th May at $10/month.

So we will calculate the actual cost of the add ons in the first month, and then sync the fixed cost from the 2nd month.

So the first month, the cost for extra 1 member is $10*15/30 = $5 per month. So the cost for the first month will be $49+$5=$54/month.

And the 2nd month's billing will be $49+$10=$59 per month.

Hope this is clear to you.

Last Updated: 6/8/2022, 12:26:00 PM