Buyer-seller chat API for marketplaces | TalkJS

4 min read Original article ↗

Mask phone numbers and email addresses in buyer-seller messages

Big marketplaces keep early conversations on their own platform. Airbnb says “all guest communications prior to booking must be on Airbnb”. Upwork calls sharing contact details before a contract starts “circumvention”, and Fiverr allows other channels “only after an order has been placed”. Airbnb says its rules are there “to protect our community”, and Upwork and Fiverr warn that users who move off the platform risk scams and lose its protections.

In TalkJS, you turn on masking for a role on the Chat UI tab of your dashboard. Choose what to hide: email addresses, phone numbers, links, or all three. Each one is replaced with “(hidden information)”, or text you write, and the rest of the message is delivered.

  • In selective mode, senders see their own message as they wrote it and everyone else sees it masked. Senders don't see that it was masked, which makes it harder for them to work around it. Global mode masks it for everyone.
  • Masked details stay hidden in email, SMS and push notifications too.
  • Masking is included on every plan.

What the buyer sees

Seller

Yes, the bike is still for sale. Happy to answer any questions.

10:41

You

Great! Text me at 555-0134 or email maya@example.com and we can sort out a time.

10:42

What the seller sees

You

Yes, the bike is still for sale. Happy to answer any questions.

10:41

Maya

Great! Text me at (hidden information) or email (hidden information) and we can sort out a time.

10:42

Unmask contact details after the sale

Once the sale goes through, the buyer still needs to know where to pick up the bike. Airbnb works the same way: only guests with a confirmed reservation can see their host’s contact number. With TalkJS, your server shows the buyer and seller each other’s details in that one conversation and nowhere else.

Create a role with masking turned off. Then point the buyer’s and the seller’s contentMasking setting in that conversation to the new role, with one REST API call each, or with the JavaScript Data API. It applies to messages they’ve already exchanged, and everyone else keeps your usual masking rules.

# Show contact details to the buyer in one conversation
# talkjs.com/docs/Guides/Control_Content_Masking/
curl https://api.talkjs.com/v1/<APP_ID>/conversations/order_391_fc/participants/betty_buyer \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -X PATCH \
  -d '{ "takeSettingsFromRole": { "contentMasking": "no_masking" } }'

# Repeat for the seller

Marketplace chat conversations for each listing or order

You decide what a conversation covers: one per listing, so all of a buyer’s questions about it stay together, or one per purchase, so each order gets its own chat. In a rental marketplace, one per rental keeps the pickup and the return in the same chat.

Give each conversation the listing’s title and photo, and store your product or order ID on it as custom data. Post order updates as system messages, which everyone in the conversation sees in a neutral style. When we email someone about a message they missed, the email can link straight to the product or order page.

Seller

Hey, I noticed you’re interested in the PS5 controller for sale. Any questions? Are you happy with the price?

4m ago

You

If it’s still under warranty, yes, I‘m happy.

3m ago

Seller

Yes, it‘s still under warranty for another six months.

5m ago

by Jennifer Pritchard

DualSense brings haptic feedback and adaptive triggers to PlayStation 5, turning simple actions into precise tactile experiences.

PlayStation 5 DualSense controller

Just placed a bid. Let me know if this works.

Email, SMS and push notifications with reply by email

When a buyer or seller misses a message, we send an email, SMS, browser or mobile push notification, depending on what you turn on. They can reply to the email, and their reply shows up in the chat, so the whole conversation stays on your marketplace. SMS messages are charged separately.

Marketplace app

4 min

New message about your listing

Sam just sent you a question about your camera. Tap to reply in chat.

Marketplace app

8 min

Offer received on your listing

Lena sent a new offer for your bicycle. Open chat to review and respond.

Marketplace app

12 min

Your item was marked as favorite

Three buyers saved your chair. Increased interest may lead to faster sales.

FAQs