Chats with customers

The Yandex.Market API allows you to communicate with your customers in chats.

How to start a chat

  1. Check if there is a chat with the buyer. — POST businesses/{businessId}/chats. In the request, specify the chat type and the ID of the order or refund to which it relates.

    If there is no chat, create it using a request. POST businesses/{businessId}/chats/new.

    How to start a test chat

    In the debugging interface, create a test order, and then click Create a test chat or make a request POST businesses/{businessId}/chats/new.

    Learn more about working with test orders

    Please note:

    • such a chat can only be created for an order, not a refund;

    • There are no customer responses in the test chats.

  2. Send a message with a request POST businesses/{businessId}/chats/message. If you need to send a file to the buyer, for example, an additional photo of the product, use a request. POST businesses/{businessId}/chats/file/send.

  3. Check new messages from the buyer. — POST businesses/{businessId}/chats/history. Use a filter based on the ID of the last message in the request to receive only new messages and not re-upload those that you already have.

How to reply to a message

  1. Find the chats where your answer is needed. To do this, make a request POST businesses/{businessId}/chats. In the request, send the status "Store response needed" ("statuses": ["WAITING_FOR_PARTNER"]).

  2. To get the chat message history, use a request POST businesses/{businessId}/chats/history, where pass the chat ID.

  3. Send a message using a request POST businesses/{businessId}/chats/message. If you need to send a file to the buyer, for example, an additional photo of the product, use a request. POST businesses/{businessId}/chats/file/send.

How to check if there are new chats or messages

Enable API notifications

Yandex.Market will send you a request. POST notification when a new chat or message appears.

How to work with notifications

To receive chats or messages, use the following methods: