A comment is an informational note that can be associated with an order or order item. Order-level comments are internal to retailers, whereas item-level comments are shared with that item's vendor.
The Comment object
A Comment is associated with either:
- A single Order
- A single Order Item
Each Comment has the following attributes:
Field | Description |
---|---|
id | The unique numeric identifier for the comment. This is assigned by Duoplane and cannot be changed. (Read only) |
commentable_id | The unique numeric identifier for the object associated with this comment. (Read only) |
commentable_type | The type of object associated with this comment. This can be either an Order or OrderItem. (Read only) |
created_at | The date and time in UTC when the comment was created. (Read only) |
updated_at | The date and time in UTC when the comment was last updated. (Read only) |
body | The contents of the comment |
commenter |
Attributes of the user who created the comment:
|
recipient_company |
For item-level comments, attributes of the company to whom the comment was written:
|
Retrieve the comments on an object
GET https://app.duoplane.com/#{commentable_type}/#{commentable_id}/comments.json
Get comments for Order with ID 12345:
https://app.duoplane.com/orders/12345/comments.json
Get comments for Order Item with ID 12345:
https://app.duoplane.com/order_items/12345/comments.json
Create a new comment
POST https://app.duoplane.com/#{commentable_type}/#{commentable_id}/comments.json
Sample request:
POST https://app.duoplane.com/orders/12345/comments.json
{
"comment": {
"body": "Hello, this is an order note."
}
}
Update an existing comment
PUT https://app.duoplane.com/#{commentable_type}/#{commentable_id}/comments/#{comment_id}.json
Please note that a comment can only be updated by the user that created it.
Sample request:
PUT https://app.duoplane.com/orders/12345/comments/1001.json
{
"comment": {
"body": "Hello, this is an updated order note."
}
}
Delete an existing comment
DELETE https://app.duoplane.com/#{commentable_type}/#{commentable_id}/comments/#{comment_id}.json
Please note that a comment can only be deleted by the user that created it.
Sample request:
DELETE https://app.duoplane.com/orders/12345/comments/1001.json