Post a message on an order
POST
/orders/{order_id}/messages
const url = 'https://acme.mykreezalid.com/front_api/v1/orders/4242/messages';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"subject":"Delivery date","content":"Can you deliver on Friday?"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://acme.mykreezalid.com/front_api/v1/orders/4242/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "subject": "Delivery date", "content": "Can you deliver on Friday?" }'Adds a message to the conversation of an order, written by the signed-in member, who must be the customer or the vendor of the order.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”order_id
required
integer
Identifier of the order.
Example
4242Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
subject
string
Example
Delivery datecontent
string
Example
Can you deliver on Friday?Responses
Section titled “Responses”The message is posted.
Media typeapplication/json
A message of the conversation between the customer and the vendor of an order.
object
object
Returned when the message is created only.
string
id
integer
order_id
integer
user_id
Identifier of the member who wrote the message.
integer
role
Role of the author: 1 customer, 2 vendor, 3 marketplace.
integer
subject
string
content
string
created
string format: date-time
Example
{ "object": "OrderMessage", "id": 4242, "order_id": 4243, "user_id": 4244, "role": 1, "subject": "Delivery date", "content": "Can you deliver on Friday?"}No signed-in member; the order does not exist or the signed-in member is neither its customer nor its vendor (message order not found); or the message could not be saved.
Media typeapplication/json
Error body returned by the Front API when it refuses a request.
object
code
HTTP status code, repeated in the body.
integer
status
string
message
Human-readable reason.
string
Example
{ "code": 403, "status": "error", "message": "Token not found in request"}