حساب سرویس نوع خاصی از حساب است که معمولاً توسط یک برنامه کاربردی به جای یک شخص استفاده می شود. یک حساب کاربری با آدرس ایمیل آن مشخص می شود که مختص آن حساب است.
یک پروژه را در منوی کشویی در بالای صفحه انتخاب کنید یا برای ایجاد پروژه جدید روی پروژه جدید کلیک کنید.
Merchant API را در لیست APIهای Google جستجو کنید و مطمئن شوید که برای این پروژه فعال است.
روی Manage کلیک کنید.
در نوار کناری سمت چپ، اعتبارنامه ها را انتخاب کنید. ممکن است لازم باشد روی فلش سمت چپ در سمت چپ بالای صفحه کلیک کنید تا اعتبارنامه ها را ببینید.
CREATE CREDENTIALS و سپس Service account را انتخاب کنید.
حساب سرویس را نام ببرید. این نام کاربری پیش فرض برای شناسه حساب سرویس است. شناسه حساب سرویس، از جمله قسمت بعد از نویسه «@» را برای استفاده بعدی ذخیره کنید.
روی ایجاد کلیک کنید، مراحل اختیاری را برای اعطای دسترسی به پروژه و کاربران طی کنید، سپس روی انجام شد کلیک کنید.
یک کلید خصوصی JSON دریافت کنید
یک کلید خصوصی JSON برای حساب سرویس خود در کنسول API Google ایجاد کنید:
روی حساب سرویس کلیک کنید، سپس برگه KEYS را انتخاب کنید.
روی افزودن کلید > ایجاد کلید جدید کلیک کنید.
JSON را به عنوان نوع کلید انتخاب کنید.
برای دانلود کلید خصوصی روی CREATE کلیک کنید. توجه: تنها زمانی می توانید کلید خصوصی را دانلود کنید که ایجاد شود. بعداً نمی توانید به این مرحله برگردید.
به حساب خدمات اجازه دسترسی به حساب Merchant Center خود را بدهید
حساب سرویس جدید را به عنوان کاربر به حساب Merchant Center خود اضافه کنید:
در منوی کشویی، روی افراد کلیک کنید و به آن دسترسی داشته باشید .
روی افزودن شخص کلیک کنید و شناسه حساب سرویس خود را به عنوان آدرس ایمیل شخص جدید وارد کنید.
اگر شناسه حساب سرویس خود را ذخیره نکردهاید، به صفحه مدیریت حسابهای سرویس بروید و پروژه خود را انتخاب کنید.
تنظیمات برگزیده دسترسی کاربر و اعلانهای ایمیل را برای حساب سرویس مشخص کنید.
برای ذخیره و بازگشت به لیست کاربران روی افزودن کاربر کلیک کنید. اکنون شناسه حساب سرویس باید با نقش کاربر انتخابی فهرست شود.
میتوانید این مراحل را برای همه حسابهای خدماتی که نیاز به دسترسی به دادههای حساب Merchant Center شما دارند، تکرار کنید.
سوالات متداول
آیا می توانم با حساب سرویس خود وارد رابط کاربری Merchant Center شوم؟
خیر، حسابهای سرویس، حسابهای Google معمولی نیستند و نمیتوانند به رابط کاربری Merchant Center دسترسی داشته باشند.
هر چند وقت یکبار باید نشانههای دسترسی به حساب سرویس را بازخوانی کنم؟
توکنهای دسترسی یک ساعت پس از صدور توسط سرور مجوز Google OAuth 2.0 منقضی میشوند. هنگامی که یک نشانه دسترسی منقضی می شود، برنامه باید از کتابخانه مشتری برای واکشی نشانه دسترسی دیگری استفاده کند. برای بازخوانی دستی رمز خود، فایل stored-token.json را حذف کرده و دوباره احراز هویت کنید.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eUse a service account to grant an application access to your own Merchant Center account.\u003c/p\u003e\n"],["\u003cp\u003eService accounts are identified by unique email addresses and require a JSON private key for authentication.\u003c/p\u003e\n"],["\u003cp\u003eTo use a service account, you need to create it in the Google API Console, grant it access to your Merchant Center account, and download its private key.\u003c/p\u003e\n"],["\u003cp\u003eThird-party applications should use OAuth for client account access instead of service accounts.\u003c/p\u003e\n"],["\u003cp\u003eService accounts cannot be used to sign in to the Merchant Center UI.\u003c/p\u003e\n"]]],[],null,["# Authorize access to your Merchant Center account\n\nYou can use a\n[service account](//cloud.google.com/iam/docs/service-account-overview) to\nauthorize Merchant API access to your own Merchant Center account. See\n[authorize third-party app access to Merchant Center accounts](/merchant/api/guides/authorization/access-client-accounts)\nif your app needs to access your clients' Merchant Center accounts.\n\nA service account is a special kind of account, typically used by an application\nrather than a person. A service account is identified by its email address,\nwhich is unique to the account.\n\nYou must have a\n[Merchant Center account](//support.google.com/merchants/answer/188924) before\nyou can complete these steps.\n\nCreate a service account\n------------------------\n\nGenerate service account credentials, or access the public credentials you've\nalready generated, then create an OAuth 2.0 Client ID:\n\n1. Go to the [Google API Console](//console.cloud.google.com/apis/library).\n2. Select a project in the drop-down menu at the top of the page, or click **NEW PROJECT** to create one.\n3. Search for Merchant API in the list of Google APIs, and make sure it's enabled for this project.\n4. Click **Manage**.\n5. In the sidebar on the left, select **Credentials** . You might need to click the left-pointing arrow at the top left of the page to see **Credentials**.\n6. Select **CREATE CREDENTIALS** , then **Service account**.\n7. Name the service account. This is the default username for the service account ID. Save the service account ID, including the part after the '@' character, for later use.\n8. Click **CREATE** , go through the optional steps to grant access to the\n project and users, then click **DONE**.\n\n | **Note:** The role you choose the service account doesn't affect Merchant API access. Access to Merchant API methods is determined by the role associated with the service account ID in Merchant Center. If you don't know what to pick, choose **Project \\\u003e Viewer**.\n\nGet a JSON private key\n----------------------\n\nGenerate a JSON private key for your service account in the in the\n[Google API Console](//console.cloud.google.com/apis/library):\n\n1. Click the service account, then select the **KEYS** tab.\n2. Click **ADD KEY \\\u003e Create new key**.\n3. Select **JSON** as the key type.\n4. Click **CREATE** to download the private key. Note: You can only download the private key when it's created. You can't come back to this step later.\n\nGive the service account access to your Merchant Center account\n---------------------------------------------------------------\n\nAdd the new service account as a user to your Merchant Center account:\n\n1. Sign in to [Merchant Center](//merchants.google.com).\n2. Click the **Settings \\& tools** icon settings.\n3. In the drop-down, click **People and access**.\n4. Click **Add person**, and enter your service account ID as the email address\n for the new person.\n\n If you didn't save your service account ID, go to the\n [Service Accounts](//console.developers.google.com/iam-admin/serviceaccounts/)\n administration page, and select your project.\n5. Specify the [**User access**](//support.google.com/merchants/answer/1637190)\n and **Email notifications** preferences for the service account.\n\n | **Note:** Services accounts need **Admin** access to manage Merchant Center account information and settings.\n6. Click **Add user** to save and return to the list of users.\n The service account ID should now be listed with the chosen user role.\n\nYou can repeat these steps for all service accounts that need to access your\nMerchant Center account data.\n| **Note:** If you're a third-party provider and don't have direct access to the Merchant Center account, ask your client to add the service account as a user in Merchant Center and tell them the service account ID. We recommend [oAuth](/merchant/api/guides/authorization/access-client-accounts) instead of service accounts for third-party access.\n\nFrequently asked questions\n--------------------------\n\nCan I sign in to the Merchant Center UI with my service account?\n: No, service accounts aren't regular Google Accounts and can't access the\n Merchant Center UI.\n\nHow often do I need to refresh service account access tokens?\n: Access tokens expire one hour after they're issued by the Google OAuth 2.0\n Authorization Server. When an access token expires, the application should\n use the client library to fetch another access token. To manually refresh\n your token, delete the `stored-token.json` file and re-authenticate."]]