# SalesInvoice v1
The /salesInvoice
endpoints are used to send sales invoices. A full tutorial on how to send sales invoices 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}/salesInvoice/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 invoices, use POST /api/v1/{partyId}/salesInvoice/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}/salesInvoice/{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}/salesInvoice/send
earlier.
Please note that we strongly encouraged the usages of hooks instead. Only use this api for debugging purposes.
# Recognize
The POST /api/v1/{partyId}/salesInvoice/recognize
endpoint can be used to recognize non-standard documents like a PDF invoice and convert them to a UBL invoice. The {partyId}
specified in the route should be the sender's partyId.
The document to recognize 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 the status of the document. When the process is complete and the document is converted, a "SalesInvoiceRecognized" hook will trigger. When things go wrong the hook will have the "SalesInvoiceRecognizedError" topic instead.
For a more detailed description, refer to the recognize tutorial.