Users message each other and the marketplace in conversations. There are three kinds, and there’s one conversation per pair and subject, so starting one again continues it.
kind |
Between | Start it with |
|---|---|---|
listing |
A buyer and the seller, before buying | listing_id |
order |
The buyer and the seller of an order | order_id |
support |
A user and the marketplace’s team | support: true |
Start or continue a conversation
Section titled “Start or continue a conversation”POST /v1/me/conversations{ "listing_id": "8f3c…", "body": "Is the leather original?" }The answer has the conversation and the new message. If one already exists, the message joins it.
Show the inbox
Section titled “Show the inbox”GET /v1/me/conversationslists the user’s conversations, latest first, each withlast_message,last_message_atandunread. Page withlimitandoffset.GET /v1/me/conversations/{id}/messagesreads one, oldest first, and marks it read. Passafter=<last message id>to get only newer messages.POST /v1/me/conversations/{id}/messageswith{ "body": "…" }replies.
In a message, from_marketplace: true means the marketplace’s team wrote it (support); otherwise sender_id is the user who did. In support conversations, user_a is the user asking.
Show a badge from the sum of unread. There’s no push: refresh the inbox when the user opens it, and while a conversation is open, ask for messages after the last one every few seconds.
Emails
Section titled “Emails”When someone gets a message they’re emailed a link to https://<your shop>/<lang>/messages/<id>. Build that page. See Pages your shop needs.