Comment API
Author:
Fluent Commerce
Changed on:
3 July 2024
Overview
A Comment provides an additional piece of information to the entity it is related to. An Order and Return can contain multiple comments associated with it.
Key points
- Comment Properties
- What you can do with Comment
- Response on Failures
Comment API
Comment Properties
Below are the properties available in the Comment object which can be updated and retrieved through the APIs in this document.
1. CreatedOn
Type: DateTime
Description:
`{ "createdOn":"2016-07-19T23:36:13.015+0000" }`
Created date and time.
2. createdBy
Type: String
Description:
`{ "createdBy":"John Smith" }`
The user who created the comment.
3. entityType
Type: String
Description:
`{ "entityType":"ORDER" }`
The entity associated with the comment. Allowed values: ORDER | RETURN | CONSIGNMENT
4. entityId
Type: String
Description: { "entityId":"432567" } The unique identifier of the associated entity.
5. body
Type: String
Description:
`{ "body":"Customer called to confirm delivery date" }`
The comment created by the user.
6. retailerId
Type: String
Description:
`{ "retailerId":"197" }`
The unique identifier assigned to the retailer by Fluent Commerce.
7. commentId
Type: String
Description:
`{ "commentId":"32467" }`
The unique identifier is assigned to the comment.
What you can do with the Comment
Create a Comment
Create a Comment in the Fluent Retail system.
POST:
`/api/v4.1/comment`
Request and response
Request parameters and sample.
1commentRequest {
2
3 entityType (string, compulsory) = ['ORDER', 'RETURN', 'CONSIGNMENT'],
4 entityId (string, compulsory),
5 body (string, compulsory),
6 retailerId (string, optional)
7 }
Language: java
Name: Category request
Description:
[Warning: empty required content area]1{
2 "entityType":"ORDER",
3 "entityId":"432567",
4 "body":"Customer called to confirm delivery date",
5 "retailerId":"197"
6 }
Language: json
Name: Example request
Description:
[Warning: empty required content area]Response Parameters and Sample
1SuccessMessageResponse {
2
3 commentId (string, optional),
4 message (string, optional),
5 status (string, optional)
6 }
Language: java
Name: Category response
Description:
[Warning: empty required content area]1{
2 "commentId": 427323
3}
Language: json
Name: Example response
Description:
[Warning: empty required content area]View Category details
Retrieve details of the Category
GET:
`/api/v4.1/order/{orderId}/comment`
Request and response
Request parameters and sample
1commentRequest {
2 start (integer, optional),
3 count (integer, optional)
4 }
Language: java
Name: Comment request
Description:
[Warning: empty required content area]1{
2 "start":"1",
3 "count":"10"
4 }
Language: json
Name: Example request
Description:
[Warning: empty required content area]Response Parameters and Sample
1SuccessMessageResponse {
2
3 start (integer, optional),
4 count (integer, optional),
5 total (integer, optional),
6 results (integer, optional):
7 [
8 {
9 commentId (string, optional),
10 body (string, optional),
11 createdBy (string, optional),
12 createdOn (Date-time, optional)
13 }
14 ]
15}
Language: java
Name: Comment Response Example
Description:
[Warning: empty required content area]1{
2"start":1,
3"count":10,
4"total":1,
5"results":[
6{
7"commentId":62240,
8"body":"Customer called to confirm delivery date",
9"createdBy":"John Smith",
10"createdOn":"2016-07-19T23:36:13.015+0000"
11}
12]
13}
Language: json
Name: Example Response
Description:
[Warning: empty required content area]Response on Failures
NAME | TYPE | DESCRIPTION |
error | Array | Array of errors |
message | String | Additional information on the code Unauthorized | Bad Request | Forbidden | Not Found | Status 500 Error |
code | String | Status Code for the above messages 401 | 400 | 403 | 404 | 500 |