# Hướng dẫn sử dụng curl tạo webhook sau đó cập nhật dữ liệu nó ghi ra file log (ok)

C:\xampp\htdocs\wordpress4\wp-content\themes\gutener\functions.php

```
add_filter( 'woocommerce_rest_check_permissions', 'my_woocommerce_rest_check_permissions', 90, 4 );
function my_woocommerce_rest_check_permissions( $permission, $context, $object_id, $post_type  ){
  return true;
}
```

C:\xampp\htdocs\wordpress4\woocommerce\request.log

```
{
	"id": 13,
	"name": "Testing",
	"slug": "testing",
	"permalink": "http:\/\/localhost\/wordpress4\/product\/testing\/",
	"date_created": "2022-04-19T06:54:01",
	"date_created_gmt": "2022-04-19T06:54:01",
	"date_modified": "2022-04-19T08:46:06",
	"date_modified_gmt": "2022-04-19T08:46:06",
	"type": "simple",
	"status": "publish",
	"featured": false,
	"catalog_visibility": "visible",
	"description": "<p>Testing c123<\/p>\n",
	"short_description": "",
	"sku": "",
	"price": "",
	"regular_price": "",
	"sale_price": "",
	"date_on_sale_from": null,
	"date_on_sale_from_gmt": null,
	"date_on_sale_to": null,
	"date_on_sale_to_gmt": null,
	"on_sale": false,
	"purchasable": false,
	"total_sales": 0,
	"virtual": false,
	"downloadable": false,
	"downloads": [],
	"download_limit": -1,
	"download_expiry": -1,
	"external_url": "",
	"button_text": "",
	"tax_status": "taxable",
	"tax_class": "",
	"manage_stock": false,
	"stock_quantity": null,
	"backorders": "no",
	"backorders_allowed": false,
	"backordered": false,
	"low_stock_amount": null,
	"sold_individually": false,
	"weight": "",
	"dimensions":
	{
		"length": "",
		"width": "",
		"height": ""
	},
	"shipping_required": true,
	"shipping_taxable": true,
	"shipping_class": "",
	"shipping_class_id": 0,
	"reviews_allowed": true,
	"average_rating": "0.00",
	"rating_count": 0,
	"upsell_ids": [],
	"cross_sell_ids": [],
	"parent_id": 0,
	"purchase_note": "",
	"categories": [
	{
		"id": 15,
		"name": "Uncategorized",
		"slug": "uncategorized"
	}],
	"tags": [],
	"images": [],
	"attributes": [],
	"default_attributes": [],
	"variations": [],
	"grouped_products": [],
	"menu_order": 0,
	"price_html": "",
	"related_ids": [],
	"meta_data": [],
	"stock_status": "instock",
	"has_options": false,
	"_links":
	{
		"self": [
		{
			"href": "http:\/\/localhost\/wordpress4\/wp-json\/wc\/v3\/products\/13"
		}],
		"collection": [
		{
			"href": "http:\/\/localhost\/wordpress4\/wp-json\/wc\/v3\/products"
		}]
	}
}
```

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FJyiUcGi1S2Oqk86vIJxD%2FScreenshot_8.png?alt=media\&token=26e41459-b941-4628-be0b-bb3739238245)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FW3yt0QUxqxSf7ZcAzNDo%2FScreenshot_9.png?alt=media\&token=8c57349b-f975-4d62-84bf-0d0d577dd081)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FaVdw2SggxYTqbsTVNpLZ%2FScreenshot_10.png?alt=media\&token=063d4705-6e86-4363-b6fb-d76466baeddb)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FUzi1BBFSSqUj86qFJCpE%2FScreenshot_11.png?alt=media\&token=d1c5b577-12ee-41c6-811f-e4ceaa959bd6)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2F0Soge2WBTV4iMWmrgBRo%2FScreenshot_12.png?alt=media\&token=31525487-02d1-4541-9783-b8900cc02ad4)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FLv4zJL9rodClDtlfXr2O%2FScreenshot_13.png?alt=media\&token=4cb2c0bb-62da-4f4c-9bcd-88a5b22aebe9)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FxiN1NHlkavfyeIaWcTuV%2FScreenshot_14.png?alt=media\&token=9537c517-8df7-4ae2-923a-50c301d78131)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FwCeUzbwv6AN7qOWRcCkj%2FScreenshot_15.png?alt=media\&token=c022038b-b241-471f-af22-4cc9b2f89f25)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FU7R43btL7rJX9GRIiqhW%2FScreenshot_16.png?alt=media\&token=473c4408-b88b-4502-9079-957fc90d91dc)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FSUqClh3kL8w9w0rvCrFa%2FScreenshot_17.png?alt=media\&token=58e011e4-3f16-4893-97c4-204f21c0047f)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FwByJtP3HfTssSRx0Az3a%2FScreenshot_18.png?alt=media\&token=80a25952-9b9a-49b1-b966-e5743634bbe3)

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FkrJIoifiI5J0yhV9ELeF%2FScreenshot_19.png?alt=media\&token=ab76a71d-d86f-4a07-a17e-770e465eac76)

C:\xampp\htdocs\wordpress4\woocommerce\request.log

```
{
	"id": 13,
	"name": "Test",
	"slug": "testing",
	"permalink": "http:\/\/localhost\/wordpress4\/product\/testing\/",
	"date_created": "2022-04-19T06:54:01",
	"date_created_gmt": "2022-04-19T06:54:01",
	"date_modified": "2022-04-19T09:04:55",
	"date_modified_gmt": "2022-04-19T09:04:55",
	"type": "simple",
	"status": "publish",
	"featured": false,
	"catalog_visibility": "visible",
	"description": "<p>Test QA<\/p>\n",
	"short_description": "",
	"sku": "",
	"price": "",
	"regular_price": "",
	"sale_price": "",
	"date_on_sale_from": null,
	"date_on_sale_from_gmt": null,
	"date_on_sale_to": null,
	"date_on_sale_to_gmt": null,
	"on_sale": false,
	"purchasable": false,
	"total_sales": 0,
	"virtual": false,
	"downloadable": false,
	"downloads": [],
	"download_limit": -1,
	"download_expiry": -1,
	"external_url": "",
	"button_text": "",
	"tax_status": "taxable",
	"tax_class": "",
	"manage_stock": false,
	"stock_quantity": null,
	"backorders": "no",
	"backorders_allowed": false,
	"backordered": false,
	"low_stock_amount": null,
	"sold_individually": false,
	"weight": "",
	"dimensions":
	{
		"length": "",
		"width": "",
		"height": ""
	},
	"shipping_required": true,
	"shipping_taxable": true,
	"shipping_class": "",
	"shipping_class_id": 0,
	"reviews_allowed": true,
	"average_rating": "0.00",
	"rating_count": 0,
	"upsell_ids": [],
	"cross_sell_ids": [],
	"parent_id": 0,
	"purchase_note": "",
	"categories": [
	{
		"id": 15,
		"name": "Uncategorized",
		"slug": "uncategorized"
	}],
	"tags": [],
	"images": [],
	"attributes": [],
	"default_attributes": [],
	"variations": [],
	"grouped_products": [],
	"menu_order": 0,
	"price_html": "",
	"related_ids": [],
	"meta_data": [],
	"stock_status": "instock",
	"has_options": false,
	"_links":
	{
		"self": [
		{
			"href": "http:\/\/localhost\/wordpress4\/wp-json\/wc\/v3\/products\/13"
		}],
		"collection": [
		{
			"href": "http:\/\/localhost\/wordpress4\/wp-json\/wc\/v3\/products"
		}]
	}
}
```
