Step 2: Set Up Sub-Accounts

Now that you have tested site deployment in your parent account, this section will teach you how to create sub-accounts and deploy a website to each one.

The video below walks through the instructions for this step.

Set Up a Developer Console App

First, let’s create an app in the Developer Console in your parent account. You will use this to obtain an API key that allows you to programmatically create and manage sub-accounts.

  1. In the left-hand navigation menu of your screen, click on Developer > Developer Console and click Add an App. Name your app whatever you’d like.

    developer console add an app

  2. On the next screen, navigate to the API Credentials tab, and provision read/write access to the following endpoints:

    1. Management API > Agreements
    2. Management API > Configuration API
    3. Management API > Pages API
    4. Management API > Entities
  3. You can obtain your API key by clicking on the eye icon below. Copy this, as you will need it for the next step.

    dev console API key

Prepare the Postman API Client

  1. Now that you’ve created an app and obtained an API key, we can interact with Yext’s APIs. To get started, complete the following steps to set-up Postman on your computer:

    1. Download Postman API client .
    2. Download the following Postman collection and environment .
    3. Follow these instructions to import both the collection and environment into your Postman workspace. This will set up a Postman environment for your account structure. You can import by clicking File > Import.
  2. Populate the following Reseller Environment Template variables with the following values (which should go under the “current value” column):

    1. api_key - API key from the previous step
    2. account_id - The ID of your parent account. By default, this will be the 7-digit number in the URL of your account.

Create Sub-Account

  1. In your Fleet Management Demo collection, open up the Agreements API > Create Sub Account API request. You will use this request to create your first sub-account.

  2. If you navigate to the Body tab, you’ll see a few variables that you’ll need to provide values for. Open up your Reseller Environment Template and populate the following:

    1. sub_account_id - Account ID of the sub-account you will be creating/deploying your site to. For now, set this as “sub-account-1”.
    2. sub_account_name - Name of the sub-account you will be creating/deploying your site to. For now, set this as “Sub Account 1”.
    3. sub_account_country_code - The abbreviation for the country in which the account is primarily established. For now, set this as US, as you will be creating a location entity in the next step with a US-formatted address.
  3. Once you have saved your template variables, navigate back to the request and click send. After a few seconds, your new account should exist!

  4. If you navigate back to your Partner Portal and select Service Status = “All”, you will see your new sub-account in the table!

    partner portal all accounts