---
Title: App API – Messages
Language: en-US
Canonical URL to this Markdown version of this page: [https://docs.kvik.shop/app-api/messages.md](https://docs.kvik.shop/app-api/messages.md)
Canonical URL to HTML version of this page (for humans): [https://docs.kvik.shop/app-api/messages](https://docs.kvik.shop/app-api/messages)
---

# App API – Messages

Breadcrumb: [App API](https://docs.kvik.shop/app-api.md) > [Messages](https://docs.kvik.shop/app-api/messages.md)



## Send an Email (and SMS) Related to an Order  

- You can send an email to the contact email address of an order.
- The message will be sent in the unified email layout used by the platform. [See the email layout below.](#order-email-preview)
- It is also possible to send the message as an [SMS][sms]. The SMS will be sent the contact phone number of the order.
- For sending SMS, it is needed to have the SMS module enabled in the shop.

```
POST /api/app/message/order
```

#### Request

```http
POST /api/app/message/order HTTP/1.1
Host: yourshopname.com
Authorization: Bearer ACCESS_TOKEN_STRING
Accept-Encoding: gzip
Content-Type: application/json

{
    "_type": "OrderMessage",
    "orderCode: "1234",
    "subject": 'Example Subject',
    "body": '<strong>Example text</strong>',
    "sendSms": true,
    "attachements": [{
        "_type": "FileContent",
        "fileType": "application/pdf"
        "fileName": "invoice_123.pdf"
        "base64Content": "...."
    }]
}
```

#### Response
```http
HTTP/1.1 200 OK
Content-Encoding: br
```

#### OrderMessage Type

- `orderCode: string`
- `subject: string`
- `body: string` The HTML content of the message. It has to contain only basic tags like headings, strong, italics, paragraphs. It has not to contain the whole layout of the message since it will be inserted into the unified email layout.
- `sendSms` If you want to send the message via both email and SMS, set the value to `true`. The SMS text will strip all HTML tags from the `body` value. 
- `attachments: FileContent[]`

#### FileContent Type

- `fileType: string` Commonly known also as Content-Type or MimeType. [List of types][mimeTypes].
- `fileName: string`
- `base64Content: string` Content of the file encoded as [Base64][base64] string.




## Order Email Preview

This is how the email layout looks like.

- The `subject` is bellow the shop logo.
- The `body` is wrapped in the box.
- Below the `body` box, there is a recapitulation of the related order. 
- It always takes into account the actual state of the order. For example, if the order is already paid, there are no the payment details displayed.


[mimeTypes]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
[sms]: https://en.wikipedia.org/wiki/SMS
[base64]: https://en.wikipedia.org/wiki/Base64