To effectively use Merchant API, it's important to understand the concepts of registration, authentication, and authorization . They serve distinct purposes in ensuring secure and correct access to Merchant Center data.
اصطلاحات
ثبت، احراز هویت و مجوز مرتبط هستند، اما هر کدام معنا و هدف متمایزی دارند.
- Authentication : In this process the service verifies the identity of the user or application making an API request. Merchant API uses standard Google mechanisms like OAuth 2.0 . Using API keys for authentication is not supported, and results in authentication errors. For more information, see Authenticate requests and Authenticate as your own account .
- Authorization : This process determines what actions the authenticated user or application is permitted to perform using a Merchant Center account. It answers the question: "What can you do?" based on the roles and permissions granted to the authenticated user within the Merchant Center account. For example, a user might be authorized to read product data, but not to modify account settings.
- Registration : With respect to Merchant API, this is a one-time setup process that lets Google send you important service announcements for the merchant accounts you manage. Registration adds your developer email addresses to your main Merchant Center account and links it to the Google Cloud Project ID(s) you use for authentication. This linkage lets your application, receive service announcements for all the merchant accounts you manage. For more information, see Create a Google Cloud Project .
ثبت نام
فرآیند ثبت نام برای فعال کردن برنامه شما جهت استفاده از Merchant API بسیار مهم است. در اینجا مواردی که باید بدانید آورده شده است:
پیشنیازها
ثبت نام برای استفاده از Merchant API مستلزم موارد زیر است:
- حساب مرکز تجاری : شما به یک حساب مرکز تجاری موجود نیاز دارید.
- دسترسی ادمین: حساب کاربری گوگلی که برای شروع فرآیند ثبت نام استفاده میکنید، باید در حساب مرکز تجاری که ثبت میکنید، دارای دسترسی ادمین باشد.
- Google Cloud Project : Your application must be associated with a Google Cloud Project. This project provides the necessary credentials (like OAuth 2.0 Client IDs) for your application to authenticate.
چرا نمیتوانید یک پروژه مشترک Google Cloud ثبت کنید؟
ابزارهایی مانند Google OAuth Playground و APIs Explorer از پروژههای مشترک Google Cloud متعلق به گوگل استفاده میکنند. شما نمیتوانید در پروژههای مشترک ثبتنام کنید زیرا:
- آنها برای آزمایش و اکتشاف در نظر گرفته شدهاند، نه برای هویت برنامه کاربردی در مرحله تولید.
- ثبت آنها به معنای ایجاد ارتباط بین ابزار مشترک و دادههای خاص مرکز فروشندگان شما خواهد بود و ممکن است منجر به ارتباطات ناخواسته شود.
برنامه شما به پروژه اختصاصی گوگل کلود خود نیاز دارد تا ارتباطات API فروشنده که گوگل برای شما ارسال میکند، برای استفاده واقعی شما مرتبط باقی بماند.
با این وجود، میتوانید از برنامههای وب OAuth Playground و API Explorer برای استفاده از Merchant API برای آزمایش و موارد استفاده غیر تولیدی استفاده کنید.
شناسه پروژه گوگل کلود خود را پیدا کنید
میتوانید شناسه پروژه و شماره پروژه خود را در کنسول گوگل کلود پیدا کنید. برای جزئیات بیشتر، به بخش «یافتن نام، شماره و شناسه پروژه » مراجعه کنید.
تماس ثبت نام را برقرار کنید
با استفاده از متد registerGcp در زیر-API Accounts ، ثبتنام کنید. این فراخوانی، شماره پروژه گوگل کلود شما را با حساب مرکز فروشندگان مرتبط میکند.
During the process, you should provide an email address associated with an individual user that you use to call the API. This email must belong to a user with Admin access to the Merchant Center account.
درباره فیلد ایمیل
Effective communication is key. Google sends important updates, Mandatory Service Announcements (MSAs), developer surveys, and other opportunities related to the Merchant API. Proper contact management ensures that these reach the right people.
- هدف : گوگل از این آدرس ایمیل به عنوان مخاطب اصلی برای ارتباطات مرتبط با API استفاده میکند.
- ایمیل چه کسی : این باید آدرس ایمیل یک توسعهدهنده یا یک رابط فنی کلیدی باشد که مسئول ادغام API است.
- بهترین شیوهها :
- انجام دهید : از آدرس ایمیل شرکتی یک فرد استفاده کنید.
- انجام ندهید : از نامهای مستعار عمومی گروه یا ایمیلهای حسابهای کاربری سرویس استفاده نکنید. هدف ما ارتباطات برای گیرندگان انسانی است.
منبع users برای مدیریت مخاطبین
While the email address in the registration call sets an initial contact, the more robust way to manage contacts and permissions is using the Merchant API accounts.users resource or the user management settings in the Merchant Center UI. For more information on using Merchant Center, see Manage people on your account .
از این امکانات به شرح زیر بهره ببرید:
- اضافه کردن همه توسعهدهندگان : توسعهدهندگانی که روی ادغام API کار میکنند را به عنوان کاربران حساب مرکز فروشندگان اضافه کنید.
- Assign the
API_DEVELOPERrole : Besides standard roles ( Admin , Standard ), you can assign users theAPI_DEVELOPERrole. In particular, assign this role to users who should receive API-related communications. You can combine it with other roles. - مزایا :
- جداسازی واضح : مدیریت تماس API را از ثبت نام یکباره جدا میکند.
- انعطافپذیری : بهروزرسانی مخاطبین با تغییر اعضای تیم.
- ارتباط هدفمند : تضمین میکند که اخبار مربوط به API به افراد مرتبط میرسد.
حتی اگر هنگام ثبت نام آدرس ایمیل ارائه داده باشید، اکیداً توصیه میکنیم با اضافه کردن کاربرانی با نقش API_DEVELOPER ، مخاطبین API را مدیریت کنید.
منابع
برای اطلاعات بیشتر، به موارد زیر مراجعه کنید: