Purchase Order Close POST

URI

https://{DATACENTER}.brightpearlconnect.com/public-api/{ACCOUNT}
/order-service/purchase-order/close

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

Description

POST to this endpoint to start the invoicing process of a purchase order. By this, the order will be set to an "invoice pending" state (order's invoice number set to "pending"). In this state, orders should not be modified (they are uneditable in the UI, but there is currently no protection against modification within the order service).

Once the order is in "invoice pending" state, the accounting service will be asked to start invoicing. If this operation is successful, the order will receive its invoice reference, no longer be pending, and regarded as "closed".

If downstream invoicing of an order in state "invoice pending" fails, this will not change the "pending" state of the order, and it is allowed to call this endpoint again to retry the process. POST Purchase Order Close of an invoiced order will be rejected, however.

Example 1

Closing one purchase order

Request URI

/purchase-order/close

Request body

{
	"invoiceReference": "REF",
	"taxDate": "2018-03-27T00:00:00.000Z",
	"dueDate": "2018-03-27T00:00:00.000Z",
	"orderIds": [
		1029
	]
}

Response

{
}

Example 2

Closing multiple purchase orders

Request URI

/purchase-order/close

Request body

{
	"invoiceReference": "REF",
	"taxDate": "2018-03-27T00:00:00.000Z",
	"dueDate": "2018-03-27T00:00:00.000Z",
	"orderIds": [
		1031,
		1032
	]
}

Response

{
}