Order Row PATCH

URI

https://{DATACENTER}.brightpearl.com/public-api/{ACCOUNT}
/order-service/order/{ORDER-ID}/row/{ORDER-ROW-ID}

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

Description

Use order row PATCH to update individual fields of existing order rows while leaving the rest as they were. Refer to our HTTP PATCH documentation to see the benefits of PATCH over PUT and learn more about the unique syntax.

An order row may not be PATCHed if it belongs to an order which has been invoiced.

Not all order row fields can be updated. The following table lists the mutable fields and any restrictions:

Field Description Path (JSON pointer) Data type Notes
Quantity Number of items on this row. /quantity/magnitude Numeric (up to 4 d.p.)
  • Cannot be removed
  • Must be an integer when the row is for a stock-tracked product
  • You cannot revise the quantity below the number already reserved or fulfilled for that row
  • Changing an order row quantity of a partially shipped order may result in the order being marked as shipped
Row net value The net value of this row. /rowValue/rowNet/value Numeric (up to 4 d.p.)
  • Cannot be removed
Row tax value The tax value of this row. /rowValue/rowTax/value Numeric (up to 4 d.p.)
  • Cannot be removed
Nominal code The nominal code of this row. /nominalCode Numeric (4 digits)
  • Must be a valid nominal code
  • Cannot be removed
Tax calculator code A code specifying the tax calculation method to be used on this row (defaults to "brightpearl"). /rowValue/taxCalculator String
  • "replace" is currently the only allowed operation
  • This field can be already used by anyone but it is relevant only for accounts with external calculation enabled
  • Possible values:
    • brightpearl: for rows with taxes calculated by the brightpearl system
    • manual: for rows with manually overridden values
    • avalara: for rows with taxes calculated by the external system avalara (only for accounts with a working integration)
Order row sequence Order rows are positioned in ascending sequence number order. /orderRowSequence Numeric
  • Must be a valid integer value

The response to a successful request will be the new state of the order row.

Example

Updating order row 98 of order 45, set net to 19.80 and tax to 2.60

Request URI

/order/45/row/98

Request body

[
	{
		"op": "replace",
		"path": "/rowValue/rowNet/value",
		"value": "100.00"
	},
	{
		"op": "replace",
		"path": "/rowValue/rowTax/value",
		"value": "20.00"
	},
	{
		"op": "replace",
		"path": "/orderRowSequence",
		"value": "10"
	}
]

Response

{
	"response": {
		"orderRowSequence": "10",
		"productId": 3112,
		"productName": "Sunglasses",
		"productSku": "Add-Sun",
		"quantity": {
			"magnitude": "1.0000"
		},
		"itemCost": {
			"currencyCode": "GBP",
			"value": "10.0000"
		},
		"rowValue": {
			"taxRate": "20.0000",
			"taxCode": "T20",
			"taxCalculator": "brightpearl",
			"rowNet": {
				"currencyCode": "GBP",
				"value": "100.0000"
			},
			"rowTax": {
				"currencyCode": "GBP",
				"value": "20.0000"
			}
		},
		"nominalCode": "4000",
		"composition": {
			"bundleParent": false,
			"bundleChild": false,
			"parentOrderRowId": 0
		}
	}
}