অমনিচ্যানেল সেটিংস এপিআই হলো আপনার লোকাল ইনভেন্টরি অ্যাডস (এলআইএ) এবং ফ্রি লোকাল লিস্টিংস (এফএলএল) প্রোগ্রামগুলো কনফিগার করার প্রবেশদ্বার।
প্রোগ্রাম্যাটিকভাবে এটি ব্যবহার করুন
- অমনিচ্যানেল সেটিংস পরিচালনা করুন (তৈরি ও হালনাগাদ করুন)
- ফেচ (গেট এবং লিস্ট) অমনিচ্যানেল সেটিংস
- যোগ্য ব্যবসায়ীদের জন্য মজুদ যাচাইয়ের অনুরোধ করুন
আরও তথ্যের জন্য, স্থানীয় ইনভেন্টরি বিজ্ঞাপন এবং বিনামূল্যের স্থানীয় তালিকার সংক্ষিপ্ত বিবরণ দেখুন।
পূর্বশর্ত
আপনার থাকা উচিত ছিল
একটি মার্চেন্ট সেন্টার অ্যাকাউন্ট
একটি ব্যবসায়িক প্রোফাইল। যদি আপনার একটি না থাকে, তবে আপনি একটি তৈরি করতে পারেন। ব্যবসায়িক প্রোফাইলের জন্য সাইন আপ দেখুন।
আপনার বিজনেস প্রোফাইল এবং আপনার মার্চেন্ট সেন্টার অ্যাকাউন্টের মধ্যে একটি সংযোগ। এই সংযোগটি তৈরি করতে, আপনি মার্চেন্ট সেন্টার ইউজার ইন্টারফেস অথবা মার্চেন্ট এপিআই (API) ব্যবহার করতে পারেন (দেখুন: একটি গুগল বিজনেস প্রোফাইল লিঙ্ক করুন )।
একটি অমনিচ্যানেল সেটিং তৈরি করুন
আপনি একটি অমনিচ্যানেল সেটিং তৈরি করতে omnichannelSettings.create মেথডটি ব্যবহার করতে পারেন। create মেথডটি ইনপুট হিসেবে একটি omnichannelSetting রিসোর্স গ্রহণ করে এবং সফল হলে তৈরি করা অমনিচ্যানেল সেটিংটি রিটার্ন করে।
তৈরি করার সময়, আপনাকে অবশ্যই regionCode এবং LsfType উভয়ই পূরণ করতে হবে:
- OmnichannelSetting দেশ-ভিত্তিক।
RegionCodeনির্দিষ্ট দেশটিকে সংজ্ঞায়িত করে। একবার তৈরি হয়ে গেলে, আপনি এটি পরিবর্তন করতে পারবেন না।RegionCodeঅবশ্যই Common Locale Data Repository (CLDR) প্রজেক্ট দ্বারা সংজ্ঞায়িত নামকরণের নিয়ম অনুসরণ করতে হবে। -
LsfTypeআপনার প্রোডাক্ট পেজের উপর ভিত্তি করে নির্ধারিত হয়। বিস্তারিত জানতে,LsfTypeদেখুন।
আরও বিস্তারিত জানতে, আপনার স্থানীয় ইনভেন্টরি বিজ্ঞাপনগুলির জন্য পণ্য পৃষ্ঠার অভিজ্ঞতা পরিবর্তন করুন দেখুন।
তৈরির পর্যায়ে আপনাকে সমস্ত ফিল্ড পূরণ করতে হবে না, বরং পরে সেগুলি কনফিগার করতে পারেন। বিদ্যমান কোনো omnichannelSetting আপডেট করতে, “Update an omnichannel setting” দেখুন।
আপনি যদি 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}: আপনার মার্চেন্ট সেন্টার অ্যাকাউন্টের অনন্য শনাক্তকারী। -
{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 |
| যেসব পণ্যের পেজ দোকানে পাওয়া যায় না | গুগল-হোস্টেড লোকাল স্টোর ফ্রন্ট (GHLSF) | GHLSF |
আপনি যদি মার্চেন্ট-হোস্টেড লোকাল স্টোর ফ্রন্ট টাইপ বেছে নেন, তাহলে আপনাকে URI ফিল্ডে inStock অথবা pickup এর মধ্যে অন্তত একটি পূরণ করতে হবে।
স্টকে আছে
আপনার পণ্যের পৃষ্ঠা সম্পর্কে আরও তথ্য প্রদান করতে আপনি InStock ব্যবহার করতে পারেন।
আপনি যদি মার্চেন্ট-হোস্টেড এলএসএফ টাইপ বেছে নেন এবং ইনস্টক-এ ইউআরআই ফিল্ডটি নির্দিষ্ট করেন, তাহলে আপনি স্টকে থাকা পণ্য পরিবেশন করার অভিপ্রায় প্রকাশ করছেন। আমরা প্রদত্ত ইউআরআই-এর উপর ভিত্তি করে একটি পর্যালোচনা শুরু করব।
আপনি যদি GHLSF টাইপটি বেছে নেন, তাহলে অনুরোধে আপনাকে একটি খালি InStock ফিল্ড সরবরাহ করতে হবে। মার্চেন্ট-হোস্টেড LSF টাইপগুলোর থেকে ভিন্ন, অনবোর্ডিং সম্পন্ন করার জন্য আপনাকে ইনভেন্টরি ভেরিফিকেশন প্রক্রিয়াটি সম্পূর্ণ করতে হবে।
এই কোড নমুনাটি GHLSF ব্যবহার করে একটি omnichannelSetting তৈরি করে:
জাভা
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);
}
}
পিএইচপি
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();
পাইথন
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}"
}
}
অর্ডার অনুযায়ী প্রদর্শনে উপলব্ধ
‘অন ডিসপ্লে টু অর্ডার’ ফিচারের মাধ্যমে, আপনি এমন পণ্যগুলো দেখাতে পারেন যেগুলো আপনার ফিজিক্যাল স্টোরে প্রদর্শিত আছে, কিন্তু তাৎক্ষণিক কেনার জন্য উপলব্ধ নয়। উদাহরণস্বরূপ, বড় আসবাবপত্র:
- যেসব গ্রাহক গুগলে একই ধরনের পণ্য খুঁজছেন, তারা তাদের সার্চ রেজাল্টে "ইন-স্টোর" লেখা সহ এই বিজ্ঞাপনগুলো দেখতে পাবেন।
- যেসব গ্রাহক গুগল সার্চ রেজাল্ট পেজে স্টোরটি ব্রাউজ করছেন, তারা এই পণ্যগুলোকে "অর্ডার করার জন্য উপলব্ধ" হিসেবে চিহ্নিত দেখতে পাবেন।
পণ্যটি দেখার জন্য তারা আপনার স্থানীয় ইনভেন্টরি বিজ্ঞাপন বা বিনামূল্যের স্থানীয় তালিকা বেছে নিতে পারেন। পণ্যটি কেনার জন্য, তারা আপনার দোকানে এসে সেটি দেখতে পারেন এবং তারপর তাদের কাছে পাঠানোর জন্য অথবা আপনার দোকান থেকে তুলে নেওয়ার জন্য অর্ডার করতে পারেন।
(জার্মানি, অস্ট্রিয়া এবং সুইজারল্যান্ড) সম্পর্কে
আপনি যদি অস্ট্রিয়া এবং জার্মানিতে কর্মরত থাকেন এবং GHLSF বেছে নেন, তাহলে আপনাকে অবশ্যই একটি ‘আমাদের সম্পর্কে’ পৃষ্ঠা জমা দিতে হবে।
আপনি যদি সুইজারল্যান্ডে কর্মরত থাকেন, তাহলে আপনার LsfType নির্বিশেষে আপনাকে অবশ্যই একটি "About" পেজ জমা দিতে হবে।
‘About’ পেজের URL যাচাই না হওয়া পর্যন্ত, GHLSF মার্চেন্টরা Google-এর কাছে ম্যানুয়াল ইনভেন্টরি যাচাইয়ের জন্য অনুরোধ করতে পারবেন না।
এই তিনটি দেশের সকল মার্চেন্টের জন্য, আপনার 'About' পেজ অনুমোদন না পাওয়া পর্যন্ত পরিষেবাটি FLL/LIA ফিচারগুলো সক্রিয় করে না।
ইনভেন্টরি যাচাইকরণ
ইনভেন্টরি ভেরিফিকেশন শুধুমাত্র GHLSF মার্চেন্টদের জন্য প্রয়োজন। এটি MHLSF টাইপের জন্য সমর্থিত নয়।
আপনি পণ্য এবং ইনভেন্টরির তথ্য যোগ করার আগে বা পরে ( accounts.products.localInventories.insert অথবা মার্চেন্ট সেন্টার ইউজার ইন্টারফেস ব্যবহার করে), আপনাকে অবশ্যই আপনার কন্ট্যাক্ট যাচাই করতে হবে। create বা update পদ্ধতি ব্যবহার করে একটি ইনভেন্টরি যাচাইকরণ কন্ট্যাক্ট (নাম এবং ইমেল ঠিকানা) প্রদান করুন। কন্ট্যাক্টটি গুগলের পাঠানো একটি ইমেল পাবে এবং মেসেজে থাকা একটি বাটনে ক্লিক করে তাদের স্ট্যাটাস যাচাই করার সুযোগ পাবে।
এটি সম্পন্ন করার পর, আপনি ইনভেন্টরি যাচাইয়ের জন্য অনুরোধ করতে পারবেন। আরও তথ্যের জন্য ইনভেন্টরি যাচাই সম্পর্কে দেখুন।
আপনি যাচাইকরণ প্রক্রিয়া চলাকালীন অথবা যাচাইকরণের পরে omnichannelSetting.update ব্যবহার করে আপনার যোগাযোগের তথ্য পরিবর্তন করতে পারেন।
এই প্রক্রিয়াটি সম্পন্ন হওয়ার পর, গুগল প্রদত্ত তথ্যের নির্ভুলতা যাচাই করে।
একটি অমনিচ্যানেল সেটিং নিন
কোনো নির্দিষ্ট দেশের omnichannelSetting কনফিগারেশন জানতে, বা আপনার রিভিউগুলোর বর্তমান অবস্থা জানতে, omnichannelSettings.get মেথডটি ব্যবহার করুন।
এখানে একটি নমুনা অনুরোধ দেওয়া হলো:
GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/omnichannelSettings/{OMNICHANNEL_SETTING}
নিম্নলিখিতগুলি প্রতিস্থাপন করুন:
-
{ACCOUNT_ID}: আপনার মার্চেন্ট সেন্টার অ্যাকাউন্টের অনন্য শনাক্তকারী। -
{OMNICHANNEL_SETTING}: আপনার লক্ষ্যকৃত দেশের অঞ্চল কোড
ACTIVE স্ট্যাটাসটি নির্দেশ করে যে পর্যালোচনাটি অনুমোদন পেয়েছে।
যদি স্ট্যাটাসটি FAILED হয়, তাহলে সমস্যাগুলো সমাধান করুন এবং omnichannelSetting.update কল করে একটি নতুন রিভিউ শুরু করুন।
পঠনযোগ্য LFP ফিল্ডটি আপনার লোকাল ফিডস পার্টনারশিপের স্ট্যাটাস দেখায়। পার্টনারশিপের সাথে লিঙ্ক করতে, lfpProviders.linkLfpProvider ব্যবহার করুন।
স্ট্যাটাস চেক করা এবং সেগুলোর অর্থ সম্পর্কে আরও তথ্যের জন্য, “একটি অমনিচ্যানেল সেটিং-এর স্ট্যাটাস দেখুন” দেখুন।
ওমনিচ্যানেল সেটিংস তালিকাভুক্ত করুন
আপনার অ্যাকাউন্টের সমস্ত omnichannelSetting তথ্য পুনরুদ্ধার করতে, omnichannelSettings.list পদ্ধতিটি ব্যবহার করুন।
এখানে একটি কোডের নমুনা দেওয়া হলো:
জাভা
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);
}
}
পিএইচপি
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();
পাইথন
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
যদি কোনো অ্যাট্রিবিউট আপডেট মাস্কে অন্তর্ভুক্ত না থাকে, তবে সেটি আপডেট হবে না।
যদি কোনো অ্যাট্রিবিউট আপডেট মাস্কে অন্তর্ভুক্ত থাকে, কিন্তু অনুরোধে তা সেট করা না থাকে, তবে সেটি মুছে ফেলা হবে।
নিম্নলিখিত কোড নমুনাটি ইনভেন্টরি যাচাইকরণ ফিল্ডটি কীভাবে আপডেট করতে হয় তা প্রদর্শন করে।
জাভা
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);
}
}
পিএইচপি
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();
পাইথন
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 কল করার জন্য প্রস্তুত।
জাভা
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 অনবোর্ডিং রিভিউগুলির অবস্থা যাচাই করতে, omnichannelSettings.get বা omnichannelSettings.list মেথড দ্বারা ফেরত আসা omnichannelSetting এর সংশ্লিষ্ট অ্যাট্রিবিউটগুলির ReviewState পরীক্ষা করুন।
ইনভেন্টরি যাচাইকরণ প্রক্রিয়া ব্যতীত সমস্ত অনবোর্ডিং রিভিউর ক্ষেত্রে ‘ 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}: আপনার মার্চেন্ট সেন্টার অ্যাকাউন্টের অনন্য শনাক্তকারী। -
{REGION_CODE}: CLDR দ্বারা সংজ্ঞায়িত একটি অঞ্চল কোড
ইনভেন্টরি যাচাইকরণের অনুরোধ
যদি প্রোডাক্ট বা ইনভেন্টরি ফিড আপডেট করা এবং কন্টাক্ট নিশ্চিত করা সত্ত্বেও InventoryVerification.state , INACTIVE ছাড়া অন্য কিছু হয়:
- অস্ট্রিয়া, জার্মানি এবং সুইজারল্যান্ডের ব্যবসায়ীদের জন্য: নিশ্চিত করুন যে আপনি আপনার 'আমাদের সম্পর্কে' পৃষ্ঠাটি পর্যালোচনা সম্পন্ন করেছেন।
- প্রায় ৪৮ ঘণ্টা বিলম্ব হবে।
- বারবার (পাঁচটির বেশি) ইনভেন্টরি চেক ব্যর্থ হলে, পরবর্তী অনুরোধের অনুমতি দেওয়ার আগে পরিষেবাটি ত্রিশ দিনের একটি বিরতি কার্যকর করে। আপনি যদি এর আগেই অনুরোধ করতে চান, তাহলে গুগল সাপোর্টে যোগাযোগ করুন।
আরও জানুন
আরও বিস্তারিত তথ্যের জন্য, স্থানীয় ইনভেন্টরি বিজ্ঞাপন এবং বিনামূল্যে স্থানীয় তালিকাভুক্তি সহায়তা কেন্দ্র দেখুন।