# PurchaseOrder v1

The /purchaseOrder endpoints are used to send purchase orders. A full tutorial on how to purchase orders can be found here.

# Query recipient party

When a receiver has multiple id's registered in Peppol or other networks and you're unsure which id to use, or if you want to make sure the id you're sending to is registered in the Peppol network, you can use the POST /api/v1/{partyId}/purchaseOrder/queryRecipientParty endpoint. The {partyId} specified in the route should be the sender's partyId. The request body accepts an array of partyId's, in JSON. The response will contain the recipient party that should be used as endpointId in the sales invoice.

The query parameter ?preferredDocumentTypeId can be used if a specific documentTypeId is preferred. Specifying a preferred documentTypeId will make sure the documentTypeId is prioritized in the lookup.

# Send

To send purchase order, use POST /{partyId}/purchaseOrder/send. The {partyId} specified in the route should be the sender's partyId, the receiver will be read from the invoice. The invoice should be added to the request body as a binary file with content type multipart/form-data. The response will contain a documentId, which can be used to check to status of the document.

# Status

Once a document is sent, GET /api/v1/{partyId}/purchaseOrder/{documentId}/status can be called to check the status of the document. The {partyId} specified in the route should be the sender's partyId and the {documentId} should be the documentId returned by POST /api/v1/{partyId}/purchaseOrder/send earlier.

Please note that we strongly encouraged the usages of hooks instead. Only use this api for debugging purposes.

© 2022 eConnect International B.V.