rocket Meet
Merchant API - جانشین رسمی Content API برای خرید.
update جدیدترین ویژگیهای Merchant API، رفع اشکالها و بهروزرسانیها
را دریافت کنید .
add_alert توجه: Content API برای خرید در 18 اوت 2026 غروب میکند.
تست منابع محصولات
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
در اینجا چند نمونه وجود دارد که می توانید از آنها برای آزمایش پیاده سازی خود با منبع products
استفاده کنید.
یک محصول اضافه کنید
JSON معتبر برای یک محصول بسازید.
با اطلاعات محصول و شناسه فروشنده خود، درخواست insert
کنید:
POST https://shoppingcontent.googleapis.com/content/v2.1/merchantId/products
بررسی کنید که کد وضعیت HTTP 200
را دریافت کرده اید.
مشاهده یک محصول
با شناسه فروشنده خود و شناسه محصول محصول درخواست get
کنید:
GET https://shoppingcontent.googleapis.com/content/v2.1/merchantId/products/productId
بررسی کنید که کد وضعیت HTTP 200
و دادههای JSON محصول را دریافت میکنید.
یک محصول را به روز کنید
JSON جدید را برای یک محصول بسازید. به عنوان مثال، یک فیلد را در JSON availability: in stock
، به availability: out of stock
برای محصولی که برای آزمایش insert
تماس استفاده کردید، تغییر دهید.
با اطلاعات محصول جدید و شناسه فروشنده خود، درخواست insert
کنید:
POST https://shoppingcontent.googleapis.com/content/v2.1/merchantId/products
بررسی کنید که کد وضعیت HTTP 200
را دریافت کرده اید. پس از حداقل پنج دقیقه، میتوانید درخواست get
دیگری را برای تأیید ارزش بهروزرسانی شده ارسال کنید، availability: out of stock
، اعمال شد.
حذف یک محصول
با شناسه فروشنده خود و productId
محصول محصول درخواست delete
کنید:
DELETE https://shoppingcontent.googleapis.com/content/v2.1/merchantId/products/productId
بررسی کنید که کد وضعیت HTTP 204
را دریافت کرده اید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThis page provides examples of how to interact with the \u003ccode\u003eproducts\u003c/code\u003e resource using the Content API for Shopping.\u003c/p\u003e\n"],["\u003cp\u003eYou can add a new product by constructing valid JSON and making an \u003ccode\u003einsert\u003c/code\u003e request.\u003c/p\u003e\n"],["\u003cp\u003eView an existing product using a \u003ccode\u003eget\u003c/code\u003e request with your merchant ID and the product ID.\u003c/p\u003e\n"],["\u003cp\u003eUpdate a product's information by making an \u003ccode\u003einsert\u003c/code\u003e request with the updated JSON data.\u003c/p\u003e\n"],["\u003cp\u003eDelete a product using a \u003ccode\u003edelete\u003c/code\u003e request with your merchant ID and the product ID.\u003c/p\u003e\n"]]],["To add a product, create valid JSON for it, then send an `insert` request via POST with the data and merchant ID, expecting an `HTTP 200` response. To view, send a `get` request via GET with the merchant ID and product ID, confirming an `HTTP 200` status and the JSON. To update, create new JSON, make an `insert` POST request, and verify `HTTP 200` then check with `get`. To delete, send a `delete` request via DELETE with the ID, verifying an `HTTP 204` status.\n"],null,["# Testing the products resource\n\nHere are some examples you can use to test your implementation with the\n`products` resource.\n\nAdd a product\n-------------\n\n1. Construct [valid JSON for a\n product](/shopping-content/reference/rest/v2.1/products#resource:-product).\n\n2. Make an [`insert`\n request](/shopping-content/reference/rest/v2.1/products/insert#http-request)\n with the product data and your merchant ID:\n\n POST https://shoppingcontent.googleapis.com/content/v2.1/\u003cvar translate=\"no\"\u003emerchantId\u003c/var\u003e/products\n\n3. Verify that you receive an `HTTP 200` status code.\n\nView a product\n--------------\n\n1. Make a [`get`\n request](/shopping-content/reference/rest/v2.1/products/get#http-request)\n with your merchant ID, and the product's\n [productId](/shopping-content/guides/products/product-id):\n\n GET https://shoppingcontent.googleapis.com/content/v2.1/\u003cvar translate=\"no\"\u003emerchantId\u003c/var\u003e/products/\u003cvar translate=\"no\"\u003eproductId\u003c/var\u003e\n\n2. Verify that you receive an `HTTP 200` status code, and the JSON data for the\n product.\n\nUpdate a product\n----------------\n\n1. Construct the new JSON for a product. For example, change a single field in\n the JSON `availability: in stock`, to `availability: out of stock` for the\n product you used to test the `insert` call.\n\n2. Make an [`insert`\n request](/shopping-content/reference/rest/v2.1/products/insert#http-request)\n with the new product data and your merchant ID:\n\n POST https://shoppingcontent.googleapis.com/content/v2.1/\u003cvar translate=\"no\"\u003emerchantId\u003c/var\u003e/products\n\n3. Verify that you receive an `HTTP 200` status code. After at least five\n minutes, you can make another `get` request to confirm the updated value,\n `availability: out of stock`, was applied.\n\nDelete a product\n----------------\n\n1. Make a [`delete`\n request](/shopping-content/reference/rest/v2.1/products/delete#http-request)\n with your merchant ID, and the product's\n [`productId`](/shopping-content/guides/products/product-id):\n\n DELETE https://shoppingcontent.googleapis.com/content/v2.1/\u003cvar translate=\"no\"\u003emerchantId\u003c/var\u003e/products/\u003cvar translate=\"no\"\u003eproductId\u003c/var\u003e\n\n2. Verify that you receive an `HTTP 204` status code."]]