Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Open a private message, or post into a conversation

Posts one message. Without conversation, it opens a new conversation with this message as its first; with conversation, it appends the message to that existing conversation.

Opening a conversation. Only a private message (conversation_type: message) can be opened here. Reviews and questions are written by their customers on the storefront; asking for one is refused with 406 and conversation_100_8 (Only its author writes a review., or question). A private message:

  • may be about an order item (item_content: orderitem with item_id) or about nothing — product is refused with conversation_100_5;

  • may not carry a rating (conversation_100_7);

  • when it names an order item, that order item must exist (conversation_100_12) and, when it names a seller, have been sold by the conversation's datasource (conversation_100_13) — see Conversation Kinds;

  • is created with is_public: false and status: null — private messages are never moderated and never reach the storefront. is_public is ignored if sent;

  • is refused as a duplicate with conversation_100_1 when a conversation with the same customer, seller, subject, kind and item already exists, published or not. A rejected conversation does not count.

These refusals are answered with 406 and {"non_field_errors": "<message>", "error_code": "<code>"}; see Errors under Conversations.

Who writes the message. user is the customer who owns the conversation. content_type and content_id name the author of this one message: datasource with a data source id to write as the seller, or user with a user id to write in the customer's name. This endpoint does not compare the author with the caller or with the conversation's seller — POST /messages/ does.

Appending. When conversation is sent, the message is judged against the existing conversation, not the payload. datasource, user and conversation_type must still be present but are ignored, as are subject, item_content, item_id and rating.

Kind

Seller message (content_type: datasource)

Customer message (content_type: user)

review

Refused: conversation_100_9 (A review cannot be replied to.)

Refused: conversation_100_10 (A review is written once, not added to.)

question

Accepted — the seller's answer

Refused: conversation_100_10 (A question is written once, not added to.)

message

Accepted

Accepted

Effects.

  • A new conversation records a submitted event carrying this first message, before the events the message itself causes.

  • A seller message sets is_answered to true (recording marked_answered if it was false), records a replied event, e-mails the customer and emits the conversation_replied webhook. The reply is not moderated: on an approved question it appears on the storefront straight away, on a pending one as soon as the question is approved.

  • A customer message sets is_answered to false, recording marked_unanswered if it was true.

The response describes the conversation the message went into; its id is the conversation's identifier, not the message's.

post
/conversations/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Body

One message, together with the conversation it opens or goes into. Send conversation to append to an existing conversation; leave it out to open a new private message.

conversationintegerOptional

The identifier of an existing conversation to append the message to. When sent, the conversation fields below are still validated but ignored.

datasourceintegerRequired

The identifier of the seller (data source) the conversation is with. Required, but ignored when appending.

userintegerRequired

The identifier of the customer who owns the conversation. Required, but ignored when appending.

subjectstring · max: 500Optional

The subject line.

conversation_typestring · enumRequired

The kind of conversation. Must be message when opening one; required, but ignored when appending.

Possible values:
item_contentstring · enumOptional

What the conversation is about. A private message accepts only orderitem, or no item at all.

Possible values:
item_idinteger · min: 1Optional

The identifier of the order item (or product) named by item_content. It must exist and, when it names a seller, belong to datasource.

ratinginteger · min: 1 · max: 5Optional

A star rating. Only reviews carry one, and reviews cannot be opened here, so leave it out — a rating on a private message is refused.

message_contentstring · max: 500Required

The message text. Must not be blank.

user_typestring · enumRequired

Whether the author writes as a guest or as a registered user.

Possible values:
content_typestring · enumRequired

Who writes this message — the customer (user) or the seller (datasource).

Possible values:
content_idinteger · min: 1Required

The identifier of the author — a user id for user, a data source id for datasource.

Responses
201

The message was posted. The body describes the conversation it went into.

application/json

The message just posted, together with the conversation it went into.

idintegerOptional

The identifier of the conversation — not of the message.

datasourceintegerOptional

The identifier of the conversation's seller.

userintegerOptional

The identifier of the customer who owns the conversation.

subjectstring · nullableOptional

The conversation's subject line.

item_contentstring · nullableOptional

What the conversation is about — product, orderitem, or null.

is_publicbooleanOptional

Storefront visibility. Always false for a new conversation.

item_idinteger · nullableOptional

The identifier of the item the conversation is about.

conversation_typestring · enumOptional

The kind of conversation. See Conversation Kinds under Conversations.

  • review — a customer's rated verdict on an order item they bought; moderated
  • question — a customer's question about a product; moderated
  • message — private correspondence between one customer and one seller; never moderated and never listed on the storefront
Possible values:
message_contentstringOptional

The message text.

user_typestring · enumOptional

Whether the author wrote as a guest or as a registered user.

Possible values:
content_idintegerOptional

The identifier of the message's author.

content_typestring · enumOptional

Who wrote the message.

Possible values:
ratinginteger · nullableOptional

The conversation's stored star rating; null for questions and private messages.

post/conversations/
POST /api/v1/remote/1/conversations/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 261

{
  "datasource": 8,
  "user": 1001,
  "subject": "About your order",
  "conversation_type": "message",
  "item_content": "orderitem",
  "item_id": 90211,
  "message_content": "Your parcel leaves our warehouse tomorrow.",
  "user_type": "registered",
  "content_type": "datasource",
  "content_id": 8
}
{
  "id": 5830,
  "datasource": 8,
  "user": 1001,
  "subject": "About your order",
  "item_content": "orderitem",
  "is_public": false,
  "item_id": 90211,
  "conversation_type": "message",
  "message_content": "Your parcel leaves our warehouse tomorrow.",
  "user_type": "registered",
  "content_id": 8,
  "content_type": "datasource",
  "rating": null
}

Last updated

Was this helpful?