# 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="https://2774728256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRImfQfWKwA2i0GqpcH8m%2Fuploads%2F5NtTJaKDqOQiFDjoybDN%2Fimage.png?alt=media&#x26;token=b4199093-2d26-4d73-90c7-870d36f12d43" 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
