Custom Field Metadata GET

URI

https://{DATACENTER}.brightpearl.com/public-api/{ACCOUNT}
/product-service/product/custom-field-meta-data/{ID-SET}

Refer to our documentation on URI syntax for more information on how to construct URIs.

Description

Returns the metadata which describes the available products custom fields. The values held in these fields for a given product can be viewed and manipulated by product custom field GET & PATCH operations.

Fields returned:

Field Data type Description
id Integer Unique ID of custom field
code String Unique user-determined key
name String Name of custom field
customFieldType String Type of custom field (see below)
required Boolean Whether or not all new products must be created with this field set
options Object Options only applies to the "SELECT" data type, which allows only enumerated values. It is a map of all the available values.

There are several custom field data types available:

  • TEXT - a simple string
  • TEXT_AREA - a complex string (multi-line, markup, etc)
  • YES_NO - boolean true or false
  • INTEGER - an integer
  • DATE - ISO 8601 date
  • SELECT - an value chosen from an enumeration

Example

Requesting all product metadata

Request URI

/product/custom-field-meta-data

Response

{
	"response": [
		{
			"id": 2,
			"code": "PCF_TEXT",
			"name": "Text",
			"customFieldType": "TEXT",
			"required": false
		},
		{
			"id": 3,
			"code": "PCF_NUMERIC",
			"name": "Numeric",
			"customFieldType": "INTEGER",
			"required": false
		},
		{
			"id": 4,
			"code": "PCF_YESNO",
			"name": "YESNO",
			"customFieldType": "YES_NO",
			"required": false
		},
		{
			"id": 5,
			"code": "PCF_SELECT",
			"name": "Select",
			"customFieldType": "SELECT",
			"required": false,
			"options": {
				"5": {
					"id": 5,
					"value": "John"
				},
				"6": {
					"id": 6,
					"value": "Paul"
				},
				"7": {
					"id": 7,
					"value": "George"
				},
				"8": {
					"id": 8,
					"value": "Ringo"
				}
			}
		},
		{
			"id": 6,
			"code": "PCF_TEXTAREA",
			"name": "Text Area",
			"customFieldType": "TEXT_AREA",
			"required": false
		},
		{
			"id": 7,
			"code": "PCF_DATE",
			"name": "Date",
			"customFieldType": "DATE",
			"required": false
		}
	]
}