Omnichannel সেটিংস ম্যানেজ করা

Omnichannel Settings API হল আপনার স্থানীয় ইনভেনটরি বিজ্ঞাপন (LIA) এবং ফ্রি স্থানীয় তালিকা (FLL) প্রোগ্রাম কনফিগার করার এন্ট্রি পয়েন্ট।

প্রোগ্রাম্যাটিক্যালি এটি ব্যবহার করুন

  • সর্বত্রগামী চ্যানেল সেটিংস ম্যানেজ (তৈরি ও আপডেট) করা
  • Omnichannel সেটিংস ফেচ (পান ও তালিকাভুক্ত করুন) করুন
  • উপযুক্ত মার্চেন্টদের জন্য ইনভেনটরি যাচাইকরণের অনুরোধ করা

আরও তথ্যের জন্য, স্থানীয় ইনভেনটরি বিজ্ঞাপন ও ফ্রি স্থানীয় তালিকার ওভারভিউ দেখুন।

পূর্বশর্ত

আপনার কাছে থাকতে হবে

  • একটি Merchant Center অ্যাকাউন্ট

  • একটি Business Profile. আপনার অ্যাকাউন্ট না থাকলে, আপনি একটি তৈরি করতে পারবেন। Business Profile-এর জন্য সাইন-আপ করুন লিঙ্কটি দেখুন।

  • আপনার Business Profile এবং Merchant Center অ্যাকাউন্টের মধ্যে লিঙ্ক। লিঙ্ক তৈরি করতে, আপনি Merchant Center ইউজার ইন্টারফেস বা Merchant API ব্যবহার করতে পারেন (Google Business Profile লিঙ্ক করুন দেখুন)।

সর্বত্রগামী চ্যানেল সেটিং তৈরি করুন

আপনি omnichannelSettings.create পদ্ধতি ব্যবহার করে সর্বত্রগামী চ্যানেল সেটিং তৈরি করতে পারবেন। তৈরি করার পদ্ধতিটি ইনপুট হিসেবে একটি omnichannelSetting রিসোর্স নেয় এবং সফল হলে, তৈরি করা অমনিচ্যানেল সেটিং রিটার্ন করে।

তৈরি করার সময়, আপনাকে অবশ্যই regionCode এবং LsfType দুটিই পূরণ করতে হবে:

  • OmnichannelSetting প্রতিটি দেশের ভিত্তিতে করা হয়। RegionCode টার্গেট করা দেশ নির্ধারণ করে। তৈরি করা হয়ে গেলে, আপনি এটি পরিবর্তন করতে পারবেন না। RegionCode-কে কমন লোকাল ডেটা রিপোজিটরি (CLDR) প্রোজেক্টের মাধ্যমে নির্ধারিত নামকরণের নিয়ম মেনে চলতে হবে।
  • আপনার প্রোডাক্ট পৃষ্ঠার ভিত্তিতে LsfType হয়। আরও জানতে, LsfType দেখুন।

আরও বিস্তারিত জানতে, আপনার স্থানীয় ইনভেনটরি বিজ্ঞাপনের জন্য প্রোডাক্ট পৃষ্ঠা দেখার অভিজ্ঞতা পরিবর্তন করুন দেখুন।

তৈরি করার সময় আপনাকে সব ফিল্ড পূরণ করতে হবে না, তবে পরে সেগুলি কনফিগার করতে পারবেন। আগে থেকে থাকা omnichannelSetting আপডেট করতে, সর্বত্রগামী চ্যানেল সেটিং আপডেট করুন দেখুন।

আপনি MHLSF_BASIC বেছে নিয়ে inStock-এ এনরোল করলে, অনুরোধের একটি নমুনা এখানে দেওয়া হল:

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

{
  "regionCode": "{REGION_CODE}",
  "lsfType: "MHLSF_BASIC",
  "inStock": {
      "uri": {URI}"
  }
}

নিম্নলিখিতগুলি পরিবর্তন করুন:

  • {ACCOUNT_ID}: আপনার Merchant Center অ্যাকাউন্টের অনন্য শনাক্তকারী
  • {REGION_CODE}: CLDR দ্বারা সংজ্ঞায়িত অঞ্চল কোড
  • {URI}: প্রদত্ত রিভিউয়ের জন্য ব্যবহৃত একটি সঠিক URI। অনুপযুক্ত URI-এর কারণে অনুমোদন নাও হতে পারে।

অনুরোধটি সফলভাবে রান করার পরে, আপনি নিম্নলিখিত উত্তর দেখতে পাবেন:

{
  "name": "accounts/{ACCOUNT_ID}/omnichannelSettings/{omnichannel_setting}",
  "regionCode": "{REGION_CODE}",
  "lsfType: "MHLSF_BASIC",
  "inStock": {
      "uri": "{URI}",
      "state": "RUNNING"
  }
}

omnichannelSetting ফিল্ড ব্যবহার করে বিভিন্ন LIA/FLL ফিচার এনরোল করলে ম্যানুয়াল রিভিউ ট্রিগার হয় যার জন্য সাধারণত কয়েক ঘণ্টা থেকে কয়েক দিন সময় লাগে। আমরা সাজেস্ট করি যে অনুপযুক্ত ডেটার কারণে অপ্রয়োজনীয় অপেক্ষার সময় এড়াতে আপনার ইনপুট ডবল-চেক করুন।

আপনার নতুন তৈরি করা সর্বত্রগামী চ্যানেল সেটিং দেখতে বা পর্যালোচনার স্ট্যাটাস চেক করতে, accounts.omnichannelSettings.get বা accounts.omnichannelSettings.list ব্যবহার করুন, দেশ উল্লেখ করে।

লোকাল স্টোর ফ্রন্ট (LSF)-এর ধরন

আপনি যে প্রোডাক্ট পৃষ্ঠা ব্যবহার করার পরিকল্পনা করছেন তার উপর ভিত্তি করে, একটি LsfType বেছে নিন:

প্রোডাক্ট পৃষ্ঠার ধরন LsfType Enum ভ্যালু
স্টোর-মধ্যস্থ প্রোডাক্টের উপলভ্যতার তথ্যের পৃষ্ঠা মার্চেন্টের হোস্ট করা স্থানীয় স্টোরফ্রন্ট বেসিক MHLSF_BASIC
উপলভ্যতা এবং দাম সহ নির্দিষ্ট স্টোরের প্রোডাক্টের পৃষ্ঠা মার্চেন্টের হোস্ট করা স্থানীয় স্টোরফ্রন্ট (সম্পূর্ণ) MHLSF_FULL
স্টোর-মধ্যস্থ প্রোডাক্টের উপলভ্যতার তথ্য ছাড়াই প্রোডাক্টের পৃষ্ঠা Google-এর হোস্ট করা স্থানীয় স্টোর ফ্রন্ট (GHLSF) GHLSF

আপনি যদি মার্চেন্ট-হোস্ট করা স্থানীয় স্টোরফ্রন্টের ধরন বেছে নেন, তাহলে আপনাকে inStock বা pickup-এর মধ্যে অন্তত একটির জন্য URI ফিল্ড পূরণ করতে হবে।

InStock

আপনার প্রোডাক্ট পৃষ্ঠা সম্পর্কে আরও তথ্য প্রদান করতে InStock ব্যবহার করতে পারবেন।

আপনি যদি মার্চেন্ট-হোস্ট করা LSF-এর ধরন বেছে নেন এবং InStock-এ URI ফিল্ড নির্দিষ্ট করেন, তাহলে আপনি ইন-স্টক উপলভ্যতা সহ প্রোডাক্ট পরিবেশন করার ইচ্ছা প্রকাশ করছেন। আমরা প্রদান করা URI-এর ভিত্তিতে পর্যালোচনা শুরু করব।

আপনি GHLSF ধরন বেছে নিলে, আপনাকে অনুরোধে একটি খালি InStock ফিল্ড দিতে হবে। মার্চেন্ট-হোস্ট করা LSF ধরনের থেকে আলাদা, অনবোর্ডিং সম্পূর্ণ করতে, আপনাকে ইনভেনটরি যাচাইকরণ প্রসেস সম্পূর্ণ করতে হবে।

এই কোডের স্যাম্পেল GHLSF সহ একটি omnichannelSetting তৈরি করে:

Java

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1.AccountName;
import com.google.shopping.merchant.accounts.v1.CreateOmnichannelSettingRequest;
import com.google.shopping.merchant.accounts.v1.InStock;
import com.google.shopping.merchant.accounts.v1.OmnichannelSetting;
import com.google.shopping.merchant.accounts.v1.OmnichannelSetting.LsfType;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingsServiceSettings;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;

/**
 * This class demonstrates how to create an omnichannel setting for a given Merchant Center account
 * in a given country
 */
public class CreateOmnichannelSettingSample {

  public static void createOmnichannelSetting(Config config, String regionCode) throws Exception {

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

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

    // Calls the API and catches and prints any network failures/errors.
    try (OmnichannelSettingsServiceClient omnichannelSettingsServiceClient =
        OmnichannelSettingsServiceClient.create(omnichannelSettingsServiceSettings)) {
      String accountId = config.getAccountId().toString();
      String parent = AccountName.newBuilder().setAccount(accountId).build().toString();

      // Creates an omnichannel setting with GHLSF type in the given country.
      CreateOmnichannelSettingRequest request =
          CreateOmnichannelSettingRequest.newBuilder()
              .setParent(parent)
              .setOmnichannelSetting(
                  OmnichannelSetting.newBuilder()
                      .setRegionCode(regionCode)
                      .setLsfType(LsfType.GHLSF)
                      .setInStock(InStock.getDefaultInstance())
                      .build())
              .build();

      System.out.println("Sending create omnichannel setting request:");
      OmnichannelSetting response =
          omnichannelSettingsServiceClient.createOmnichannelSetting(request);

      System.out.println("Inserted Omnichannel Setting below:");
      System.out.println(response);
    } catch (Exception e) {
      System.out.println("An error has occured: ");
      System.out.println(e);
    }
  }

  public static void main(String[] args) throws Exception {
    Config config = Config.load();

    // The country which you're targeting at.
    String regionCode = "{REGION_CODE}";

    createOmnichannelSetting(config, regionCode);
  }
}

PHP

use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1\Client\OmnichannelSettingsServiceClient;
use Google\Shopping\Merchant\Accounts\V1\CreateOmnichannelSettingRequest;
use Google\Shopping\Merchant\Accounts\V1\InStock;
use Google\Shopping\Merchant\Accounts\V1\OmnichannelSetting;
use Google\Shopping\Merchant\Accounts\V1\OmnichannelSetting\LsfType;

/**
 * This class demonstrates how to create an omnichannel setting for a given
 * Merchant Center account in a given country.
 */
class CreateOmnichannelSetting
{
    /**
     * Helper to create the parent string.
     *
     * @param string $accountId The merchant account ID.
     * @return string The parent string in the format `accounts/{account}`.
     */
    private static function getParent(string $accountId): string
    {
        return sprintf('accounts/%s', $accountId);
    }

    /**
     * Creates an omnichannel setting for a given Merchant Center account.
     *
     * @param array $config The configuration file for authentication.
     * @param string $regionCode The country for the omnichannel setting.
     */
    public static function createOmnichannelSettingSample(
        array $config,
        string $regionCode
    ): void {
        // Obtains OAuth credentials from the configuration file.
        $credentials = Authentication::useServiceAccountOrTokenFile();

        // Creates a client.
        $omnichannelSettingsServiceClient = new OmnichannelSettingsServiceClient([
            'credentials' => $credentials
        ]);

        // Constructs the parent resource name.
        $parent = self::getParent($config['accountId']);

        // Creates the omnichannel setting with GHLSF type in the given country.
        $omnichannelSetting = new OmnichannelSetting([
            'region_code' => $regionCode,
            'lsf_type' => LsfType::GHLSF,
            'in_stock' => new InStock()
        ]);

        // Creates the request.
        $request = new CreateOmnichannelSettingRequest([
            'parent' => $parent,
            'omnichannel_setting' => $omnichannelSetting
        ]);

        // Calls the API and prints the response.
        try {
            printf("Sending create omnichannel setting request:%s", PHP_EOL);
            $response = $omnichannelSettingsServiceClient->createOmnichannelSetting($request);
            printf("Inserted Omnichannel Setting below:%s", PHP_EOL);
            print $response->serializeToJsonString(true) . PHP_EOL;
        } catch (ApiException $e) {
            printf("An error has occured: %s", $e->getMessage());
        }
    }

    /**
     * Executes the sample.
     */
    public function callSample(): void
    {
        $config = Config::generateConfig();
        // The country which you're targeting.
        $regionCode = '{REGION_CODE}';
        self::createOmnichannelSettingSample($config, $regionCode);
    }
}

// Runs the script.
$sample = new CreateOmnichannelSetting();
$sample->callSample();

Python

from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_accounts_v1 import CreateOmnichannelSettingRequest
from google.shopping.merchant_accounts_v1 import InStock
from google.shopping.merchant_accounts_v1 import OmnichannelSetting
from google.shopping.merchant_accounts_v1 import OmnichannelSettingsServiceClient


def create_omnichannel_setting(account_id: str, region_code: str) -> None:
  """Creates an omnichannel setting for a given Merchant Center account.

  Args:
      account_id: The ID of the Merchant Center account.
      region_code: The country for which you're creating the setting.
  """
  # Gets OAuth Credentials.
  credentials = generate_user_credentials.main()

  # Creates a client.
  client = OmnichannelSettingsServiceClient(credentials=credentials)

  # The parent account under which to create the setting.
  parent = f"accounts/{account_id}"

  # Creates an omnichannel setting with GHLSF type in the given country.
  omnichannel_setting = OmnichannelSetting()
  omnichannel_setting.region_code = region_code
  omnichannel_setting.lsf_type = OmnichannelSetting.LsfType.GHLSF
  omnichannel_setting.in_stock = InStock()

  # Creates the request.
  request = CreateOmnichannelSettingRequest(
      parent=parent, omnichannel_setting=omnichannel_setting
  )

  # Makes the request and catches and prints any error messages.
  try:
    print("Sending create omnichannel setting request:")
    response = client.create_omnichannel_setting(request=request)
    print("Inserted Omnichannel Setting below:")
    print(response)
  except RuntimeError as e:
    print("An error has occured: ")
    print(e)


if __name__ == "__main__":
  # The ID of the account to get the omnichannel settings for.
  _ACCOUNT = configuration.Configuration().read_merchant_info()

  # The country which you're targeting.
  _REGION_CODE = "{REGION_CODE}"

  create_omnichannel_setting(_ACCOUNT, _REGION_CODE)

পিক-আপ

স্টোরে উপলভ্যতার পাশাপাশি, আপনি পিক-আপ ফিচারের মাধ্যমে স্টোরে উপলভ্য প্রোডাক্টের তথ্য আরও উন্নত করতে পারেন। এটি শুধুমাত্র মার্চেন্ট-হোস্ট করা LSF ধরনের জন্য উপযুক্ত।

কোনও প্রোডাক্ট পিক-আপের জন্য চিহ্নিত করা হলে, তার অর্থ হল গ্রাহক সেটি অনলাইনে কিনতে এবং স্টোর থেকে পিক-আপ করতে পারবেন। Pickup ফিল্ড সেট করার মাধ্যমে, আপনি পিক-আপ SLA সহ প্রোডাক্ট পরিষেবা দেওয়ার ইচ্ছা প্রকাশ করছেন। প্রদান করা URI-এর ভিত্তিতে আমরা পর্যালোচনা শুরু করব।

এখানে একটি স্যাম্পেল অনুরোধ দেওয়া হল যা Pickup-এর সাথে omnichannel সেটিং তৈরি করে:

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

{
  "regionCode": "{REGION_CODE}",
  "lsfType: "MHLSF_BASIC",
  "pickup": {
     "uri: "{URI}"
  }
}

অর্ডার করার জন্য দেখানো হচ্ছে

অর্ডার করার জন্য ডিসপ্লেতে আছে ফিচারের মাধ্যমে, আপনি এমন প্রোডাক্ট দেখাতে পারবেন যা আপনার ফিজিক্যাল স্টোরে ডিসপ্লে করা আছে, কিন্তু তৎক্ষণাৎ কেনার জন্য উপলভ্য নেই। যেমন, বড় আসবাবপত্র:

  • Google-এ একই ধরনের প্রোডাক্ট খুঁজছেন এমন গ্রাহকরা সার্চ ফলাফলে "স্টোরে উপলভ্য" অ্যানোটেশন সহ এইসব বিজ্ঞাপন দেখতে পাবেন।
  • Google Search ফলাফল পৃষ্ঠায় যেসব গ্রাহক স্টোর ব্রাউজ করছেন তারা এইসব প্রোডাক্ট "অর্ডার করার জন্য উপলভ্য" হিসেবে চিহ্নিত করা আছে বলে দেখতে পাবেন।

আইটেমটি দেখার জন্য তারা আপনার স্থানীয় ইনভেনটরি বিজ্ঞাপন বা ফ্রি স্থানীয় তালিকা বেছে নিতে পারেন। আইটেমটি কেনার জন্য, তারা আপনার ফিজিক্যাল স্টোরে যেতে পারেন, আইটেমটি দেখতে পারেন এবং তারপরে তাদের কাছে বা আপনার স্টোরে পিক-আপের জন্য শিপ করার অর্ডার দিতে পারেন।

সম্পর্কে (জার্মানি, অস্ট্রিয়া ও সুইজারল্যান্ড)

আপনি অস্ট্রিয়া ও জার্মানিতে পরিষেবা প্রদান করলে এবং GHLSF বেছে নিলে, আপনাকে অবশ্যই একটি সম্পর্কে পৃষ্ঠা জমা দিতে হবে।

আপনি সুইজারল্যান্ডে বিজ্ঞাপন দেখালে, আপনাকে অবশ্যই একটি "সম্পর্কে" পৃষ্ঠা জমা দিতে হবে, তা সে LsfType যাই হোক না কেন।

'সম্পর্কে' পৃষ্ঠার URL যাচাই না করা পর্যন্ত, GHLSF মার্চেন্ট Google-এর কাছে ম্যানুয়ালি ইনভেনটরি যাচাইকরণের অনুরোধ করতে পারবেন না।

এই তিনটি দেশের সব মার্চেন্টের জন্য, আপনার 'সম্পর্কে' পৃষ্ঠা অনুমোদন না পাওয়া পর্যন্ত পরিষেবাটি FLL/LIA ফিচার চালু করে না।

ইনভেনটরি যাচাইকরণ

ইনভেনটরি যাচাইকরণ শুধুমাত্র GHLSF মার্চেন্টদের জন্য প্রয়োজন। এটি MHLSF ধরনের ক্ষেত্রে কাজ করে না।

প্রোডাক্ট ডেটা এবং ইনভেনটরি ডেটা যোগ করার আগে বা পরে (accounts.products.localInventories.insert বা Merchant Center ইউজার ইন্টারফেস ব্যবহার করে), আপনাকে অবশ্যই আপনার যোগাযোগের তথ্য যাচাই করতে হবে। create বা update পদ্ধতি ব্যবহার করে ইনভেনটরি যাচাইকরণের জন্য পরিচিতি (নাম ও ইমেল আইডি) প্রদান করুন। Google-এর তরফ থেকে পরিচিতিকে একটি ইমেল পাঠানো হবে এবং মেসেজে থাকা একটি বোতামে ক্লিক করে তিনি নিজের স্ট্যাটাস যাচাই করতে পারবেন।

এটি সম্পূর্ণ করার পরে, আপনি ইনভেনটরি যাচাইকরণের অনুরোধ করতে পারবেন। আরও তথ্যের জন্য ইনভেনটরি যাচাইকরণ সম্পর্কে দেখুন।

যাচাইকরণ প্রক্রিয়া চলাকালীন বা omnichannelSetting.update ব্যবহার করে যাচাইকরণের পরে আপনি নিজের পরিচিতি পরিবর্তন করতে পারবেন।

এই প্রসেস সম্পূর্ণ হওয়ার পরে, Google প্রদত্ত তথ্যের নির্ভুলতা যাচাই করে।

সর্বত্রগামী চ্যানেল সেটিং পান

কোনও নির্দিষ্ট দেশে omnichannelSetting কনফিগারেশন ফিরিয়ে আনতে অথবা আপনার রিভিউয়ের বর্তমান স্ট্যাটাস চেক করতে, omnichannelSettings.get পদ্ধতি ব্যবহার করুন।

এখানে একটি স্যাম্পেল অনুরোধ দেওয়া হল:

GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/omnichannelSettings/{OMNICHANNEL_SETTING}

নিম্নলিখিতগুলি পরিবর্তন করুন:

  • {ACCOUNT_ID}: আপনার Merchant Center অ্যাকাউন্টের অনন্য শনাক্তকারী
  • {OMNICHANNEL_SETTING}: আপনার টার্গেট করা দেশের অঞ্চল কোড

ACTIVE স্ট্যাটাস থেকে বোঝা যায় যে রিভিউটি অনুমোদন পেয়েছে।

স্ট্যাটাস FAILED হলে, সমস্যার সমাধান করুন এবং omnichannelSetting.update-এ কল করে নতুন পর্যালোচনার ট্রিগার করুন।

শুধু-পড়া-যায় এমন LFP ফিল্ড আপনার স্থানীয় ফিডের পার্টনারশিপ স্ট্যাটাস দেখায়। পার্টনারশিপের সাথে লিঙ্ক করতে, lfpProviders.linkLfpProvider ব্যবহার করুন।

স্ট্যাটাস চেক করা এবং তার অর্থ সম্পর্কে আরও জানতে, সর্বত্রগামী চ্যানেল সেটিংসের স্ট্যাটাস দেখুন।

ওমনিচ্যানেল সেটিংসের তালিকা

আপনার অ্যাকাউন্টের জন্য সব omnichannelSetting তথ্য ফিরিয়ে আনতে, omnichannelSettings.list পদ্ধতি ব্যবহার করুন।

এখানে একটি কোড স্যাম্পেল দেওয়া হল:

Java

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1.AccountName;
import com.google.shopping.merchant.accounts.v1.ListOmnichannelSettingsRequest;
import com.google.shopping.merchant.accounts.v1.OmnichannelSetting;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingsServiceClient.ListOmnichannelSettingsPagedResponse;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingsServiceSettings;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;

/**
 * This class demonstrates how to get the list of omnichannel settings for a given Merchant Center
 * account
 */
public class ListOmnichannelSettingsSample {

  public static void omnichannelSettings(Config config) throws Exception {

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

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

    String accountId = config.getAccountId().toString();
    String parent = AccountName.newBuilder().setAccount(accountId).build().toString();

    // Calls the API and catches and prints any network failures/errors.
    try (OmnichannelSettingsServiceClient omnichannelSettingsServiceClient =
        OmnichannelSettingsServiceClient.create(omnichannelSettingsServiceSettings)) {
      ListOmnichannelSettingsRequest request =
          ListOmnichannelSettingsRequest.newBuilder().setParent(parent).build();

      System.out.println("Sending list omnichannel setting request:");
      ListOmnichannelSettingsPagedResponse response =
          omnichannelSettingsServiceClient.listOmnichannelSettings(request);

      int count = 0;

      // Iterates over all the entries in the response.
      for (OmnichannelSetting omnichannelSetting : response.iterateAll()) {
        System.out.println(omnichannelSetting);
        count++;
      }
      System.out.println(String.format("The following count of elements were returned: %d", count));
    } catch (Exception e) {
      System.out.println("An error has occured: ");
      System.out.println(e);
    }
  }

  public static void main(String[] args) throws Exception {
    Config config = Config.load();

    omnichannelSettings(config);
  }
}

PHP

use Google\ApiCore\ApiException;
use Google\Shopping\Merchant\Accounts\V1\Client\OmnichannelSettingsServiceClient;
use Google\Shopping\Merchant\Accounts\V1\ListOmnichannelSettingsRequest;

/**
 * This class demonstrates how to get the list of omnichannel settings for a
 * given Merchant Center account.
 */
class ListOmnichannelSettings
{
    /**
     * Helper to create the parent string.
     *
     * @param string $accountId The merchant account ID.
     * @return string The parent string in the format `accounts/{account}`.
     */
    private static function getParent(string $accountId): string
    {
        return sprintf('accounts/%s', $accountId);
    }

    /**
     * Lists the omnichannel settings for a given Merchant Center account.
     *
     * @param array $config The configuration file for authentication.
     */
    public static function listOmnichannelSettingsSample(array $config): void
    {
        // Obtains OAuth credentials from the configuration file.
        $credentials = Authentication::useServiceAccountOrTokenFile();

        // Creates a client.
        $omnichannelSettingsServiceClient = new OmnichannelSettingsServiceClient([
            'credentials' => $credentials
        ]);

        // Constructs the parent resource name.
        $parent = self::getParent($config['accountId']);

        // Creates the request.
        $request = new ListOmnichannelSettingsRequest(['parent' => $parent]);

        // Calls the API and prints the response.
        try {
            printf("Sending list omnichannel setting request:%s", PHP_EOL);
            $response = $omnichannelSettingsServiceClient->listOmnichannelSettings($request);

            $count = 0;
            // Iterates over all the omnichannel settings and prints them.
            foreach ($response->iterateAllElements() as $omnichannelSetting) {
                print $omnichannelSetting->serializeToJsonString(true) . PHP_EOL;
                $count++;
            }
            printf("The following count of elements were returned: %d%s", $count, PHP_EOL);
        } catch (ApiException $e) {
            printf("An error has occured: %s", $e->getMessage());
        }
    }

    /**
     * Executes the sample.
     */
    public function callSample(): void
    {
        $config = Config::generateConfig();
        self::listOmnichannelSettingsSample($config);
    }
}

// Runs the script.
$sample = new ListOmnichannelSettings();
$sample->callSample();

Python

from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_accounts_v1 import ListOmnichannelSettingsRequest
from google.shopping.merchant_accounts_v1 import OmnichannelSettingsServiceClient


def list_omnichannel_settings(account_id: str) -> None:
  """Lists the omnichannel settings for a given Merchant Center account.

  Args:
      account_id: The ID of the Merchant Center account.
  """
  # Gets OAuth Credentials.
  credentials = generate_user_credentials.main()

  # Creates a client.
  client = OmnichannelSettingsServiceClient(credentials=credentials)

  # The parent account for which to list the settings.
  parent = f"accounts/{account_id}"

  # Creates the request.
  request = ListOmnichannelSettingsRequest(parent=parent)

  # Makes the request and catches and prints any error messages.
  try:
    print("Sending list omnichannel setting request:")
    response = client.list_omnichannel_settings(request=request)

    count = 0
    # Iterates over all the entries in the response.
    for omnichannel_setting in response:
      print(omnichannel_setting)
      count += 1
    print(f"The following count of elements were returned: {count}")
  except RuntimeError as e:
    print("An error has occured: ")
    print(e)


if __name__ == "__main__":
  # The ID of the account to get the omnichannel settings for.
  _ACCOUNT = configuration.Configuration().read_merchant_info()

  list_omnichannel_settings(_ACCOUNT)

সর্বত্রগামী চ্যানেল সেটিং আপডেট করা

আগে থেকে থাকা কোনও সর্বত্রগামী চ্যানেল সেটিংয়ের কনফিগারেশন আপডেট করতে, omnichannelSettings.update পদ্ধতি ব্যবহার করুন।

আপডেট করতে, আপনাকে অবশ্যই আপডেট মাস্কে আপনার পছন্দের ফিচার যোগ করতে হবে এবং আপডেট অনুরোধে omnichannelSetting ফিল্ডের সংশ্লিষ্ট ফিল্ডগুলি পূরণ করতে হবে। আপনি এগুলির মধ্যে যেকোনও একটি আপডেট করতে পারবেন

  • lsfType
  • inStock
  • pickup
  • odo
  • about
  • inventoryVerification

আপডেট মাস্কে কোনও অ্যাট্রিবিউট অন্তর্ভুক্ত না থাকলে, সেটি আপডেট করা হবে না।

কোনও অ্যাট্রিবিউট আপডেট মাস্কে অন্তর্ভুক্ত করা হলেও অনুরোধে সেট করা না হলে, সেটি মুছে ফেলা হবে।

নিম্নলিখিত কোড স্যাম্পেল থেকে জানা যায় যে কীভাবে ইনভেনটরি যাচাইকরণ ফিল্ড আপডেট করতে হয়।

Java

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.protobuf.FieldMask;
import com.google.shopping.merchant.accounts.v1.InventoryVerification;
import com.google.shopping.merchant.accounts.v1.OmnichannelSetting;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingName;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingsServiceSettings;
import com.google.shopping.merchant.accounts.v1.UpdateOmnichannelSettingRequest;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;

/**
 * This class demonstrates how to update an omnichannel setting for a given Merchant Center account
 * in a given country
 */
public class UpdateOmnichannelSettingSample {

  public static void updateOmnichannelSettings(
      Config config, String regionCode, String contact, String email) throws Exception {

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

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

    // Calls the API and catches and prints any network failures/errors.
    try (OmnichannelSettingsServiceClient omnichannelSettingsServiceClient =
        OmnichannelSettingsServiceClient.create(omnichannelSettingsServiceSettings)) {
      String accountId = config.getAccountId().toString();
      String name =
          OmnichannelSettingName.newBuilder()
              .setAccount(accountId)
              .setOmnichannelSetting(regionCode)
              .build()
              .toString();

      OmnichannelSetting omnichannelSetting =
          OmnichannelSetting.newBuilder()
              .setName(name)
              .setInventoryVerification(
                  InventoryVerification.newBuilder()
                      .setContact(contact)
                      .setContactEmail(email)
                      .build())
              .build();
      FieldMask fieldMask = FieldMask.newBuilder().addPaths("inventory_verification").build();
      UpdateOmnichannelSettingRequest request =
          UpdateOmnichannelSettingRequest.newBuilder()
              .setOmnichannelSetting(omnichannelSetting)
              .setUpdateMask(fieldMask)
              .build();

      System.out.println("Sending update omnichannel setting request:");
      OmnichannelSetting response =
          omnichannelSettingsServiceClient.updateOmnichannelSetting(request);

      System.out.println("Updated Omnichannel Setting below:");
      System.out.println(response);
    } catch (Exception e) {
      System.out.println("An error has occured: ");
      System.out.println(e);
    }
  }

  public static void main(String[] args) throws Exception {
    Config config = Config.load();

    // The country which you're targeting at.
    String regionCode = "{REGION_CODE}";
    // The name of the inventory verification contact you want to update.
    String contact = "{NAME}";
    // The address of the inventory verification email you want to update.
    String email = "{EMAIL}";

    updateOmnichannelSettings(config, regionCode, contact, email);
  }
}

PHP

use Google\ApiCore\ApiException;
use Google\Protobuf\FieldMask;
use Google\Shopping\Merchant\Accounts\V1\Client\OmnichannelSettingsServiceClient;
use Google\Shopping\Merchant\Accounts\V1\InventoryVerification;
use Google\Shopping\Merchant\Accounts\V1\OmnichannelSetting;
use Google\Shopping\Merchant\Accounts\V1\UpdateOmnichannelSettingRequest;

/**
 * This class demonstrates how to update an omnichannel setting for a given
 * Merchant Center account in a given country.
 */
class UpdateOmnichannelSetting
{
    /**
     * Helper to create the name string.
     *
     * @param string $accountId The merchant account ID.
     * @param string $regionCode The region code of the setting.
     * @return string The name string in the format
     *     `accounts/{account}/omnichannelSettings/{omnichannelSetting}`.
     */
    private static function getName(string $accountId, string $regionCode): string
    {
        return sprintf('accounts/%s/omnichannelSettings/%s', $accountId, $regionCode);
    }

    /**
     * Updates an omnichannel setting for a given Merchant Center account.
     *
     * @param array $config The configuration file for authentication.
     * @param string $regionCode The country of the omnichannel setting.
     * @param string $contact The name of the inventory verification contact.
     * @param string $email The email of the inventory verification contact.
     */
    public static function updateOmnichannelSettingSample(
        array $config,
        string $regionCode,
        string $contact,
        string $email
    ): void {
        // Obtains OAuth credentials from the configuration file.
        $credentials = Authentication::useServiceAccountOrTokenFile();

        // Creates a client.
        $omnichannelSettingsServiceClient = new OmnichannelSettingsServiceClient([
            'credentials' => $credentials
        ]);

        // Constructs the resource name.
        $name = self::getName($config['accountId'], $regionCode);

        // Creates the omnichannel setting with the updated fields.
        $omnichannelSetting = new OmnichannelSetting([
            'name' => $name,
            'inventory_verification' => new InventoryVerification([
                'contact' => $contact,
                'contact_email' => $email
            ])
        ]);

        // Creates the field mask to specify which fields to update.
        $fieldMask = new FieldMask([
            'paths' => ['inventory_verification']
        ]);

        // Creates the request.
        $request = new UpdateOmnichannelSettingRequest([
            'omnichannel_setting' => $omnichannelSetting,
            'update_mask' => $fieldMask
        ]);

        // Calls the API and prints the response.
        try {
            printf("Sending update omnichannel setting request:%s", PHP_EOL);
            $response = $omnichannelSettingsServiceClient->updateOmnichannelSetting($request);
            printf("Updated Omnichannel Setting below:%s", PHP_EOL);
            print $response->serializeToJsonString(true) . PHP_EOL;
        } catch (ApiException $e) {
            printf("An error has occured: %s", $e->getMessage());
        }
    }

    /**
     * Executes the sample.
     */
    public function callSample(): void
    {
        $config = Config::generateConfig();
        // The country which you're targeting.
        $regionCode = '{REGION_CODE}';
        // The name of the inventory verification contact you want to update.
        $contact = '{NAME}';
        // The address of the inventory verification email you want to update.
        $email = '{EMAIL}';
        self::updateOmnichannelSettingSample($config, $regionCode, $contact, $email);
    }
}

// Runs the script.
$sample = new UpdateOmnichannelSetting();
$sample->callSample();

Python

from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.protobuf import field_mask_pb2
from google.shopping.merchant_accounts_v1 import InventoryVerification
from google.shopping.merchant_accounts_v1 import OmnichannelSetting
from google.shopping.merchant_accounts_v1 import OmnichannelSettingsServiceClient
from google.shopping.merchant_accounts_v1 import (
    UpdateOmnichannelSettingRequest,
)


def update_omnichannel_setting(
    account_id: str, region_code: str, contact: str, email: str
) -> None:
  """Updates an omnichannel setting for a given Merchant Center account.

  Args:
      account_id: The ID of the Merchant Center account.
      region_code: The country for which you're updating the setting.
      contact: The name of the inventory verification contact.
      email: The email of the inventory verification contact.
  """
  # Gets OAuth Credentials.
  credentials = generate_user_credentials.main()

  # Creates a client.
  client = OmnichannelSettingsServiceClient(credentials=credentials)

  # The name of the omnichannel setting to update.
  name = f"accounts/{account_id}/omnichannelSettings/{region_code}"

  # Creates an omnichannel setting with the updated values.
  omnichannel_setting = OmnichannelSetting()
  omnichannel_setting.name = name
  omnichannel_setting.inventory_verification = InventoryVerification(
      contact=contact, contact_email=email
  )

  # Creates a field mask to specify which fields to update.
  field_mask = field_mask_pb2.FieldMask(paths=["inventory_verification"])

  # Creates the request.
  request = UpdateOmnichannelSettingRequest(
      omnichannel_setting=omnichannel_setting, update_mask=field_mask
  )

  # Makes the request and catches and prints any error messages.
  try:
    print("Sending update omnichannel setting request:")
    response = client.update_omnichannel_setting(request=request)
    print("Updated Omnichannel Setting below:")
    print(response)
  except RuntimeError as e:
    print("An error has occured: ")
    print(e)


if __name__ == "__main__":
  # The ID of the account to get the omnichannel settings for.
  _ACCOUNT = configuration.Configuration().read_merchant_info()

  # The country which you're targeting.
  _REGION_CODE = "{REGION_CODE}"
  # The name of the inventory verification contact you want to update.
  _CONTACT = "{NAME}"
  # The address of the inventory verification email you want to update.
  _EMAIL = "{EMAIL}"

  update_omnichannel_setting(_ACCOUNT, _REGION_CODE, _CONTACT, _EMAIL)

ইনভেনটরি যাচাইকরণের অনুরোধ

omnichannelSettings.requestInventoryVerification শুধুমাত্র GHLSF মার্চেন্টদের জন্য প্রাসঙ্গিক।

এই RPC কল করার আগে, আপনাকে নিম্নলিখিত কাজগুলি করতে হবে:

  • আপনার প্রোডাক্ট ও ইনভেনটরি ডেটা আপলোড করুন।
  • ইনভেনটরি যাচাইকরণের যোগাযোগের তথ্য যাচাই করুন।
  • অস্ট্রিয়া, জার্মানি বা সুইজারল্যান্ডের মার্চেন্টদের জন্য, About পৃষ্ঠা পর্যালোচনা সম্পূর্ণ করুন।

আপনি উপযুক্ত কিনা তা নির্ধারণ করতে, omnichannelSettings.get নম্বরে কল করুন এবং omnichannelSetting.inventoryVerification.state চেক করুন। INACTIVE দেখালে, আপনি omnichannelSettings.requestInventoryVerification-কে কল করার জন্য রেডি।

Java

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingName;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingsServiceClient;
import com.google.shopping.merchant.accounts.v1.OmnichannelSettingsServiceSettings;
import com.google.shopping.merchant.accounts.v1.RequestInventoryVerificationRequest;
import com.google.shopping.merchant.accounts.v1.RequestInventoryVerificationResponse;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;

/**
 * This class demonstrates how to request inventory verification for a given Merchant Center account
 * in a given country
 */
public class RequestInventoryVerificationSample {

  public static void requestInventoryVerification(Config config, String regionCode)
      throws Exception {

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

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

    // Calls the API and catches and prints any network failures/errors.
    try (OmnichannelSettingsServiceClient omnichannelSettingsServiceClient =
        OmnichannelSettingsServiceClient.create(omnichannelSettingsServiceSettings)) {
      String accountId = config.getAccountId().toString();
      String name =
          OmnichannelSettingName.newBuilder()
              .setAccount(accountId)
              .setOmnichannelSetting(regionCode)
              .build()
              .toString();
      RequestInventoryVerificationRequest request =
          RequestInventoryVerificationRequest.newBuilder().setName(name).build();

      System.out.println("Sending request inventory verification request:");
      RequestInventoryVerificationResponse response =
          omnichannelSettingsServiceClient.requestInventoryVerification(request);

      System.out.println("Omnichannel Setting after inventory verification request below:");
      System.out.println(response);
    } catch (Exception e) {
      System.out.println("An error has occured: ");
      System.out.println(e);
    }
  }

  public static void main(String[] args) throws Exception {
    Config config = Config.load();

    // The country which you're targeting at.
    String regionCode = "{REGION_CODE}";

    requestInventoryVerification(config, regionCode);
  }
}

সর্বত্রগামী চ্যানেল সেটিংসের স্ট্যাটাস দেখুন।

LIA অনবোর্ডিং রিভিউয়ের স্ট্যাটাস চেক করতে, ReviewState -এ omnichannelSetting-এর সংশ্লিষ্ট অ্যাট্রিবিউট চেক করুন যা omnichannelSettings.get বা omnichannelSettings.list পদ্ধতির মাধ্যমে রিটার্ন করা হয়েছে।

ReviewState ফিল্ডটি ইনভেনটরি যাচাইকরণ প্রক্রিয়া ছাড়া সমস্ত অনবোর্ডিং পর্যালোচনার ক্ষেত্রে প্রযোজ্য এবং এতে নিম্নলিখিত ভ্যালু থাকতে পারে:

  • ACTIVE: এটি অনুমোদন করা হয়েছে।
  • FAILED: এটি বাতিল করা হয়েছে।
  • RUNNING: এটি এখনও পর্যালোচনা করা হচ্ছে।
  • ACTION_REQUIRED: এটি শুধুমাত্র GHLSF মার্চেন্টদের জন্য InStock.state-এ উপলভ্য। এর অর্থ হল, LIA দেখানোর জন্য আপনাকে ইনভেনটরি যাচাইকরণের অনুরোধ করতে হবে।

InventoryVerification.State-এর নিম্নলিখিত মান আছে:

  • SUCCEEDED: এটি অনুমোদন করা হয়েছে।
  • INACTIVE: আপনি ইনভেনটরি যাচাইকরণের অনুরোধ করার জন্য প্রস্তুত।
  • RUNNING: এটি পর্যালোচনা করা হচ্ছে
  • SUSPENDED: আপনি অনেকবার ইনভেন্টরি যাচাইকরণে ব্যর্থ হয়েছেন (সাধারণত ৫ বার) এবং আবার অনুরোধ করার আগে আপনাকে অপেক্ষা করতে হবে।
  • ACTION_REQUIRED: ইনভেনটরি যাচাইকরণের অনুরোধ করার আগে আপনাকে অতিরিক্ত অ্যাকশন নিতে হবে।

Omnichannel Settings API সম্পর্কিত সমস্যার সমাধান করা

এই বিভাগে সাধারণ সমস্যার সমাধান কীভাবে করবেন তা বর্ণনা করা হয়েছে।

সর্বত্রগামী চ্যানেল সেটিং তৈরি করুন

  • LsfType এবং RegionCode দুটিই সেট করতে ভুলবেন না।
  • আপনি GHLSF বেছে নিলে, অনুরোধে একটি খালি InStock প্রদান করুন।
  • আপনি মার্চেন্ট-হোস্ট করা LSF-এর ধরন বেছে নিলে, InStock বা Pickup-এ অন্তত একটি URI প্রদান করুন।

সর্বত্রগামী চ্যানেল সেটিং আপডেট করা

এই রিসোর্সের আপডেট পদ্ধতির জন্য নিম্নলিখিত অতিরিক্ত নিয়ম প্রয়োজন:

  • আপনি অঞ্চল কোড পরিবর্তন করতে পারবেন না।
  • LIA/FLL ফিচার চালু থাকলে বা অনুমোদিত হলে আপনি আপডেট করতে পারবেন না।
  • মার্চেন্ট-হোস্ট করা LSF-এর ধরন থেকে GHLSF-এ পরিবর্তন করার সময়, InStock এবং Pickup আগে থেকে কনফিগার করা থাকলে, আপনাকে অবশ্যই LsfType আপডেটের সাথে আপডেট মাস্কে সেগুলি অন্তর্ভুক্ত করতে হবে।

যেমন, আপনি আগে MHLSF_BASIC এবং Pickup-এর জন্য আবেদন করে থাকলে এবং সেগুলি বাতিল হয়ে গেলে, আপনি এই ধরনের অনুরোধ পাঠিয়ে GHLSF-এ পরিবর্তন করতে পারবেন:

PATCH https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/omnichannelSettings/{REGION_CODE}?update_mask=lsf_type,in_stock,pickup

{
  "lsfType": "GHLSF",
  "inStock": {},
}

নিম্নলিখিতগুলি পরিবর্তন করুন:

  • {ACCOUNT_ID}: আপনার Merchant Center অ্যাকাউন্টের অনন্য শনাক্তকারী
  • {REGION_CODE}: CLDR-এ যেমন উল্লেখ করা আছে সেই অনুযায়ী অঞ্চলের কোড

ইনভেনটরি যাচাইকরণের অনুরোধ

প্রোডাক্ট বা ইনভেনটরি ফিড আপডেট করা এবং যোগাযোগের তথ্য কনফার্ম করার পরেও, InventoryVerification.state যদি INACTIVE ছাড়া অন্য কিছু হয়:

  • অস্ট্রিয়া, জার্মানি ও সুইজারল্যান্ডের মার্চেন্টদের জন্য: 'সম্পর্কে' পৃষ্ঠা পর্যালোচনা সম্পূর্ণ করেছেন কিনা তা নিশ্চিত করুন।
  • এতে প্রায় ৪৮ ঘণ্টা দেরি হবে।
  • ইনভেনটরি চেক বারবার ব্যর্থ হলে (পাঁচবারের বেশি), পরিষেবাটি অন্য অনুরোধের অনুমতি দেওয়ার আগে ত্রিশ দিনের কুলিং-ডাউন পিরিয়ড প্রয়োগ করে। আপনি আগে অনুরোধ করতে চাইলে Google সহায়তা টিমের সাথে যোগাযোগ করুন।

আরও জানুন

আরও জানতে, স্থানীয় ইনভেনটরি বিজ্ঞাপন ও ফ্রি স্থানীয় তালিকা সহায়তা কেন্দ্র দেখুন।