Sales Credit Close POST

URI

https://{DATACENTER}.brightpearlconnect.com/public-api/{ACCOUNT}
/order-service/sales-credit/{ORDER-ID}/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 sales credit. 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 Sales Credit Close of an invoiced sales credit will be rejected, however.

Field Description Data Type Required
taxDate If specified, this date will override the usual invoice tax date rules, e.g. the 'use today for tax date' setting. String (ISO 8601 date time) No

Example 1

Closing sales credit 1029.

Request URI

/sales-credit/1029/close

Request body

{
}

Response

{
}

Example 2

Closing sales credit 1029 with overriding tax date.

Request URI

/sales-credit/1029/close

Request body

{
	"taxDate": "2017-03-27T00:00:00.000Z"
}

Response

{
}