Performing basic operations with the API is a good way to start using it.

## Prerequisites

Before you start, complete the following:

- Make sure that you have a valid CSS Center account.
- Register an API developer.
- Verify the correctness of your permissions setup.
- Verify that you have enabled CSS API.
- Verify that you have installed the client libraries for your environment.

For more information, see
[Quickstart](https://developers.google.com/comparison-shopping-services/api/guides/quickstart).

## Enable the CSS API

Register as a developer to use the CSS API, you must link your CSS Center
account and your Google Cloud project using the Developer Registration method,
as follows:

Link CSS Center and your Google Cloud project: The link is established
automatically, as the caller has access to the Google Cloud project based on the
Access token or API key, and is an authorized user of the CSS Center account.

## Register an API developer

Add an API developer user to the CSS Center account: If a user already exists
they will just be granted the new "API Developer" access type. In case of a new
user, they receive a CSS Center email invite.

After registration you can view the Registration status using
`GetDeveloperRegistration` or unregister using `UnregisterGCP`. You can use the
following registration call:

    POST https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/developerRegistration:registerGcp

    {
          developer_email:"example-email@example.com"
    }

After the request runs successfully, expect the response:

    {
          "developerRegistration":
    {
                "name": "accounts/ACCOUNT_ID/developerRegistration",
               "gcpIds": [
                "GOOGLE_CLOUD_PROJECT_ID"
            ]
        }
    }

## CSS products

Similar to the [Products](https://developers.google.com/merchant/api/guides/products/overview) sub-API, CSS
API distinguishes between `CssProductInput` and `ListCssProduct`. Insert a
product with
[`InsertCssProductInput`](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.CssProductInputsService.InsertCssProductInput).

Once our internal systems have processed the product (this can take a few
minutes), retrieve it with
[`ListCssProducts`](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.CssProductsService.ListCssProducts).

Identify your products using `raw_provided_id`. We recommend that you use an
identifier you are already using in your own system. Alternately, common methods
to create one include the use of one of the following:

- Globally Unique Identifiers (GUIDs)
- Universally Unique Identifiers (UUIDs)
- Concatenated unique product attributes (for example, brand_model_color_size)

For more information, see [Insert/List/Update/Delete a
product](https://developers.google.com/comparison-shopping-services/api/guides/best_practices#insertlistupdatedelete_a_product).

### Basic operations

Here are a few basic requests you can try.

1. Insert a test product using
   [`InsertCssProductInput`](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.CssProductInputsService.InsertCssProductInput).
   For help on the attributes to send, review this [sample
   code](https://developers.google.com/comparison-shopping-services/api/code-samples/cssproducts/insert-css-product-input).

2. List all your products using
   [`ListCssProducts`](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.CssProductsService.ListCssProducts).
   Note that there is a small processing delay between inserting a product and
   its appearance for listing. If you don't see one right away, try again after
   a few seconds.

3. Update a single product using [`UpdateCssProductInput`](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.CssProductInputsService.UpdateCssProductInput)
   using your `cssproductinput.name`. You need to send only the attributes
   required to be updated. For an example, see the [sample
   code](https://developers.google.com/comparison-shopping-services/api/code-samples/cssproducts/update-css-product-input).

4. Delete the test product using
   [`DeleteCssProductInpu`](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.CssProductInputsService.DeleteCssProductInput),
   supplying the `raw_provided_id`.

### Limitations

Inserting or deleting an individual product can be slow. To improve performance,
[Use Async to improve
performance](https://developers.google.com/comparison-shopping-services/api/guides/best_practices#use_async_to_improve_performance).
This enables calling the API in parallel.

### List and label your accounts

Label Management in CSS API lets you programmatically organize your client
Merchant Center accounts using custom tags. This feature helps you efficiently
categorize clients (for example, by type or strategy), enabling better
organization and streamlined operations. You can use the API to perform the
following functions on labels:

- [CreateAccountLabel](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.AccountLabelsService.CreateAccountLabel)
- [ListAccountLabels](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.AccountLabelsService.ListAccountLabels)
- [DeleteAccountLabel](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.AccountLabelsService.DeleteAccountLabel)
- [assign to accounts](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.AccountsLabelsService.CreateAccountLabel)
- [unassign from accounts](https://developers.google.com/comparison-shopping-services/api/reference/rpc/google.shopping.css.v1#google.shopping.css.v1.AccountsLabelsService.DeleteAccountLabel)