# Send invoices
Requirement: Tutorial: Connect your application
# Step 1: Create a XML e-invoice
In the eConnect platform we talk about documents with templates. A document can be an invoice or an order based on a specific standard. This is determined by the template. For more information read: Overview of documents and templates.
To be able to send a invoice you now need a UBL 2.1 document that complies with the SI 2.0 standard or the Peppol Bis Billing 3.0. See our examples for more information about the invoices.
# Step 2: Determine the routing Id
For sending you need to supply a routing Id in the form of a ReferenceId and an email address of the contact person of the receiver. The ReferenceId also must be in the UBL SI 2.0 document on the proper place and the email address should be added in the document.
eConnect will try to deliver the document first within the eConnect platform by searching for the receiving party. If the receiver is not part of the eConnect platform a lookup is done in the Peppol network based on the ReferenceId. If the ReferenceId still can not be found an email with a private link is send to the contact person.
For selecting the preferred or best delivery, the call GetAdvisedInvoiceRecipientId can be used with all the Ids known for the recipient. The best Id will be returned based on it’s availability in eConnect and the Peppol network.
# Step 3: Send the document
On send via the SendDocument call the document will be validated before accepting. If a document is not valid XML, or doesn’t match the XSD or there are fatal errors based on the XSLT of the template the document will be rejected with the matching error response. Make sure you use the correct TemplateId when sending; please read the Overview of documents and templates.
If the document is valid it is accepted and the call will return the track-and-trace code in the form of a ExternalId. Save this ExternalId for prove and to follow the status of the document. Be aware: if there is no ExternalID returned the document is not send.
# Step 4: Check statuses
One of the nice things of sending documents with eConnect is the fact that you can see the status of the document. Use the call GetOutboxDocument with the ExternalId (one) or the call GetOutboxDocuments (all changed) with a proper filter and update the document statuses in your system.