Send Applicaiton Receipt
For detailed technical specifications, please refer to the Swagger documentation.
Upload application receipt as a XML-document
POST /messages
The application receipt may be uploaded like any other business document. For more details about sending a message, see the page for API endpoints. The same process and validation rules apply.
Please note that an application receipt always has exactly one receiver.
Send with the AppRec API endpoint
POST /messages/{id}/apprec
We offer a separate endpoint for producing and sending application receipt. If called, EDI 2.0 will create an application receipt XML document based on the information provided. The created XML is then sent to the recipient in the normal way.
The endpoint path contains an ID reference (id) for the message you are responding to. In the request body, you must provide the HER-Id (AppRecSenderHerId) to identify which (of the potentially many) receivers which is responding to the message. You also provide the desired application receipt status based on the domain logic of your application. If your application rejects the message, you should provide the reason(s) for this.
The endpoint responds with an new ID reference for the shipment. Receivers using EDI 2.0 must later use this ID (id of the application receipt) to retrieve their applicaiton receipt business document. As the sender, you may also use this ID to check the status of the message. For more details about status, see the page for API endpoints.
Key considerations for using the AppRec API endpoint
For requests to succeed, EDI 2.0 has to already have read, parsed and stored the communication parties in the referenced message. We cannot guarantee that this is the case for all messages. They must at the very least be XML messages that are well formed, and following a schema we know about.
Trying to produce application receipts for messages not following the standard for addressation (tjenestebasert adressering - HIS 1153:2017), may lead to unexpected results and possible mismatch between the addressees of the business document and the shipment/EbXml envelope. The same can be true if there already was a mismatch between the business document addressees and shipment/EbXml envelope in the referenced message.
To create the application receipt XML, the "sender" and "receiver" XML-elements from the original message is swapped (in case of copy receivers, the "receiver" or "otherReceiver" element corresponding to the provided HER-Id is swapped with the "sender" element). In the shipment and EbXml envelope of the application receipt, the provided AppRecSenderHerId is used as the sender (EbXml "From"), while the receiver (EbXml "To") is the sender (EbXml "From") of the shipment and EbXml envelope of the referenced message.
To override the sender/receiver values to be used in the shipment/EbXml envelope, you can provide the properties TransportSenderHerId and/or TransportReceiverHerId in TransportMetadataOverrides. Note that these properties should only be used in exceptional cases, when communicating with parties that don't follow the standard HIS 1153:2017 or other cases that requires special treatment.