Custom Field PATCH

URI

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

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

Description

This message enables you to edit custom fields for an existing product. The fields available to a product are defined from within the application and cannot be altered here. You can use a single PATCH call to execute a batch of operations.

A product custom field PATCH request allows you to update fields on an individual basis, leaving all other fields as they were. Please refer to the HTTP PATCH documentation for an explanation of the operations and syntax of, and reasons behind, HTTP PATCH.

If successful, this endpoint returns the new state of the product's custom fields, as if you had performed a product custom fields GET.

Example

Updating Product 3158 - replace PCF_CLNOTE value, add new PCF_WIDTH, PCF_DESCRIPT, PCF_TYPE entries. Not that PCF_TYPE is a select field so you must supply an object containing the desired ID.

Request URI

/product/3158/custom-field

Request body

[
	{
		"op": "replace",
		"path": "/PCF_CLNOTE",
		"value": "This is a note"
	},
	{
		"op": "add",
		"path": "/PCF_WIDTH",
		"value": 100
	},
	{
		"op": "add",
		"path": "/PCF_DESCRIPT",
		"value": "This is a description"
	},
	{
		"op": "add",
		"path": "/PCF_TYPE",
		"value": {
			"id": 36
		}
	}
]

Response

{
	"response": {
		"PCF_CLNOTE": "This is a note",
		"PCF_DESCRIPT": "This is a description",
		"PCF_WIDTH": 100,
		"PCF_TYPE": {
			"id": 36,
			"value": "Plain"
		}
	}
}