Custom Field Metadata GET

URI

https://{DATACENTER}.brightpearl.com/public-api/{ACCOUNT}
/contact-service/{customer|supplier}/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 custom fields. The values held in these fields for a given contact can be manipulated via contact custom field GET & PATCH operations.

Custom fields are separated between Supplier contacts and Customer contacts, and may only be assigned to one of these groups. You must specify which group's custom fields you are requesting in the request URL. You can optionally specify an ID set to request only custom fields with particular IDs.

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 contacts 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
  • TEXTAREA - a complex string (multi-line, markup, etc)
  • YESNO - boolean true or false
  • INTEGER - an integer
  • DATE - ISO 8601 date
  • SELECT - an value chosen from an enumeration

Example

Requesting all supplier custom field metadata

Request URI

/supplier/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": "Thom"
				},
				"6": {
					"id": 6,
					"value": "Jonny"
				},
				"7": {
					"id": 7,
					"value": "Ed"
				},
				"8": {
					"id": 8,
					"value": "Phil"
				},
				"9": {
					"id": 9,
					"value": "Colin"
				}
			}
		},
		{
			"id": 6,
			"code": "PCF_TEXTAREA",
			"name": "Text Area",
			"customFieldType": "TEXT_AREA",
			"required": false
		},
		{
			"id": 7,
			"code": "PCF_DATE",
			"name": "Date",
			"customFieldType": "DATE",
			"required": false
		}
	]
}