با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
برای آزمایش کدی که از Content API برای خرید استفاده میکند، پیشنهاد میکنیم یک حساب Merchant Center جداگانه ایجاد کنید که صرفاً به آزمایش اختصاص داده شود. این به شما امکان میدهد هم آزمایشهای دستی و هم خودکار را برای کدهایی که از Content API برای خرید استفاده میکنند، بدون تأثیر بر فیدهای فعال یا کمپینهای خرید، اجرا کنید.
محیط تست خود را تنظیم کنید
یک حساب Google جدید ایجاد کنید که با حساب Merchant Center مرتبط شود. برای مراحل زیر وارد حساب کاربری جدید گوگل شوید و از آن استفاده کنید.
برای راهاندازی حساب Merchant Center جدید، مراحل آغاز به کار را دنبال کنید. برای حساب آزمایشی نیازی به تأیید اعتبار URL وب سایت ندارید.
برای کدی که قصد آزمایش آن را دارید، اعتبارنامه های مناسب ایجاد کنید. برای کد آزمایشی، پیشنهاد میکنیم از جریان حساب خدماتی که در راهنمای حسابهای سرویس توضیح داده شده است برای چارچوب آزمایشی خود استفاده کنید تا مجبور نشوید با درخواست مجوز، نشانههای دسترسی، و نشانههای تازهسازی مواجه شوید.
با حساب و اعتبارنامه Merchant Center جدید خود، باید آماده آزمایش کد خود با Content API برای خرید باشید. اگر به تازگی با Content API شروع کرده اید، راهنمای شروع کار را بخوانید تا نحوه استفاده از محیط آزمایشی خود را با کتابخانه کلاینت پایتون بیاموزید، یا از صفحه نمونه ها و کتابخانه های ما دیدن کنید، جایی که می توانید نمونه کدهایی را بیابید که با آن می توانید محیط آزمایشی جدید خود را آزمایش کنید.
API همچنان بررسیهای اعتبارسنجی را انجام میدهد، که بازخورد خطاهای رایج مانند از دست دادن فیلدهای ضروری را ارائه میدهد، اما بررسیهای کیفیت دادهها انجام نمیشود، زیرا هر محصول آپلود شده بهطور خودکار تأیید نمیشود.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe Merchant API is the new version of the Content API for Shopping and represents the future of the platform.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers are encouraged to create a separate Merchant Center account solely for testing the API to avoid impacting live data.\u003c/p\u003e\n"],["\u003cp\u003eSetting up a test environment involves creating a new Google account, Merchant Center account, and developer project with the Content API enabled.\u003c/p\u003e\n"],["\u003cp\u003eWhile data quality checks aren't performed on test accounts, the API still conducts validation checks to provide feedback on errors.\u003c/p\u003e\n"],["\u003cp\u003eTesting accounts will eventually be suspended due to invalid product information, which is expected and won't affect Content API testing.\u003c/p\u003e\n"]]],["The Merchant API beta, the new version of the Content API for Shopping, is introduced. To test this API, create a separate Merchant Center test account. This includes creating a new Google account, setting up a new Merchant Center account without website validation, and creating a new developer project to enable the Content API. Generate credentials, ideally using service accounts, for testing. Note that the test account will likely be suspended for invalid products, but this will not impact the API testing.\n"],null,["# Test your code\n\nTo test code that uses the Content API for Shopping, we suggest creating a\nseparate Merchant Center account devoted solely to testing. This lets you run\nboth manual and automated tests for code that uses the Content API for Shopping\nwithout impacting active feeds or Shopping campaigns.\n\nSet up your test environment\n----------------------------\n\n1. [Create a new Google account](//support.google.com/accounts/answer/27441)\n that will be associated with the Merchant Center account. Sign in to and use\n the new Google account for the following steps.\n\n2. Follow the steps in [Getting Started](/shopping-content/guides/quickstart) to\n set up a new Merchant Center account. You don't need to validate the website\n URL for the testing account.\n\n3. [Create a new developer\n project](/shopping-content/guides/quickstart#create-a-google-api-console-project)\n in the [API Console](//console.developers.google.com/), and enable the Content\n API for Shopping for that project.\n\n4. Create appropriate credentials for the code you plan to test. For test code,\n we suggest you use the service account flow described in the [Service Accounts\n guide](/shopping-content/guides/how-tos/service-accounts) for your testing\n framework to avoid having to deal with requesting permission, access tokens,\n and refresh tokens.\n\nWith your new Merchant Center account and credentials, you should be ready to\ntest your code with the Content API for Shopping. If you're just getting\nstarted with the Content API, read the [Getting Started\nguide](/shopping-content/guides/quickstart) to learn how to use your test\nenvironment with the Python client library, or visit our [Samples and Libraries\npage](/shopping-content/guides/libraries), where you can find code examples\nwith which you can test your new test environment.\n| **Note:** We expect that you won't be using a valid storefront website URL for your testing Merchant Center, so your account will eventually be suspended for invalid products.This is expected and won't affect your testing of the Content API.\n\nThe API will still perform validation checks, which provide\nfeedback to common errors such as missing required fields, but data quality\nchecks won't be performed, as any uploaded products will be automatically\ndisapproved."]]