Create Order Message
Function
To create an order reply with open API
透過 Open API 創建一筆訂單留言
URL
POST <<api_domain>>/v1/orders/:id/messages
Request Parameters
Parameter | Type | Description | Example |
---|---|---|---|
id | String | Order ID | 5f48d73625d799003327682a |
text | String | Message 留言文字 Note: Support line break with \n When entered as a text field in API Reference , \n will automatically be converted into a string \\n . However, if inputted directly as a request, \n will function correctly for line breaks. | hello world! |
media_id | String | Picture you want to upload 想上傳的圖片 ID | |
is_private | Boolean | Can be seen by customer or not | false |
trackable_type | String | Order | Order |
trackable_id | String | Order ID | Use ID of the order, |
send_by | String | merchant or customer |
Request Example
curl -X POST \
<<api_domain>>/v1/orders/62d8e4ac11a6a1003cc021fa/messages \
-H 'Authorization: Bearer access_token' \
-H 'Content-Type: application/json' \
-d '{
"text": "note2",
"owner_id": "60ebcfae2986000016ebd826",
"owner_type": "Merchant",
"trackable_id": "62d8e4ac11a6a1003cc021fa",
"trackable_type": "Order",
"is_private": false
}'
Response Example
{
"id": "5f6418f8e3880944cccf420a",
"created_at": "2020-09-18T02:18:32.549+00:00",
"updated_at": "2020-09-18T02:18:32.549+00:00",
"text": "note1",
"owner_id": "5f191aa151185200072888ba",
"owner_type": "Merchant",
"trackable_id": "5f4cd89ae3880978cda0c4e5",
"trackable_type": "Order",
"is_private": false,
"media": {
"images": {
"original": {
"width": 120,
"height": 120,
"url": "https://img-shoplineapp-com.s3.amazonaws.com/media/image_clips/5f61c207e3880974544a2d19/original.png?1600242183"
}
}
}
}
Updated 4 months ago