API reference · Messages
Reply to a message
Answers a buyer question on the marketplace and stores the answer in StockMount as a sent message.
https://out.stockmount.com/api/Integration/SendUserMessage
The supported integration is N11 (IntegrationId 2). Only an existing product question can be answered; you cannot start a new conversation. Send the question's Code in UserMessageCode; it must be numeric.
After sending, the answer is stored as a sent message (type 2) with a code in the form {questionCode}_ANSWER_{n}. The answered question is closed.
If SetMessageRead is true, the question given by UserMessageId is also marked as read.
Also send Subject and From. If they are missing, the answer may reach N11 but cannot be stored in StockMount and the call returns 99999; in that case check the answer on N11 before retrying.
A successful response does not guarantee that N11 accepted the answer: the request to N11 is started but its result is not awaited. Errors on the N11 side are not reported by this endpoint.
Any IntegrationId other than 1 and 2 returns 99999 with an empty ErrorMessage. A successful response has no Response field.
Request fields
| Field | Type | Description |
|---|---|---|
ApiCode
required
|
string |
Session code returned by DoLogin.
|
StoreId
required
|
integer | ID of the store the question belongs to. |
IntegrationId
required
|
integer | The store's integration ID. 2 for N11. |
UserMessageCode
required
|
string |
Code of the question to answer (N11 question ID, numeric). Required for N11.
|
Message
required
|
string | Answer text. |
To
required
|
string |
Buyer's username (the question's From value). Stored as the recipient.
|
From
|
string | Value stored as the sender (e.g. your store name). If omitted, storing fails. |
Subject
|
string |
Subject to store (e.g. the question's Subject). If omitted, storing fails.
|
SetMessageRead
|
boolean |
Optional. If true, the question is also marked as read. Default false.
|
UserMessageId
|
integer |
UserMessageId of the question being answered. Used when SetMessageRead is true.
|
Response fields (Response)
On success the Response field is empty; read the outcome from Result.
Error codes for this endpoint
| Code | When |
|---|---|
10001 |
StoreId is not a store in your account (ErrorMessage: Invalid store.). |
00003 |
A required field is missing. ErrorMessage: StoreId, IntegrationId, Message, To, or MessageCode when UserMessageCode is empty for N11. |
99999 |
IntegrationId is not supported (ErrorMessage empty), the store has no N11 API credentials (ErrorMessage empty), UserMessageCode is not numeric, the answer could not be stored in StockMount, or a server error occurred. |
For session errors (00001, 00006) and every other code see error codes.
Related endpoints
Example request
{
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageCode": "301245678",
"UserMessageId": 88119,
"To": "alici_123",
"From": "ornekmagaza",
"Subject": "Ürün sorusu",
"Message": "Merhaba, ürün stoktadır.",
"SetMessageRead": true
}
curl -X POST 'https://out.stockmount.com/api/Integration/SendUserMessage' \
-H 'Content-Type: application/json' \
-d '{
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageCode": "301245678",
"UserMessageId": 88119,
"To": "alici_123",
"From": "ornekmagaza",
"Subject": "Ürün sorusu",
"Message": "Merhaba, ürün stoktadır.",
"SetMessageRead": true
}'
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
var json = """
{
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageCode": "301245678",
"UserMessageId": 88119,
"To": "alici_123",
"From": "ornekmagaza",
"Subject": "Ürün sorusu",
"Message": "Merhaba, ürün stoktadır.",
"SetMessageRead": true
}
""";
var response = await http.PostAsync(
"https://out.stockmount.com/api/Integration/SendUserMessage",
new StringContent(json, Encoding.UTF8, "application/json"));
var result = await response.Content.ReadAsStringAsync();
// Result == false ise ErrorCode ve ErrorMessage alanlarına bakın.
Console.WriteLine(result);
<?php
$body = <<<'JSON'
{
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageCode": "301245678",
"UserMessageId": 88119,
"To": "alici_123",
"From": "ornekmagaza",
"Subject": "Ürün sorusu",
"Message": "Merhaba, ürün stoktadır.",
"SetMessageRead": true
}
JSON;
$ch = curl_init('https://out.stockmount.com/api/Integration/SendUserMessage');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$result['Result']) {
echo $result['ErrorCode'] . ' ' . $result['ErrorMessage'];
}
import requests
payload = {
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageCode": "301245678",
"UserMessageId": 88119,
"To": "alici_123",
"From": "ornekmagaza",
"Subject": "\u00DCr\u00FCn sorusu",
"Message": "Merhaba, \u00FCr\u00FCn stoktad\u0131r.",
"SetMessageRead": True
}
response = requests.post("https://out.stockmount.com/api/Integration/SendUserMessage", json=payload, timeout=60)
result = response.json()
if not result["Result"]:
print(result["ErrorCode"], result["ErrorMessage"])
const payload = {
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageCode": "301245678",
"UserMessageId": 88119,
"To": "alici_123",
"From": "ornekmagaza",
"Subject": "Ürün sorusu",
"Message": "Merhaba, ürün stoktadır.",
"SetMessageRead": true
};
const response = await fetch("https://out.stockmount.com/api/Integration/SendUserMessage", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
const result = await response.json();
if (!result.Result) {
console.error(result.ErrorCode, result.ErrorMessage);
}
Example response
{
"Result": true
}
Try it
The request goes straight from your browser to out.stockmount.com. The ApiCode is not stored by this site; it is kept only while this tab is open.
Get an ApiCode before sending requests.
This endpoint changes real data in your account.
Recent requests
Requests sent from this tab; click one to load its body again.