# Get Started

The Manufacturer Center (MfC) API allows apps to interact directly with the
[Manufacturer Center platform](https://manufacturers.google.com). To help you
get started, we offer [code samples](https://developers.google.com/manufacturers/libraries) in Java and .NET.

This guide will help you create your first application using the Manufacturer
Center API. Before you can start coding, there are a few things you need to do.

## REST Support

Our REST API supports basic CRUD operations for 2 different types of resources:

- [Product](https://developers.google.com/manufacturers/reference/rest/v1/accounts.products) for Brand Owners and Data Partners.
- And [ProductCertification](https://developers.google.com/manufacturers/reference/rest/v1/accounts.languages.productCertifications) for Certification Bodies.

The rest of this documentation will be written mainly for [Product](https://developers.google.com/manufacturers/reference/rest/v1/accounts.products) but the process should be similar for [ProductCertification](https://developers.google.com/manufacturers/reference/rest/v1/accounts.languages.productCertifications).

## Set up your Manufacturer Center Account

1. Create a [Manufacturer Center
   Account](https://support.google.com/manufacturers/answer/7064831).

   > [!NOTE]
   > **Note:** Certification Body users can't create an account this way but need to contact our support directly.

2. Be sure to remember which email you used to create this Manufacturer Center
   account, as you will need that later. In the screenshots, you'll see it
   represented as **manufacturer_user@example.com**.

## Make your first API request (without a line of code!)

1. Head over to the [APIs
   Explorer](https://developers.google.com/manufacturers/reference/rest/v1/accounts.products/list#try-it) in
   our developer documentation for `Accounts.Products.list`.

2. Ensure that the logged in Google account is listed in the 'Users' setting
   in the Settings tab.

   ![](https://developers.google.com/static/manufacturers/images/quickstart/1_usersettings.png)
3. In the APIs Explorer, make sure that **Google OAuth 2.0** is selected in the
   **Authentication** drop-down menu:

   ![](https://developers.google.com/static/manufacturers/images/quickstart/2_oauth2_toggle.png)
4. Enter `accounts/{account_id}`, replacing `{account_id}` with your
   Manufacturer ID from your Manufacturer Center account, into the 'parent'
   field of the form, and click **Execute**.

   ![](https://developers.google.com/static/manufacturers/images/quickstart/4_sandboxresponse.png)

   > [!NOTE]
   > **Note:** If you have not previously granted OAuth2 permission, you will now be asked to authorize the call.

5. You should see a successful response. Congratulations! You've made your
   first Manufacturer Center API request.

6. If you have no products in your Manufacturer Center yet, there won't be any
   in the list. At this point, you can hop to other requests and take a look at
   what they do. Since this is a RESTful API, all requests work similarly. A
   good next step, once you have products, is to try
   [`Accounts.Products.get`](https://developers.google.com/manufacturers/reference/rest/v1/accounts.products/get#try-it).

## Create a Google API Console Project

Requests to the Manufacturer Center API are made through your API Console project. Here we assume you will be accessing your own
Manufacturer Center account, so we suggest using [service
accounts](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) to simplify the
authentication flow. See the [Service
Accounts](https://developers.google.com/manufacturers/how-tos/service-accounts) Guide for details on how to
set up a new service account to use with your Manufacturer Center account.

> [!NOTE]
> **Note:** If you are interested in making calls on behalf of clients with their own Manufacturer Center accounts, then see the [Authorize
> Requests](https://developers.google.com/manufacturers/how-tos/authorizing) guide.

## Your first authorized API request using Java

Now that you've set up a service account and added the service account ID to
your Manufacturer Center account, you can access your account using the
available [Samples code](https://developers.google.com/manufacturers/libraries). This guide uses the Java
samples to demonstrate using the API.

1. Install [Apache Maven](https://maven.apache.org/), if you haven't already.

2. Download our [Shopping
   samples](https://github.com/googleads/googleads-shopping-samples/) from our GitHub
   page.

3. From within the `java` subdirectory, build the Java samples:

       $ mvn compile

4. Now run the `ProductsListSample` (the example for [ProductCertification](https://developers.google.com/manufacturers/reference/rest/v1/accounts.languages.productCertifications) would be `ListProductCertificationsSample`) code:

       $ mvn exec:java -Dexec.mainClass="shopping.manufacturers.v1.samples.products.ProductsListSample"

5. If you haven't followed the configuration directions in the README
   accompanying the source files, you will get an error that no sample
   configuration could be found. Follow the directions in the README to create
   the configuration directory and to populate it with the appropriate
   information. The JSON file you downloaded while setting up your service
   account should be placed in that directory with the filename
   `service-account.json`. Remember to tell the code where your file is by
   setting the following environment variable.

       export GOOGLE_APPLICATION_CREDENTIALS=<Path to your JSON credentials file>

6. Now that you have set up the samples configuration, run the
   `ProductsListSample` code again.

       $ mvn exec:java -Dexec.mainClass="shopping.manufacturers.v1.samples.products.ProductsListSample"

7. At this point, the Java program should finish executing, and print out
   either a list of products that it found, or a message that there were no
   products in your account. If you get an error such as "User cannot access
   account 1234567890", it's most likely because you have not set up the
   service account user as an authorized user in Manufacturer Center. From the
   API's standpoint, the API Console project sent a request on
   behalf of a user who was not on the list of authorized Manufacturer Center
   administrators, so it would, of course, reject that request.

8. You can experiment with running `ProductsListSample` as many times as you
   want, since it is a read-only request. You can also explore the other
   samples that we've created for both Java and .NET.