Create a purchase order

Prev Next
Post
/api/v1/invoices/purchaseorders

Create a new purchase order.

Description

This endpoint inserts (add) a purchase order. The 200 response contains a field named 'reference'. It is important to save this value since it is used as an identifier for all the other operations to recognise this specific entity. 

Use Case

The user wants to add a purchase order from outside the Bloxs application.

Request fields

The request contains the following fields:

FieldDescription
externalIdentifierThe unique identifier for this specific purchase order, not created by Bloxs.
ownerReference
The reference of the relation that is the buying party in this purchase order. This refers to the reference created by Bloxs, not to be confused with the externalIdentifier.
relationReferenceThe reference of the relation that is the selling party in this purchase order (supplier). This reference is created by Bloxs.
proposalReferenceThe reference of the proposal which (usually) preceded the purchase order. This reference is created by Bloxs.
proposalTotalAmountExclThe total amount excluding VAT in the proposal that preceded the purchase order.
subjectThe subject of the purchase order.
automaticApprovePurchase order that have the value true for automaticApprove will automatically proceed to workflowState = final. the finalizationState will remain on 'open'. This is especially useful if the Bloxs application is secondary in the purchase order creating process, another system is primary. Specific authorisations are necessary to enter value = true.  If the user does not have these rights, an error will be returned.
lineIndexThe order of this specific line in the purchase order.
expectedDateEnd date of the invoice payments of this specific line in the purchase order.
descriptionDescription of the specific line in the purchase order.
ledgerAccountCodeThe code of the ledger account of the specific line in the purchase order.
realEstateObjectReferenceThis is the reference of the realestate object of the specific line in the purchase order.. This refers to the reference created by Bloxs, not to be confused with the externalIdentifier.
taxRateCodeThe code of the tax rate (including the percentage) of the specific line in the purchase order.
amountExclThe amount excluding VAT of the specific line in the purchase order.


Response fields

In addition to the request, the 200 response contains the fields in the table below. 

FieldDescription
referenceThe unique identifier for this specific purchase order, created by Bloxs.
workflowState

1 = Draft

Concept status. Edits are still possible.

2 = OnHold

This means that an purchase order is on hold before it can be approved, for example due to a dispute with the supplier.

3 = Cancelled

This purchase order was, for example, not needed or created in error.

4 = ApprovalWorkflow

Submitted for approval. For example, the purchase order is pending approval by person X. This may involve a simple or extended approval chain of multiple people.

7 = Final

This is the most relevant status for integration partners. Purchase orders are then fully processed (and potentially sent).

9 = Disapproved

The purchase order has been returned by an approver for adjustments by the creator.

10 = OwnerApprovalWorkflow

Submitted for approval by the owner. The purchase order is then awaiting the owner’s approval via the owners’ portal. This is in addition to the normal approval process but is linked to the use of the owners’ portal.

11 = DisapprovedByOwner

Disapproved by the owner. This requires further review.

finalizationStateThe status of payment.
0 = Open
1 = Completed
2 = Closed
totalAmountExclTotal amount of the purchase order excluding VAT.
invoicedAmountThe amount that has been invoiced till today.
outstandingAmountThe amount that of today has not been invoiced, and is therefore still outstanding.
Security
HTTP
Type Bearer

Please enter a valid token

Body parameters
Expand All
object
externalIdentifier
string | null
Min length0
Max length100
ownerReference
string Required
Min length0
Max length100
relationReference
string Required
Min length0
Max length100
proposalReference
string Required
Min length0
Max length100
proposalTotalAmountExcl
number (double) | null
subject
string | null
Min length0
Max length512
automaticApprove
boolean
lines
Array of object (PurchaseOrderLineAPIModel) | null
object
lineIndex
integer (int32)
expectedDate
string (date)
description
string | null
Min length0
Max length512
ledgerAccountCode
string | null
Min length0
Max length12
realEstateObjectReference
string | null
Min length0
Max length100
taxRateCode
string | null
Min length0
Max length12
amountExcl
number (double)
Responses
200

The purchase order was created

Expand All
object
reference
string
Min length0
Max length100
externalIdentifier
string
Min length0
Max length100
ownerReference
string
Min length0
Max length100
relationReference
string
Min length0
Max length100
proposalReference
string
Min length0
Max length100
proposalTotalAmountExcl
number (double) | null
subject
string | null
Min length0
Max length512
workflowState
integer (int32)
Valid values[ 1, 2, 3, 4, 7, 9, 10, 11 ]
finalizationState
integer (int32)
Valid values[ 0, 1, 2 ]
totalAmountExcl
number (double)
invoicedAmount
number (double) | null
outstandingAmount
number (double) | null
lines
Array of object (PurchaseOrderLineAPIModel) | null
object
lineIndex
integer (int32)
expectedDate
string (date)
description
string | null
Min length0
Max length512
ledgerAccountCode
string | null
Min length0
Max length12
realEstateObjectReference
string | null
Min length0
Max length100
taxRateCode
string | null
Min length0
Max length12
amountExcl
number (double)
400

The purchase order data has validation issues

Expand All
object
type
string | null
title
string | null
traceId
string | null
status
integer (int32)
errors
object | null
property*
Array of string | null additionalProperties
string