제품을 자주 업데이트하세요.

Products 하위 API를 사용하면 기존 제품을 부분적으로 업데이트할 수 있습니다. 이 방법은 가격 및 재고와 같이 자주 변경되는 데이터에 적합합니다. 작은 변경사항이 있을 때 전체 제품을 다시 제출할 필요가 없기 때문입니다. 하지만 모든 제품 데이터가 동기화되도록 제품을 정기적으로 다시 삽입해야 합니다.

이 가이드에서는 productinputs.patch 메서드를 사용하여 제품을 업데이트하는 방법을 설명합니다.

기본 요건

제품을 업데이트하려면 다음이 필요합니다.

특정 제품 세부정보 업데이트

모든 정보를 다시 제출하지 않고 가격이나 재고와 같은 제품의 세부정보를 변경하려면 productInputs.patch 메서드를 사용하세요.

updateMask 매개변수에서 변경할 필드를 지정할 수 있습니다. updateMask는 업데이트할 필드의 쉼표로 구분된 목록입니다. patch 메서드는 다음과 같이 동작합니다.

  • updateMask 및 본문의 필드: 이 필드는 새 값으로 업데이트됩니다.
  • updateMask에 있지만 본문에 없는 필드: 이러한 필드는 제품 입력에서 삭제됩니다.
  • updateMask에 없는 필드: 이러한 필드는 변경되지 않습니다.
  • updateMask 매개변수 생략: 요청 본문에 제공된 모든 필드가 업데이트됩니다. 요청 본문에 제공되지 않은 필드는 제품 입력에서 삭제되지 않습니다.

다음은 업데이트 전 제품 데이터의 예입니다.

{
  "name": "accounts/{ACCOUNT_ID}/productInputs/en~US~SKU12345",
  "product": "accounts/{ACCOUNT_ID}/products/en~US~SKU12345",
  "offerId": "SKU12345",
  "contentLanguage": "en",
  "feedLabel": "US",
  "productAttributes": {
    "title": "Classic Cotton T-Shirt",
    "description": "A comfortable, durable, and stylish t-shirt made from 100% cotton.",
    "link": "https://www.example.com/p/SKU12345",
    "availability": "IN_STOCK",
    "price": {
      "amountMicros": "15990000",
      "currencyCode": "USD"
    },
    "condition": "NEW",
    "gtins": [
      "9780007350896"
    ],
    "imageLink": "https://www.example.com/image/SKU12345"
  }
}

이 예시에서는 제품의 titleavailability를 업데이트하고 imageLink를 삭제합니다. descriptionpriceupdateMask에 없으며 변경되지 않습니다.

PATCH https://merchantapi.googleapis.com/products/v1/accounts/{ACCOUNT_ID}/productInputs/en~US~SKU12345?updateMask=productAttributes.title,productAttributes.availability,productAttributes.imageLink&dataSource=accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}
{
 "productAttributes": {
   "title": "Classic Cotton T-Shirt - New Edition",
   "availability": "OUT_OF_STOCK",
    "description": "A comfortable T-shirt from premium cotton, newer edition.",
    "price": {
      "amountMicros": "9990000",
      "currencyCode": "USD"
    }
 }
}

호출에 성공하면 업데이트된 ProductInput 리소스가 반환됩니다. titleavailability는 업데이트되고 imageLinkupdateMask에 있지만 요청 본문에는 없으므로 삭제됩니다. descriptionpriceupdateMask에 나열되지 않았으므로 변경되지 않습니다.

{
  "name": "accounts/{ACCOUNT_ID}/productInputs/en~US~SKU12345",
  "product": "accounts/{ACCOUNT_ID}/products/en~US~SKU12345",
  "offerId": "SKU12345",
  "contentLanguage": "en",
  "feedLabel": "US",
  "productAttributes": {
    "title": "Classic Cotton T-Shirt - New Edition",
    "description": "A comfortable, durable, and stylish t-shirt made from 100% cotton.",
    "link": "https://www.example.com/p/SKU12345",
    "availability": "OUT_OF_STOCK",
    "price": {
      "amountMicros": "15990000",
      "currencyCode": "USD"
    },
    "condition": "NEW",
    "gtins": [
      "9780007350896"
    ],
  }
}

다음 코드 샘플은 제품을 업데이트하는 방법을 보여줍니다.

자바

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.protobuf.FieldMask;
import com.google.shopping.merchant.datasources.v1.DataSourceName;
import com.google.shopping.merchant.products.v1.Availability;
import com.google.shopping.merchant.products.v1.Condition;
import com.google.shopping.merchant.products.v1.ProductAttributes;
import com.google.shopping.merchant.products.v1.ProductInput;
import com.google.shopping.merchant.products.v1.ProductInputName;
import com.google.shopping.merchant.products.v1.ProductInputsServiceClient;
import com.google.shopping.merchant.products.v1.ProductInputsServiceSettings;
import com.google.shopping.merchant.products.v1.UpdateProductInputRequest;
import com.google.shopping.type.CustomAttribute;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;

/** This class demonstrates how to update a product input */
public class UpdateProductInputSample {

  public static void updateProductInput(Config config, String productId, String dataSourceId)
      throws Exception {

    // Obtains OAuth token based on the user's configuration.
    GoogleCredentials credential = new Authenticator().authenticate();

    // Creates service settings using the credentials retrieved above.
    ProductInputsServiceSettings productInputsServiceSettings =
        ProductInputsServiceSettings.newBuilder()
            .setCredentialsProvider(FixedCredentialsProvider.create(credential))
            .build();

    // Creates product name to identify product.
    String name =
        ProductInputName.newBuilder()
            .setAccount(config.getAccountId().toString())
            .setProductinput(productId)
            .build()
            .toString();

    // Just productAttributes and customAttributes can be updated
    FieldMask fieldMask =
        FieldMask.newBuilder()
            .addPaths("product_attributes.title")
            .addPaths("product_attributes.description")
            .addPaths("product_attributes.link")
            .addPaths("product_attributes.image_link")
            .addPaths("product_attributes.availability")
            .addPaths("product_attributes.condition")
            .addPaths("product_attributes.gtins")
            .addPaths("custom_attributes.mycustomattribute")
            .build();

    // Calls the API and catches and prints any network failures/errors.
    try (ProductInputsServiceClient productInputsServiceClient =
        ProductInputsServiceClient.create(productInputsServiceSettings)) {

      ProductAttributes attributes =
          ProductAttributes.newBuilder()
              .setTitle("A Tale of Two Cities")
              .setDescription("A classic novel about the French Revolution")
              .setLink("https://exampleWebsite.com/tale-of-two-cities.html")
              .setImageLink("https://exampleWebsite.com/tale-of-two-cities.jpg")
              .setAvailability(Availability.IN_STOCK)
              .setCondition(Condition.NEW)
              .addGtins("9780007350896")
              .build();

      // The datasource can be either a primary or supplemental datasource.
      String dataSource =
          DataSourceName.newBuilder()
              .setAccount(config.getAccountId().toString())
              .setDatasource(dataSourceId)
              .build()
              .toString();

      UpdateProductInputRequest request =
          UpdateProductInputRequest.newBuilder()
              .setUpdateMask(fieldMask)
              // You can only update product attributes and custom_attributes
              .setDataSource(dataSource)
              .setProductInput(
                  ProductInput.newBuilder()
                      .setName(name)
                      .setProductAttributes(attributes)
                      .addCustomAttributes(
                          CustomAttribute.newBuilder()
                              .setName("mycustomattribute")
                              .setValue("Example value")
                              .build())
                      .build())
              .build();

      System.out.println("Sending update ProductInput request");
      ProductInput response = productInputsServiceClient.updateProductInput(request);
      System.out.println("Updated ProductInput Name below");
      // The last part of the product name will be the product ID assigned to a product by Google.
      // Product ID has the format `contentLanguage~feedLabel~offerId`
      System.out.println(response.getName());
      System.out.println("Updated Product below");
      System.out.println(response);
    } catch (Exception e) {
      System.out.println(e);
    }
  }

  public static void main(String[] args) throws Exception {
    Config config = Config.load();
    // An ID assigned to a product by Google. In the format
    // contentLanguage~feedLabel~offerId
    String productId = "en~label~sku123"; // Replace with your product ID.

    // Identifies the data source that will own the product input.
    String dataSourceId = "{INSERT_DATASOURCE_ID}"; // Replace with your datasource ID.

    updateProductInput(config, productId, dataSourceId);
  }
}

PHP

use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;
use Google\Shopping\Merchant\Products\V1\Availability;
use Google\Shopping\Merchant\Products\V1\Condition;
use Google\Shopping\Merchant\Products\V1\ProductAttributes;
use Google\Shopping\Merchant\Products\V1\Client\ProductInputsServiceClient;
use Google\Shopping\Merchant\Products\V1\ProductInput;
use Google\Shopping\Merchant\Products\V1\UpdateProductInputRequest;
use Google\Shopping\Type\CustomAttribute;

/**
 * This class demonstrates how to update a product input.
 */
class UpdateProductInputSample
{
    // An ID assigned to a product by Google. In the format
    // contentLanguage~feedLabel~offerId
    // Please ensure this product ID exists for the update to succeed.
    private const PRODUCT_ID = "online~en~label~sku123";

    // Identifies the data source that will own the product input.
    // Please ensure this data source ID exists.
    private const DATASOURCE_ID = "<INSERT_DATASOURCE_ID>";

    /**
     * Helper function to construct the full product input resource name.
     *
     * @param string $accountId The merchant account ID.
     * @param string $productInputId The product input ID (e.g., "online~en~label~sku123").
     * @return string The full product input resource name.
     */
    private static function getProductInputName(string $accountId, string $productInputId): string
    {
        return sprintf("accounts/%s/productInputs/%s", $accountId, $productInputId);
    }

    /**
     * Helper function to construct the full data source resource name.
     *
     * @param string $accountId The merchant account ID.
     * @param string $dataSourceId The data source ID.
     * @return string The full data source resource name.
     */
    private static function getDataSourceName(string $accountId, string $dataSourceId): string
    {
        return sprintf("accounts/%s/dataSources/%s", $accountId, $dataSourceId);
    }

    /**
     * Updates an existing product input in your Merchant Center account.
     *
     * @param array $config The configuration array containing the account ID.
     * @param string $productId The ID of the product input to update.
     * @param string $dataSourceId The ID of the data source.
     */
    public static function updateProductInput(
        array $config,
        string $productId,
        string $dataSourceId
    ): void {
        // Gets the OAuth credentials to make the request.
        $credentials = Authentication::useServiceAccountOrTokenFile();

        // Creates options config containing credentials for the client to use.
        $options = ['credentials' => $credentials];

        // Creates a ProductInputsServiceClient.
        $productInputsServiceClient = new ProductInputsServiceClient($options);

        // Construct the full resource name of the product input to be updated.
        $name = self::getProductInputName($config['accountId'], $productId);

        // Define the FieldMask to specify which fields to update.
        // Only 'attributes' and 'custom_attributes' can be specified in the
        // FieldMask for product input updates.
        $fieldMask = new FieldMask([
            'paths' => [
                "product_attributes.title",
                "product_attributes.description",
                "product_attributes.link",
                "product_attributes.image_link",
                "product_attributes.availability",
                "product_attributes.condition",
                "product_attributes.gtin",
                "custom_attributes.mycustomattribute" // Path for a specific custom attribute
            ]
        ]);

        // Calls the API and handles any network failures or errors.
        try {
            // Define the new attributes for the product.
            $attributes = new ProductAttributes([
                'title' => 'A Tale of Two Cities 3',
                'description' => 'A classic novel about the French Revolution',
                'link' => 'https://exampleWebsite.com/tale-of-two-cities.html',
                'image_link' => 'https://exampleWebsite.com/tale-of-two-cities.jpg',
                'availability' => Availability::IN_STOCK,
                'condition' => Condition::PBNEW,
                'gtins' => ['9780007350896'] // GTIN is a repeated field.
            ]);

            // Construct the full data source name.
            // This specifies the data source context for the update.
            $dataSource = self::getDataSourceName($config['accountId'], $dataSourceId);

            // Create the ProductInput object with the desired updates.
            // The 'name' field must match the product input being updated.
            $productInput = new ProductInput([
                'name' => $name,
                'product_attributes' => $attributes,
                'custom_attributes' => [ // Provide the list of custom attributes.
                    new CustomAttribute([
                        'name' => 'mycustomattribute',
                        'value' => 'Example value'
                    ])
                ]
            ]);

            // Create the UpdateProductInputRequest.
            $request = new UpdateProductInputRequest([
                'update_mask' => $fieldMask,
                'data_source' => $dataSource,
                'product_input' => $productInput
            ]);

            print "Sending update ProductInput request\n";
            // Make the API call to update the product input.
            $response = $productInputsServiceClient->updateProductInput($request);

            print "Updated ProductInput Name below\n";
            // The name of the updated product input.
            // The last part of the product name is the product ID (e.g., contentLanguage~feedLabel~offerId).
            print $response->getName() . "\n";
            print "Updated Product below\n";
            // Print the full updated product input object.
            print_r($response);

        } catch (ApiException $e) {
            printf("ApiException caught: %s\n", $e->getMessage());
        }
    }

    /**
     * Executes the UpdateProductInput sample.
     */
    public function callSample(): void
    {
        $config = Config::generateConfig();
        $productId = self::PRODUCT_ID;
        $dataSourceId = self::DATASOURCE_ID;

        self::updateProductInput($config, $productId, $dataSourceId);
    }
}

// Run the script.
$sample = new UpdateProductInputSample();
$sample->callSample();

Python

"""A module to update a product input."""

from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.protobuf import field_mask_pb2
from google.shopping.merchant_products_v1 import Availability
from google.shopping.merchant_products_v1 import Condition
from google.shopping.merchant_products_v1 import ProductAttributes
from google.shopping.merchant_products_v1 import ProductInput
from google.shopping.merchant_products_v1 import ProductInputsServiceClient
from google.shopping.merchant_products_v1 import UpdateProductInputRequest
from google.shopping.type import CustomAttribute


# Fetches the Merchant Center account ID from the authentication examples.
# This ID is needed to construct resource names for the API.
_ACCOUNT_ID = configuration.Configuration().read_merchant_info()


def update_product_input(account_id: str, product_id: str, data_source_id: str):
  """Updates an existing product input for a specific account.

  Args:
    account_id: The Merchant Center account ID.
    product_id: The ID of the product input to update. This ID is assigned by
      Google and has the format `contentLanguage~feedLabel~offerId`.
    data_source_id: The ID of the data source that owns the product input.
  """

  # Obtains OAuth credentials for authentication.
  credentials = generate_user_credentials.main()

  # Creates a ProductInputsServiceClient instance.
  client = ProductInputsServiceClient(credentials=credentials)

  # Constructs the full resource name for the product input.
  # Format: accounts/{account}/productInputs/{productinput}
  name = f"accounts/{account_id}/productInputs/{product_id}"

  # Defines the FieldMask to specify which fields of the product input
  # are being updated. Only 'attributes' and 'custom_attributes' can be updated.
  field_mask = field_mask_pb2.FieldMask(
      paths=[
          "product_attributes.title",
          "product_attributes.description",
          "product_attributes.link",
          "product_attributes.image_link",
          "product_attributes.availability",
          "product_attributes.condition",
          "product_attributes.gtins",
          "custom_attributes.mycustomattribute",
      ]
  )

  # Prepares the new attribute values for the product.
  attributes = ProductAttributes(
      title="A Tale of Two Cities updated",
      description="A classic novel about the French Revolution",
      link="https://exampleWebsite.com/tale-of-two-cities.html",
      image_link="https://exampleWebsite.com/tale-of-two-cities.jpg",
      availability=Availability.IN_STOCK,
      condition=Condition.NEW,
      gtins=["9780007350896"],  # GTIN is a repeated field.
  )

  # Constructs the full resource name for the data source.
  # The data source can be primary or supplemental.
  # Format: accounts/{account}/dataSources/{datasource}
  data_source = f"accounts/{account_id}/dataSources/{data_source_id}"

  # Prepares the ProductInput object with the updated information.
  product_input_data = ProductInput(
      name=name,
      product_attributes=attributes,
      custom_attributes=[
          CustomAttribute(
              name="mycustomattribute", value="Example value"
          )
      ],
  )

  # Creates the UpdateProductInputRequest.
  request = UpdateProductInputRequest(
      update_mask=field_mask,
      data_source=data_source,
      product_input=product_input_data,
  )

  # Sends the update request to the API.
  try:
    print("Sending update ProductInput request")
    response = client.update_product_input(request=request)
    print("Updated ProductInput Name below")
    # The response includes the name of the updated product input.
    # The last part of the product name is the product ID assigned by Google.
    print(response.name)
    print("Updated Product below")
    print(response)
  except RuntimeError as e:
    # Catches and prints any errors that occur during the API call.
    print(e)


if __name__ == "__main__":
  # The ID of the product to be updated.
  # This ID is assigned by Google and typically follows the format:
  # contentLanguage~feedLabel~offerId
  # Replace with an actual product ID from your Merchant Center account.
  product_id_to_update = "online~en~label~sku123"

  # The ID of the data source that will own the updated product input.
  # Replace with an actual data source ID from your Merchant Center account.
  data_source_id_for_update = "<INSERT_DATA_SOURCE_ID>"

  update_product_input(
      _ACCOUNT_ID, product_id_to_update, data_source_id_for_update
  )

cURL

curl --location --request PATCH 'https://merchantapi.googleapis.com/products/v1/accounts/{ACCOUNT_ID}/productInputs/en~US~SKU12345?updateMask=productAttributes.title,productAttributes.description&dataSource=accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
   "productAttributes": {
       "title": "A Tale of Two Cities",
       "description": "A classic novel about the French Revolution"
   }
}'

맞춤 속성을 사용하여 업데이트

단일 호출에서 표준 속성과 맞춤 속성을 모두 업데이트할 수 있습니다. 맞춤 속성을 업데이트하려면 updateMask에서 이름 앞에 customAttributes를 붙입니다.

이 예에서는 하나의 요청에서 여러 작업을 수행합니다.

  • 표준 title 속성을 직접 업데이트합니다.
  • 기존 맞춤 속성 (myCustomAttrToBeUpdated)을 업데이트합니다.
  • 새 맞춤 속성 (myCustomAttrToBeInserted)을 삽입합니다.
  • 기존 맞춤 속성 (myCustomAttrToBeDeleted)을 삭제합니다.
PATCH https://merchantapi.googleapis.com/products/v1/accounts/{ACCOUNT_ID}/productInputs/en~US~SKU12345?updateMask=productAttributes.title,customAttributes.myCustomAttrToBeInserted,customAttributes.myCustomAttrToBeUpdated,customAttributes.myCustomAttrToBeDeleted&dataSource=accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}
{
  "productAttributes": {
    "title": "ProductTitle Updated"
  },
  "customAttributes": [
    {
      "name": "description",
      "value": "A newly updated description."
    },
    {
      "name": "myCustomAttrToBeUpdated",
      "value": "myCustomAttrToBeUpdated updated value"
    },
    {
      "name": "myCustomAttrToBeInserted",
      "value": "new from update"
    }
  ]
}

요청에 성공하면 지정된 모든 변경사항이 반영된 업데이트된 ProductInput가 반환됩니다.

맞춤 속성 업데이트 이해하기

customAttributes 필드를 사용하여 직접 정의한 속성을 업데이트할 수 있습니다. 이러한 속성은 표준 사양에 매핑되지 않으며 최종 제품에 사용자설정 속성으로 저장됩니다.

제품 업데이트가 처리되는 방식

patch 요청을 보내면 규칙이 적용되기 에 업데이트가 특정 ProductInput 데이터에 적용됩니다. 따라서 제품을 삽입할 때와 업데이트할 때의 동작이 일관됩니다.

업데이트가 처리되는 방식은 다음과 같습니다.

  1. Update Input: patch 요청은 제공된 데이터 소스와 연결된 특정 ProductInput를 수정합니다.

  2. 처리 및 병합: 입력이 업데이트되면 처리가 시작됩니다.

    • 피드 규칙 및 보조 데이터 소스: 제품의 기본 소스에 구성된 규칙은 기본 소스와 보조 소스의 ProductInput를 결합합니다. 이러한 규칙은 속성을 변경하거나 새 속성을 파생시킬 수 있습니다. 규칙 설정에 대해 자세히 알아보려면 https://support.google.com/merchants/answer/14994083 도움말을 참고하세요.
    • 기타 데이터 소스: 기타 소스 (예: 자동 개선)의 데이터도 기본 데이터 소스 입력과 병합됩니다.
    • 검사: 병합된 데이터는 제품 데이터 사양 및 Google 쇼핑 정책에 따라 검사됩니다.
  3. 최종 제품: 이 파이프라인의 결과는 products.get 또는 products.list를 사용하여 반환할 수 있는 최종 처리된 Product 리소스입니다. 또한 판매자 센터에 표시되고 다양한 대상에 표시될 수 있는 제품 버전입니다.

이 다단계 프로세스로 인해 업데이트 요청을 보낸 시점과 products.get로 가져올 수 있는 최종 Product 리소스에 변경사항이 반영되는 시점 사이에 일반적으로 몇 분 정도의 지연이 발생합니다.

예: 기본 입력이 하나인 제품 업데이트

가장 일반적인 사용 사례입니다. 제품이 단일 기본 데이터 소스에 있으며 일부 속성을 업데이트하려고 합니다.

  1. 초기 상태: 제품 en~US~SKU12345이 기본 데이터 소스에 title: "Classic T-Shirt"price: 15.99 USD와 함께 있습니다.
  2. 업데이트 요청: price14.99 USD로 업데이트하고 availabilityout of stock로 설정하기 위해 patch 요청을 보냅니다.
  3. 처리:
    • SKU12345ProductInput이 업데이트됩니다.
  4. 최종 제품: 이제 최종 Producttitle: "Classic T-Shirt", price: 14.99 USD, availability: "out of stock"이 있습니다.

예: 보조 데이터 및 규칙으로 제품 업데이트

이 예에서는 피드 규칙이 업데이트에 영향을 미쳐 일부 변경사항이 적용되고 다른 변경사항은 재정의되는 방식을 보여줍니다.

  1. 초기 상태:
    • 기본 입력: en~US~SKU12345에는 title: "Great T-Shirt"description: "A great short-sleeve t-shirt."이 있습니다.
    • 보조 입력: 동일한 제품이 title: "Awesome T-Shirt"description: "An awesome short-sleeve t-shirt."이 있는 보조 데이터 소스에 항목이 있습니다.
    • 피드 규칙: 보조 데이터 소스에서 title를 가져오도록 규칙이 설정됩니다. description에 대한 규칙이 없습니다.
    • 결과: 최종 처리된 Product에는 title: "Awesome T-Shirt"description: "A great short-sleeve t-shirt."이 있습니다.
  2. 업데이트 요청: patch 요청을 전송하여 기본 데이터 소스를 업데이트하고 title"Fantastic T-Shirt"로, description"A fantastic short-sleeve t-shirt."로 설정합니다.
  3. 처리:
    • 기본 데이터 소스의 ProductInputtitle: "Fantastic T-Shirt"description: "A fantastic short-sleeve t-shirt."를 갖도록 업데이트됩니다.
    • 처리 파이프라인이 실행됩니다.
    • title의 경우 피드 규칙에 따라 보조 데이터 소스 (Awesome T-Shirt)의 값이 우선 적용되어 업데이트가 재정의됩니다.
    • description의 경우 재정의 규칙이 없으므로 기본 입력 (A fantastic short-sleeve t-shirt.)의 업데이트된 값이 사용됩니다.
  4. 최종 제품: 최종 Product의 제품명은 Awesome T-Shirt으로 유지되지만(업데이트가 재정의됨) 설명은 이제 A fantastic short-sleeve t-shirt.입니다 (업데이트가 적용됨).

업데이트와 보조 데이터 소스 중에서 선택

productinputs.patch를 사용하거나 보조 데이터 소스에 데이터를 삽입하여 제품 데이터를 수정할 수 있습니다. 가장 적합한 선택은 데이터 관리 전략에 따라 다릅니다.

예측할 수 없는 결과를 방지하려면 productinputs.patch와 보조 데이터 소스를 모두 사용하여 동일한 제품의 동일한 제품 데이터를 관리하지 않는 것이 좋습니다.

자세한 비교는 다음과 같습니다.

기능 productinputs.patch (업데이트) 보조 데이터 소스
권장 기존 데이터 (예: 가격, 재고)를 빠르고 자주 부분적으로 변경합니다. 논리적으로 분리된 데이터의 레이어링, 시스템별로 다른 속성 관리, 복잡한 규칙 기반 재정의
메커니즘 기존 ProductInput를 수정합니다. 보조 데이터 소스에 별도의 새 ProductInput를 만듭니다.
데이터 세부사항 단일 ProductInput의 특정 필드에서 작동합니다. 보조 소스 내에서 전체 ProductInput에 대해 작동합니다.
지속성 변경사항은 동일한 ProductInput가 전체 insert 또는 다른 patch로 덮어쓰여질 때까지 유지됩니다. 지속성은 피드 규칙에 따라 제어됩니다. 규칙에서 우선순위를 지정하면 기본 데이터를 무기한으로 재정의할 수 있습니다.
규칙 상호작용 기존 데이터 소스 및 ProductInput를 업데이트하므로 피드 규칙 없이 사용할 수 있습니다. 보조 소스를 연결하려면 기본 소스에 규칙을 명시적으로 설정해야 합니다.
데이터 소스 설정 기존 데이터 소스에서 작동합니다. 새 소스가 필요하지 않습니다. 별도의 보조 데이터 소스를 만들고 관리한 후 피드 규칙을 사용하여 연결해야 합니다.