Method: projects.locations.catalogs.branches.products.import

Bulk import of multiple Products.

Request processing may be synchronous. Non-existing items are created.

Note that it is possible for a subset of the Products to be successfully updated.

HTTP request

POST https://retail.googleapis.com/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:import

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. projects/1234/locations/global/catalogs/default_catalog/branches/default_branch

If no updateMask is specified, requires products.create permission. If updateMask is specified, requires products.update permission.

Request body

The request body contains data with the following structure:

JSON representation
{
  "requestId": string,
  "inputConfig": {
    object (ProductInputConfig)
  },
  "errorsConfig": {
    object (ImportErrorsConfig)
  },
  "updateMask": string,
  "reconciliationMode": enum (ReconciliationMode),
  "notificationPubsubTopic": string
}
Fields
requestId
(deprecated)

string

Deprecated. This field has no effect.

inputConfig

object (ProductInputConfig)

Required. The desired input location of the data.

errorsConfig

object (ImportErrorsConfig)

The desired location of errors incurred during the Import.

updateMask

string (FieldMask format)

Indicates which fields in the provided imported products to update. If not set, all fields are updated. If provided, only the existing product fields are updated. Missing products will not be created.

This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

reconciliationMode

enum (ReconciliationMode)

The mode of reconciliation between existing products and the products to be imported. Defaults to ReconciliationMode.INCREMENTAL.

notificationPubsubTopic

string

Full Pub/Sub topic name for receiving notification. If this field is set, when the import is finished, a notification is sent to specified Pub/Sub topic. The message data is JSON string of a Operation.

Format of the Pub/Sub topic is projects/{project}/topics/{topic}. It has to be within the same project as ImportProductsRequest.parent. Make sure that both cloud-retail-customer-data-access@system.gserviceaccount.com and service-<project number>@gcp-sa-retail.iam.gserviceaccount.com have the pubsub.topics.publish IAM permission on the topic.

Only supported when ImportProductsRequest.reconciliation_mode is set to FULL.

Response body

If successful, the response body contains an instance of Operation.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • retail.products.import

For more information, see the IAM documentation.

ProductInputConfig

The input config source for products.

JSON representation
{

  // Union field source can be only one of the following:
  "productInlineSource": {
    object (ProductInlineSource)
  },
  "gcsSource": {
    object (GcsSource)
  },
  "bigQuerySource": {
    object (BigQuerySource)
  }
  // End of list of possible types for union field source.
}
Fields
Union field source. Required. The source of the input. source can be only one of the following:
productInlineSource

object (ProductInlineSource)

The Inline source for the input content for products.

gcsSource

object (GcsSource)

Google Cloud Storage location for the input content.

bigQuerySource

object (BigQuerySource)

BigQuery input source.

ProductInlineSource

The inline source for the input config for products.import method.

JSON representation
{
  "products": [
    {
      object (Product)
    }
  ]
}
Fields
products[]

object (Product)

Required. A list of products to update/create. Each product must have a valid Product.id. Recommended max of 100 items.

ReconciliationMode

Indicates how imported products are reconciled with the existing products created or imported before.

Enums
RECONCILIATION_MODE_UNSPECIFIED Defaults to INCREMENTAL.
INCREMENTAL Inserts new products or updates existing products.
FULL Calculates diff and replaces the entire product dataset. Existing products may be deleted if they are not present in the source location.