# Sending attachments

## Attachment

Within SCSN, and UBL, documents are defined using the *Attachment*-element. This element is reused in all SCSN messages and is shown in the figure below. It is possible to define a document in two ways, namely: physically embed the document inside the *Embedded document binary-*&#x65;lement using a base64 binairy-to-text encoding, or refer to the location of the document using the *External reference*-element. The latter is used when the document can be found on an external server/portal and should be automatically/manually downloaded from this location. The latter option is preferred when the documents have a relatively large size when the same document is send multiple times over time, e.g. within multiple order messages.

![The Attachment-element](/files/-Lu2-ySg2fdpGiLJ7I0h)

## Order messages and Technical Product Data (TPD)

The order and order response 2.0 messages contain in total three ways to add attachments. The following overview shows how to use these methods.&#x20;

* **Order.Additional Document reference** is used for sending documents which are relevant for the complete order. Some examples are: Non-Disclosure Agreement (NDA) or a PDF Order (which is not encouraged).&#x20;
* **Order.OrderLine.Document reference** is used for sending documents which are relevant on line level, not on item level (see below), an example is a contract reference.&#x20;
* **Order.Orderline.LineItem.Item** is used for sending documents which are specific on item level, and replaces the Technical Product Data element of the Order 1.1 message. This element is mainly used for sending technical product data/specifications. It is possible to use this field in two ways:&#x20;
  * Directly refer/embed one or multiple files&#x20;
  * Refer to a TPD Package Message. This is a separate SCSN message which is used to send a package of several technical documents related to an item.&#x20;

![How to use Order.Orderline.LineItem.Item in two different ways ](/files/-Lu2-ZdjM1EJKM3KDht4)

## Technical Product Data (TPD) Package Message

As mentioned in the previous section, SCSN contains a separate message for sending a package of technical documents. The [TPD Package 1.0 messag](https://smartconnected.semantic-treehouse.nl/#/TreeView/Message_1571046195_00383560)e is shown below and supports one or multiple [Attachments](/processmanual/use-cases/how-to-send-attachments.md#attachment), i.e. documents. Furthermore, this message contains additional functionality to specify certain attributes specific for the *Document*, such as an own *ID*, *Issue date*, *Document type*, and *Version*.  Moreover, the package itself contains a similar set of attributes, but additionally also contains a reference to an Item either via a *Buyers-, Sellers-,* or *StandardItemIdentification*. It should be noted that the package does not directly refer to an Orderline because it can be reused in multiple Orders and Orderlines.&#x20;

![TPD Package 1.0 Message](/files/-Lu24P-WZnUn2kXgM2FN)

## Using the measurement message

Besides adding an attachement, or sending a TPD message there is another way of sending files. The measurement message is intended to be used for sharing measurements of actual products, or certifications regarding a product as build. It does not define how these files should be structed due to this being highly use case dependend. The measurement message may be related to specific order lines or despatch lines to associate it with a product.

To attach a certificate or measurement file to the message an external reference (hyperlink) may be used, or it can be embedded and a mimCode can be provided.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://smart-connected-supplier-network.gitbook.io/processmanual/use-cases/how-to-send-attachments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
