Skip to content

Latest commit

 

History

History
61 lines (48 loc) · 1.59 KB

_product-custom-fields.md

File metadata and controls

61 lines (48 loc) · 1.59 KB

Product custom fields

The product custom fields API allows you to view the custom field names that have been recorded.

Product custom fields properties

Attribute Type Description
key string The custom field key.
value string The value set for the key.

Retrieve product custom field names

This API lets you retrieve filtered custom field names.

GET
/wp-json//wc/v3/products/custom-fields/names
curl https://example.com/wp-json/wc/v3/products/custom-fields/names \
	-u consumer_key:consumer_secret
WooCommerce.get("products/custom-fields/names")
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error.response.data);
  });
<?php print_r($woocommerce->get('products/custom-fields/names')); ?>
print(wcapi.get("products/custom-fields/names").json())
woocommerce.get("products/custom-fields/names").parsed_response

JSON response example:

{
	[
		"Custom field 1",
		"Custom field 2",
		"Custom field 3",
		"Custom field 4"
	]
}