# Purchase Order v1

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

# Query recipient party

When a receiver has multiple ids 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 purchase order.

By default the query will look for the best delivery option in the Order family. Use the ?documentFamily query parameter to query OrderChange and OrderCancellation document families instead. 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 a 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 order. The order 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.

# Cancellation

The POST /api/v1/{partyId}/purchaseOrder/{documentId}/cancel endpoint can be used to send an Order Cancellation Message to the buyer. Follow the Tutorial: Cancelling orders via "Order Cancellation" for more information.

The {partyId} should be the buyer's partyId and {documentId} the documentId found in the hook. The request body is a JSON payload based on these fields:

Field Usage
cancellationNote The general reason for cancellation of the referenced order.

# 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 encourage the usages of hooks instead. Only use this api for debugging purposes.

© 2024 eConnect International B.V.