Sales Order GET

URI

https://{DATACENTER}.brightpearlconnect.com/public-api/{ACCOUNT}
/order-service/sales-order/{ID-SET}

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

Description

This message enables you to obtain sales orders.

Field summary: sales order

For descriptions of writable fields, see the sales order POST documentation. Optional fields which have no value are omitted from the JSON response rather than returned with a null value.

Although address country codes may be supplied to POST in either ISO 3166-1 alpha-2 or alpha-3 format, GET returns each address.countryIsoCode in alpha-2 format.

taxDate, paymentDueDate, invoice.taxDate and invoice.dueDate are returned as ISO 8601 date-times.

Read-only fields

Field Type Description
id integer The ID of the sales order.
version integer The current version of the sales order.
parentId integer The ID of the parent order, or 0 when there is no parent.
externalRef string The external reference associated with the order.
installedIntegrationInstanceId integer The installed integration instance associated with the order.
createdOn string (ISO date time) The time at which this order was first created.
createdBy integer The ID of the user which first created this order.
updatedOn string (ISO date time) The time at which this order was most recently updated.
invoice.dueDate string (ISO date time) The date on which payment is due. This duplicates the writeable top-level paymentDueDate value.
invoice.invoiceReference string The invoice reference associated with the order.
invoice.taxDate string (ISO date time) The invoice tax date. This contains the same stored value as the top-level taxDate.
originalInvoiceDate string (ISO date time) The original invoice date. This field is omitted when the order has no original invoice date.
cloned boolean Whether the order is marked as a clone.
costPriceListId integer The ID of the cost price list associated with the order.
total object The total value of the order, broken down into:
  • net - total excluding tax in order currency
  • tax - total tax in order currency
  • gross - total including tax in order currency
  • baseNet - total excluding tax in base currency
  • baseTax - total tax in base currency
  • baseGross - total including tax in base currency
isCanceled Boolean Whether or not the order status is canceled. Null if canceled status is not configured.
orderPaymentStatus string The payment status code of the order. See Payment Status Codes for description.
allocationStatusCode string. 3 chars. The stock allocation status code of the order. See Stock Allocation Codes for description.
stockStatusCode string. 3 chars. The fulfilment status code of the order. See Stock Status Codes for description.
shippingStatusCode string. 3 chars. The shipping status code of the order. See Shipping Status Codes for description.

Read-only row fields

Field Type Description
id integer The ID of the sales order row.
bundleChild boolean Whether or not this row is a child row belonging to a bundle parent row. If true, the ID of the parent row is also provided.
bundleParent boolean Whether or not this row is the parent row of a bundle. The child rows will refer back to this row by its ID.
parentRowId integer If this row is a bundle child, this property is the ID of the row's bundle parent row. Otherwise, it is 0.
externalRef string The external reference associated with this row.
discountPercentage string The stored discount percentage for this row.
taxCalculator string The tax calculator used for this row.
taxClassId integer The ID of the tax class represented by taxCode.
installedIntegrationInstanceId integer The installed integration instance associated with this row, or 0 when no instance is stored.
offerAssociatedOrderRowIds array of integers The IDs of the non-offer rows associated with this offer row.

Code Descriptions

Payment Status Codes Description
PAID The order has been fully paid
PARTIALLY_PAID Payments have been received for the order, but it is not fully paid
UNPAID No payments have been received for the order
AUTHORIZED Payments for this order have been authorized but not received
NOT_APPLICABLE No payment is required for this order
Stock Allocation Codes Description
ANR Allocation Not Required
ANA Allocation None Allocated
APA Allocation Part Allocated
AAA Allocation All Allocated
Stock Status Codes (Fulfilment Status) Description
SON Sales Order Not Fulfilled
SOP Sales Order Partially Fulfilled
SOA Sales Order All Fulfilled
NON Non stock-tracked order
Shipping Status Codes Description
NST No stock tracked products on order
SNS Stock not shipped
SPS Stock part shipped
ASS All stock shipped

Additional Information

  • This resource cannot be queried with an empty ID set.
  • This resource represents the list of all sales orders. Regardless of how many IDs you request in the ID set and how many sales orders are returned, the HTTP status code will be 2xx (207 if some of the requested sales orders were found, 200 otherwise).
  • Rows on orders are not retrieved in a defined order. The "sequence" property is provided as one of several strategies you can use to sort rows; the currently configured back-office sorting strategy can be seen in the account configuration.

Example

Fetching a sales order

Request URI

/sales-order/1

Response

{
	"response": [
		{
			"id": 20,
			"version": 5,
			"customer": {
				"id": 200,
				"address": {
					"addressFullName": "John Doe",
					"companyName": "Acme",
					"addressLine1": "123 Example Street",
					"addressLine2": "Suburbia",
					"addressLine3": "Cityville",
					"addressLine4": "Countyshire",
					"postalCode": "BP1 2AZ",
					"countryIsoCode": "GB",
					"telephone": "01234 567890",
					"mobileTelephone": "070707070707",
					"fax": "",
					"email": "john.doe@email.com"
				}
			},
			"billing": {
				"contactId": 200,
				"address": {
					"addressFullName": "John Doe",
					"companyName": "Acme",
					"addressLine1": "123 Example Street",
					"addressLine2": "Suburbia",
					"addressLine3": "Cityville",
					"addressLine4": "Countyshire",
					"postalCode": "BP1 2AZ",
					"countryIsoCode": "GB",
					"telephone": "01234 567890",
					"mobileTelephone": "070707070707",
					"fax": "",
					"email": "john.doe@email.com"
				}
			},
			"ref": "Created via sales order POST endpoint",
			"externalRef": "hsdf74-2js7-jdsfi38-73jsd8",
			"placedOn": "2016-09-29T11:12:24.000+01:00",
			"createdOn": "2016-09-29T11:12:24.000+01:00",
			"createdBy": 4,
			"updatedOn": "2016-09-29T11:12:24.000+01:00",
			"taxDate": "2016-06-08T00:00:00.000+01:00",
			"parentId": 0,
			"statusId": 1,
			"warehouseId": 2,
			"channelId": 0,
			"staffOwnerId": 0,
			"projectId": 0,
			"leadSourceId": 0,
			"teamId": 0,
			"priceListId": 2,
			"priceModeCode": "INC",
			"currency": {
				"code": "GBP",
				"exchangeRate": "1.000000",
				"fixedExchangeRate": true
			},
			"delivery": {
				"date": "2016-09-29T11:12:24.000+01:00",
				"address": {
					"addressFullName": "John Doe",
					"companyName": "Acme",
					"addressLine1": "123 Example Street",
					"addressLine2": "Suburbia",
					"addressLine3": "Cityville",
					"addressLine4": "Countyshire",
					"postalCode": "BP1 2AZ",
					"countryIsoCode": "GB",
					"telephone": "01234 567890",
					"mobileTelephone": "070707070707",
					"fax": "",
					"email": "john.doe@email.com"
				},
				"shippingMethodId": 0
			},
			"paymentDueDate": "2016-10-29T00:00:00.000+01:00",
			"rows": [
				{
					"id": 33,
					"productId": 1000,
					"name": "T Shirt",
					"sku": "T00001000",
					"quantity": "1.0000",
					"taxCode": "T20",
					"tax": "10.0000",
					"net": "2.0000",
					"nominalCode": "4000",
					"productPrice": "2.0000",
					"discountPercentage": "0.00",
					"sequence": 10,
					"bundleChild": false,
					"bundleParent": false,
					"parentRowId": 0,
					"taxClassId": 7,
					"taxCalculator": "manual",
					"clonedFromId": 0,
					"installedIntegrationInstanceId": 0,
					"rowCost": {
						"unshippedCost": "0.0000"
					}
				}
			],
			"total": {
				"net": "10.00",
				"tax": "2.00",
				"gross": "12.00",
				"baseNet": "10.00",
				"baseTax": "2.00",
				"baseGross": "12.00"
			},
			"orderPaymentStatus": "PAID",
			"allocationStatusCode": "ANR",
			"stockStatusCode": "NON",
			"shippingStatusCode": "NST",
			"invoice": {
				"invoiceReference": "",
				"taxDate": "2016-06-08T00:00:00.000+01:00",
				"dueDate": "2016-10-29T00:00:00.000+01:00"
			},
			"orderWeighting": 100,
			"costPriceListId": 2,
			"isCanceled": false,
			"customerId": 200
		}
	]
}