OmnichannelSettings API เป็นจุดแรกในการกำหนดค่าโปรแกรมโฆษณาสินค้าคงคลังในร้าน (LIA) และข้อมูลในร้านที่แสดงฟรี (FLL)
ใช้เพื่อดำเนินการแบบเป็นโปรแกรม
- จัดการ (สร้างและอัปเดต) การตั้งค่าช่องทางการขายแบบรวม
- ดึงข้อมูล (รับและแสดงรายการ) การตั้งค่าช่องทางรวม
- ขอรับการยืนยันสินค้าคงคลังสำหรับผู้ขายที่มีสิทธิ์
ดูข้อมูลเพิ่มเติมได้ที่ภาพรวมโฆษณาสินค้าคงคลังในร้านและข้อมูลในร้านที่แสดงฟรี
ข้อกำหนดเบื้องต้น
คุณควรมี
บัญชี Merchant Center
Business Profile หากยังไม่มีบัญชี คุณจะสร้างบัญชีได้ ดูลงชื่อสมัครใช้ Business Profile
การลิงก์ระหว่าง Business Profile กับบัญชี Merchant Center หากต้องการสร้างลิงก์ คุณสามารถใช้อินเทอร์เฟซผู้ใช้ของ Merchant Center หรือ Merchant API (ดูลิงก์ Google Business Profile)
สร้างการตั้งค่าการเข้าถึงลูกค้าจากทุกช่องทาง (Omnichannel)
คุณสามารถใช้เมธอด omnichannelSettings.create
เพื่อสร้างการตั้งค่าแบบหลายช่องทาง เมธอดสร้างจะรับทรัพยากร omnichannelSetting
เป็นอินพุตและแสดงผลการตั้งค่าแบบหลายช่องทางที่สร้างไว้ หากสร้างสำเร็จ
เมื่อสร้าง คุณต้องกรอกทั้ง regionCode
และ LsfType
- OmnichannelSetting จะอิงตามประเทศ
RegionCode
กําหนดประเทศเป้าหมาย เมื่อสร้างแล้ว คุณจะเปลี่ยนแปลงไม่ได้RegionCode
ควรปฏิบัติตามกฎการตั้งชื่อที่กำหนดโดยโปรเจ็กต์ Common Locale Data Repository (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"
}
}
การลงทะเบียนฟีเจอร์ LIA/FLL ต่างๆ โดยใช้ช่อง omnichannelSetting
จะทริกเกอร์การตรวจสอบโดยเจ้าหน้าที่ ซึ่งโดยปกติจะใช้เวลา 2-3 ชั่วโมงถึง 2-3 วัน เราขอแนะนำให้ตรวจสอบข้อมูลอีกครั้งเพื่อหลีกเลี่ยงการรอที่ไม่จำเป็นเนื่องจากข้อมูลไม่มีสิทธิ์
หากต้องการดูการตั้งค่าแบบหลายช่องทางที่สร้างใหม่หรือตรวจสอบสถานะของรีวิว ให้ใช้ accounts.omnichannelSettings.get
หรือ accounts.omnichannelSettings.list
โดยระบุประเทศ
ประเภทหน้าร้านในพื้นที่ (LSF)
เลือก LsfType
ตามหน้าผลิตภัณฑ์ที่วางแผนจะใช้
ประเภทหน้าผลิตภัณฑ์ | LsfType | ค่า enum |
---|---|---|
หน้าผลิตภัณฑ์ที่ระบุความพร้อมจำหน่ายผลิตภัณฑ์ในร้าน | หน้าร้านในพื้นที่แบบพื้นฐานที่ผู้ขายโฮสต์ | MHLSF_BASIC |
หน้าผลิตภัณฑ์ของร้านค้าที่เฉพาะเจาะจงพร้อมความพร้อมจำหน่ายผลิตภัณฑ์และราคา | หน้าร้านในพื้นที่ที่ผู้ขายโฮสต์ (แบบสมบูรณ์) | MHLSF_FULL |
หน้าผลิตภัณฑ์ที่ไม่ระบุความพร้อมจำหน่ายผลิตภัณฑ์ในร้านค้า | หน้าร้านในพื้นที่ที่โฮสต์โดย Google (GHLSF) | GHLSF |
หากเลือกประเภทหน้าร้านในพื้นที่ที่ผู้ขายโฮสต์ คุณจะต้องกรอกข้อมูลในช่อง URI สำหรับ inStock
หรือ pickup
อย่างน้อย 1 รายการ
InStock
คุณสามารถใช้ "พร้อมจำหน่าย" เพื่อระบุข้อมูลเพิ่มเติมเกี่ยวกับหน้าผลิตภัณฑ์
หากเลือกประเภท LSF ที่โฮสต์โดยผู้ขายและระบุช่อง URI ใน InStock แสดงว่าคุณแสดงเจตนาที่จะแสดงผลิตภัณฑ์ที่พร้อมจำหน่าย เราจะเริ่มตรวจสอบตาม URI ที่ระบุ
หากเลือกประเภท GHLSF
คุณต้องระบุช่อง InStock
ที่ว่างเปล่าในคำขอ คุณต้องดำเนินการการยืนยันสินค้าคงคลังให้เสร็จสมบูรณ์จึงจะเริ่มต้นใช้งานได้ ซึ่งแตกต่างจาก LSF ประเภทที่โฮสต์โดยผู้ขาย
ตัวอย่างโค้ดนี้จะสร้าง omnichannelSetting
ด้วย GHLSF
package shopping.merchant.samples.accounts.v1;
// [START merchantapi_create_omnichannel_setting]
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 retrieved credentials.
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 occurred: ");
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);
}
}
// [END merchantapi_list_omnichannel_settings]
รับที่ร้าน
นอกจากความพร้อมจำหน่ายผลิตภัณฑ์ในร้านแล้ว คุณยังปรับปรุงผลิตภัณฑ์ในร้านค้าได้ด้วยฟีเจอร์การรับสินค้า ซึ่งมีสิทธิ์สำหรับ LSF ประเภทที่โฮสต์โดยผู้ขายเท่านั้น
เมื่อทำเครื่องหมายผลิตภัณฑ์สำหรับการมารับสินค้า หมายความว่าลูกค้าจะซื้อผลิตภัณฑ์ทางออนไลน์และมารับสินค้าที่ร้านได้ การตั้งค่าช่อง Pickup
แสดงว่าคุณตั้งใจที่จะแสดงผลิตภัณฑ์ที่มี SLA สำหรับการรับสินค้า เราจะเริ่มตรวจสอบตาม URI ที่ระบุ
ต่อไปนี้คือตัวอย่างคําขอที่สร้างการตั้งค่า omnichannel
ด้วย Pickup
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
GHLSF
ผู้ขายจะขอการยืนยันสินค้าคงคลังจาก Google ด้วยตนเองไม่ได้จนกว่า URL ของหน้า "เกี่ยวกับ" จะได้รับการยืนยัน
สําหรับผู้ขายทุกรายในประเทศเหล่านี้ บริการจะไม่เปิดใช้ฟีเจอร์ FLL/LIA จนกว่าหน้า "เกี่ยวกับ" จะได้รับอนุมัติ
การยืนยันสินค้าคงคลัง
การยืนยันสินค้าคงคลังจำเป็นสำหรับผู้ขาย GHLSF
เท่านั้น ไม่รองรับMHLSF
คุณต้องยืนยันรายชื่อติดต่อก่อนหรือหลังจากที่เพิ่มข้อมูลผลิตภัณฑ์และข้อมูลสินค้าคงคลัง (โดยใช้ accounts.products.localInventories.insert
หรืออินเทอร์เฟซผู้ใช้ Merchant Center) ระบุรายชื่อติดต่อสำหรับการยืนยันสินค้าคงคลัง (ชื่อและอีเมล) โดยใช้วิธีการ create
หรือ update
ผู้ติดต่อจะได้รับอีเมลจาก Google และสามารถยืนยันสถานะได้โดยคลิกปุ่มในข้อความ
เมื่อดำเนินการเสร็จแล้ว คุณจะขอรับการยืนยันสินค้าคงคลังได้ ดูข้อมูลเพิ่มเติมได้ที่เกี่ยวกับการยืนยันสินค้าคงคลัง
คุณเปลี่ยนผู้ติดต่อได้ในระหว่างกระบวนการยืนยันหรือหลังจากการยืนยันโดยใช้ omnichannelSetting.update
หลังจากกระบวนการนี้เสร็จสมบูรณ์แล้ว Google จะตรวจสอบความถูกต้องของข้อมูลที่ให้ไว้
รับการตั้งค่าการเข้าถึงลูกค้าจากทุกช่องทาง (Omnichannel)
หากต้องการเรียกข้อมูลการกำหนดค่า 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
ดูข้อมูลเพิ่มเติมเกี่ยวกับการตรวจสอบสถานะและความหมายของสถานะได้ที่ดูสถานะการตั้งค่าแบบหลายช่องทาง
แสดงรายการการตั้งค่าการเข้าถึงลูกค้าจากทุกช่องทาง (Omnichannel)
หากต้องการเรียกข้อมูล omnichannelSetting
ทั้งหมดของบัญชี ให้ใช้วิธี omnichannelSettings.list
ตัวอย่างโค้ดมีดังนี้
package shopping.merchant.samples.accounts.v1;
// [START merchantapi_list_omnichannel_settings]
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 retrieved credentials.
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 occurred: ");
System.out.println(e);
}
}
public static void main(String[] args) throws Exception {
Config config = Config.load();
omnichannelSettings(config);
}
}
// [END merchantapi_list_omnichannel_settings]
อัปเดตการตั้งค่าช่องทางรวม
หากต้องการอัปเดตการกําหนดค่าของการตั้งค่าแบบหลายช่องทางที่มีอยู่ ให้ใช้เมธอด omnichannelSettings.update
หากต้องการอัปเดต คุณต้องเพิ่มฟีเจอร์ที่ต้องการลงในมาสก์การอัปเดต แล้วกรอกข้อมูลในช่องที่เกี่ยวข้องในช่อง omnichannelSetting
ในคำขออัปเดต
คุณสามารถอัปเดตข้อมูลต่อไปนี้
lsfType
inStock
pickup
odo
about
inventoryVerification
หากแอตทริบิวต์ไม่รวมอยู่ในมาสก์การอัปเดต ระบบจะไม่อัปเดตแอตทริบิวต์นั้น
หากแอตทริบิวต์รวมอยู่ในมาสก์การอัปเดต แต่ไม่ได้ตั้งค่าไว้ในคําขอ ระบบจะล้างแอตทริบิวต์นั้น
ตัวอย่างโค้ดต่อไปนี้แสดงวิธีอัปเดตช่องการยืนยันสินค้าคงคลัง
package shopping.merchant.samples.accounts.v1;
// [START merchantapi_update_omnichannel_setting]
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 retrieved credentials.
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 occurred: ");
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);
}
}
// [END merchantapi_update_omnichannel_setting]
ขอรับการยืนยันสินค้าคงคลัง
omnichannelSettings.requestInventoryVerification
เกี่ยวข้องกับGHLSF
ผู้ขายเท่านั้น
คุณต้องดำเนินการต่อไปนี้ก่อนเรียกใช้ RPC นี้
- อัปโหลดข้อมูลผลิตภัณฑ์และสินค้าคงคลัง
- ยืนยันรายชื่อติดต่อสำหรับการยืนยันสินค้าคงคลัง
- สําหรับผู้ขายในเยอรมนี สวิตเซอร์แลนด์ หรือออสเตรีย ให้ตรวจสอบหน้า
About
ให้เสร็จสมบูรณ์
หากต้องการดูว่าคุณมีสิทธิ์หรือไม่ ให้โทรไปที่ omnichannelSettings.get
แล้วตรวจสอบ
omnichannelSetting.inventoryVerification.state
หากแสดง INACTIVE
แสดงว่าคุณพร้อมโทรหา omnichannelSettings.requestInventoryVerification
package shopping.merchant.samples.accounts.v1;
// [START merchantapi_request_inventory_verification]
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 retrieved credentials.
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 occurred: ");
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);
}
}
// [END merchantapi_request_inventory_verification]
ดูสถานะการตั้งค่าแบบหลายช่องทาง
หากต้องการตรวจสอบสถานะการตรวจสอบของรีวิวการเริ่มต้นใช้งาน LIA ให้ตรวจสอบ ReviewState
สำหรับแอตทริบิวต์ที่เกี่ยวข้องของ omnichannelSetting
ที่แสดงผลโดยเมธอด omnichannelSettings.get
หรือ omnichannelSettings.list
ช่อง ReviewState
จะมีผลกับการตรวจสอบทั้งหมดในการเริ่มต้นใช้งาน ยกเว้นกระบวนการยืนยันพื้นที่โฆษณา และอาจมีค่าต่อไปนี้
ACTIVE
: อนุมัติแล้วFAILED
: ปฏิเสธRUNNING
: เนื้อหายังอยู่ระหว่างการตรวจสอบACTION_REQUIRED
: ข้อมูลนี้อยู่ในInStock.state
สำหรับผู้ขาย GHLSF เท่านั้น ซึ่งหมายความว่าคุณต้องขอการยืนยันสินค้าคงคลังเพื่อให้ LIA แสดง
InventoryVerification.State
มีค่าต่อไปนี้
SUCCEEDED
: อนุมัติแล้วINACTIVE
: คุณพร้อมที่จะขอการยืนยันสินค้าคงคลังแล้วRUNNING
: อยู่ระหว่างตรวจสอบSUSPENDED
: คุณไม่ผ่านการยืนยันสินค้าคงคลังหลายครั้งเกินไป (โดยปกติแล้วคือ 5 ครั้ง) และต้องรอก่อนจึงจะขอรับการยืนยันอีกครั้งได้ACTION_REQUIRED
: คุณต้องดำเนินการเพิ่มเติมก่อนขอรับการยืนยันสินค้าคงคลัง
แก้ปัญหาเกี่ยวกับ OmnichannelSettings
API
ส่วนนี้จะอธิบายวิธีแก้ปัญหาที่พบได้ทั่วไป
สร้างการตั้งค่าการเข้าถึงลูกค้าจากทุกช่องทาง (Omnichannel)
- อย่าลืมตั้งค่าทั้ง
LsfType
และRegionCode
- หากเลือก
GHLSF
ให้ใส่InStock
ว่างเปล่าในคำขอ - หากเลือกประเภท LSF ที่โฮสต์โดยผู้ขาย ให้ระบุ URI อย่างน้อย 1 รายการใน
InStock
หรือPickup
อัปเดตการตั้งค่าช่องทางรวม
วิธีการอัปเดตสำหรับทรัพยากรนี้ต้องใช้กฎเพิ่มเติมต่อไปนี้
- คุณจะแก้ไขรหัสภูมิภาคไม่ได้
- คุณจะอัปเดตไม่ได้ขณะที่ฟีเจอร์ LIA/FLL ทำงานอยู่หรือได้รับอนุมัติแล้ว
- เมื่อเปลี่ยนจาก LSF ประเภทที่โฮสต์โดยผู้ขายเป็น
GHLSF
หากก่อนหน้านี้มีการกําหนดค่าInStock
และPickup
ไว้ คุณต้องรวม LSF ดังกล่าวไว้ในมาสก์การอัปเดตพร้อมกับการอัปเดต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
ให้ทำดังนี้
- สําหรับผู้ขายในเยอรมนี สวิตเซอร์แลนด์ และออสเตรีย: ตรวจสอบว่าคุณได้ดำเนินการตรวจสอบหน้า "เกี่ยวกับ" จนเสร็จสมบูรณ์แล้ว
- ระบบจะใช้เวลาประมาณ 48 ชั่วโมง
- ในกรณีที่การตรวจสอบสินค้าคงคลังไม่สำเร็จซ้ำๆ (มากกว่า 5 ครั้ง) บริการจะบังคับใช้ระยะเวลาพัก 30 วันก่อนที่จะอนุญาตคำขออีกครั้ง โปรดติดต่อทีมสนับสนุนของ Google หากต้องการขอรับเงินคืนล่วงหน้า
ดูข้อมูลเพิ่มเติม
ดูรายละเอียดเพิ่มเติมได้ที่ศูนย์ช่วยเหลือเกี่ยวกับโฆษณาสินค้าคงคลังในร้านและข้อมูลในร้านที่แสดงฟรี