Product OPTIONS

URI

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

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

Description

The Product OPTIONS messages allows you to programatically request a set of URIs you need to call if you would like to retrieve a large set of Products.

The method takes an optional ID Set of Product IDs. If you do not specify an ID Set then you are requesting all products.

This method exists as we limit the number of products you can request using the GET message to ease the load on our servers. The limit for one request is currently set to 200 products.

A typical scenario is that your Brightpearl account contains 20,000 product and you would like to request them all. You would make a call to the /product/ URI using OPTIONS. The response of the request will be a series of URIs. You will need to perform a Product GET on each of these to retrieve all your Products.

Example 1

Find URIs for all products. For this example I have created 2000 products and deleted some at random to simulate how your Product IDs might be dispersed.

Request URI

/product/

Response

{
	"response": {
		"getUris": [
			"/product/34-40,120,1000-1010,1030-1033,1070-1170,1180-1255",
			"/product/1256-1455",
			"/product/1456-1655",
			"/product/1656-1855",
			"/product/1856-2000"
		]
	}
}

Example 2

Requesting Product with IDs 1 to 150 and 250 to 500. As you can see I only have Products with IDs 34-40 and 120 within the given range.

Request URI

/product/1-150,250-500

Response

{
	"response": {
		"getUris": [
			"/product/34-40,120"
		]
	}
}