> For the complete documentation index, see [llms.txt](https://developers.alephee.com/v2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.alephee.com/v2/orders/post-methods/send-a-message-to-a-buyer/request.md).

# Request and Response

## Send a text message to the order’s buyer

<mark style="color:green;">`POST`</mark> `https://api.alephcrm.com/v2/orders/{orderId}/messages`

#### Query Parameters

| Name                                         | Type    | Description    |
| -------------------------------------------- | ------- | -------------- |
| API\_KEY<mark style="color:red;">\*</mark>   | String  | (default=none) |
| accountId <mark style="color:red;">\*</mark> | Integer | (default=none) |
| orderId                                      | Integer |                |
| message                                      | String  |                |
| messageOptions                               | Integer |                |
| file                                         | File    |                |
| fileBase64                                   | String  |                |
| documentName                                 | String  |                |
| documentExtension                            | String  |                |

{% tabs %}
{% tab title="200: OK string" %}

{% endtab %}

{% tab title="400: Bad Request {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="401: Unauthorized {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="403: Forbidden {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="404: Not Found {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="409: Conflict {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="412: Precondition Failed {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="429: Too Many Requests {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="500: Internal Server Error string" %}

{% endtab %}
{% endtabs %}

## Parameters details

### API\_KEY

The API\_KEY that was provided.

### accountId

The Alephee account ID of the shipping label you are trying to get.

### orderId

Alephee ID to identify the order.\
The Alephee order number. It is not the marketplace order number.

### message

Text message to be sent to the customer.\
Max size = 350 characters.\
This is available only on certain message options. See below.

### messageOptions

Message reason for the message to be sent. Available values are:

*1 = REQUEST\_VARIANTS (Request product variation information)*\
When this option is selected, an automatic text message template is sent to the customer.\
Can not use a custom free text message (the “message” parameter).\
This reason is valid only for orders with allowed shipping modes: “cross docking” and “drop off” (refer to the LogisticType property on the GET orders endpoint).\
The following table illustrate several countries and text messages templates combinations:<br>

| <p>Argentina</p><p>Chile</p><p>Colombia</p><p>México</p><p>Uruguay</p><p> </p> | Spanish       | Hola, por favor confirma las características que quieres del producto que compraste, así podemos concretar el envío. |
| ------------------------------------------------------------------------------ | ------------- | -------------------------------------------------------------------------------------------------------------------- |
| Brazil                                                                         | Portuguese    | Olá! Por favor, confirme as características que quer para o produto que você comprou, assim, podemos fazer o envio.  |
| Other countries                                                                | Not available |                                                                                                                      |

*2 = REQUEST\_BILLING\_INFO (Request billing information)*\
When this option is selected, an automatic text message template is sent to the customer asking for billing information.\
Can not use a custom free text message (the “message” parameter).\
The following table illustrate several countries and text messages combinations:

| Country               | Language      | Message template                                                                                                                                                                                                                                                                                                      |
| --------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Argentina             | Spanish       | <p>Para adjuntarte la factura de tu compra necesito los siguientes datos:</p><p> </p><p>·       Nombre y apellido</p><p>·       DNI</p><p>·       Domicilio</p><p>·       Código postal</p><p> </p>                                                                                                                   |
| Colombia              | Spanish       | <p>Para adjuntarte la factura de tu compra necesito los siguientes datos:</p><p> </p><p>·       Nombre y apellido</p><p>·       Tipo y número de documento</p><p>·       Email</p><p>·       Domicilio</p><p>·       Código postal</p><p>·       Código de municipio</p><p>·       Código de departamento</p><p> </p> |
| <p>México</p><p> </p> | Spanish       | <p>Para adjuntarte la factura de tu compra necesito los siguientes datos:</p><p> </p><p>·       Nombre y apellido</p><p>·       RFC</p><p>·       Domicilio</p><p>·       Código postal</p><p> </p>                                                                                                                   |
| Uruguay               | Spanish       | <p>Para adjuntarte la factura de tu compra necesito los siguientes datos:</p><p> </p><p>·       Nombre y apellido</p><p>·       Cédula</p>                                                                                                                                                                            |
| Other countries       | Not available |                                                                                                                                                                                                                                                                                                                       |

*3 = SEND\_INVOICE\_LINK (Send invoice link)*\
When this option is selected, it is possible to send with message including the link of the generated invoice.\
Can use a custom free text message (the “message” parameter).\
Valid only in México.

*4 = OTHER (Others, free field)*\
When this option is selected, I can send any message to the customer, it's a free field.\
Can use a custom free text message (the “message” parameter).

*5 = DELIVERY\_PROMISE (Inform delivery promise)*\
When this option is selected, you can inform the delivery promise.\
Can use a custom free text message (the “message” parameter).\
This reason is valid only for orders with allowed shipping modes: “Flex” (refer to the LogisticType property on the GET orders endpoint).\
A brief summary of available messaging reasons by country:<br>

<figure><img src="/files/RhLTah8nyFeHaVjDuhlE" alt=""><figcaption></figcaption></figure>

Also, it is possible to send messages with an attached document. There are two ways to attach a document:

## 1. With form-data parameters:

### file

Document file to attach into an order.

## 2. With a JSON body including a base64-encoded file:

### fileBase64

The document to attach into an order.\
Must be an encoded base64 string of the document´s full content.

### documentName

Document name, only for base64 encoded files

### documentExtension

Document extension, only for base64 encoded files


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developers.alephee.com/v2/orders/post-methods/send-a-message-to-a-buyer/request.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
