Chats

Link to swagger documentation

A Chat is a conversation thread between a Seller and a Buyer regarding a specific Order and Category.

Only one Chat can exist for a given combination of orderId and categoryId.

  1. Retrieve Chat Categories
  2. Check Emails existence
  3. Initiate a Chat
  4. Retrieve list of Chats
  5. Retrieve list of Chats for a specific Order
  6. Retrieve Chats with unseen Messages

Retrieve Chat Categories

Chat Categories must be known, before initiating a Chat. To retrieve the list of all available ones, a GET request can be made to /openapi/v1/chat-categories.

Request:

GET https://service-message-center.sandbox.infra.metro-markets.cloud/openapi/v1/chat-categories

Response:

{
  "status": "success",
  "message": "Chat categories have been fetched successfully",
  "data": [
    {
      "id": 200,
      "key": "POST-PURCHASE",
      "parentId": null,
      "translations": [
        {
          "en": "Post-purchase",
          "de": "Nach dem Kauf"
        }
      ],
      "children": [
        {
          "id": 210,
          "key": "ORDER",
          "parentId": 200,
          "translations": [
            {
              "en": "Order",
              "de": "Bestellung"
            }
          ],
          "children": []
        }
      ]
    }
  ]
}

Check Emails existence

To check for pre-existing email communication for an OrderNumber, a GET request can be made to /openapi/v1/orders/{{orderNumber}}/emails-exist.

Request:

GET https://service-message-center.sandbox.infra.metro-markets.cloud/openapi/v1/orders/{{orderNumber}}/emails-exist

Response:

{
  "status": "success",
  "message": "Successfully verified email existence for Order [O25-12345678910]",
  "data": {
    "exist": false
  },
  "metadata": []
}

Initiate a Chat

To initiate a new Chat with the Buyer for a specific Order, a POST request to /openapi/v1/orders/{orderId}/chats can be made.

Request:

POST https://service-message-center.sandbox.infra.metro-markets.cloud/openapi/v1/orders/9e159b23-5585-4482-b078-9a9e1db2b252/chats

request Body:
{
  "categoryId": 242
}

Response:

A 201 Created response will be received containing the details of the newly created Chat, including its unique id.

{
  "data": {
    "buyer": {
      "firstName": "Quality Business",
      "id": "7cc2d1d0-bf2c-4af6-89c0-01fbb24a436a",
      "lastName": "Valid Vies"
    },
    "category": {
      "id": 211,
      "locale": "en",
      "name": "Order status",
      "parent": {
        "id": 210,
        "name": "Order"
      }
    },
    "createdAt": "2025-09-02T19:41:12+00:00",
    "id": "9fc8aac4-6fce-43f2-b230-0b372097729b",
    "isSeen": true,
    "lastMessageAt": "2025-09-02T19:41:12+00:00",
    "order": {
      "id": "4cff7a94-224c-45e4-8187-6d978e3afab5",
      "orderNumber": "O25-568200129071",
      "salesChannel": "pt"
    },
    "seller": {
      "accounts": [
        {
          "firstName": "Test",
          "id": "18461e1b-d845-4587-8ecb-90ba8838fc6e",
          "lastName": "Metro"
        }
      ],
      "organization": {
        "id": "581c41ea-6bc5-4716-a325-4a803c0ebff0",
        "shopName": "My DESHOP"
      }
    },
    "status": "WAITING_FOR_BUYER",
    "unseenMessagesCount": 0
  },
  "message": "Chat [9fc8aac4-6fce-43f2-b230-0b372097729b] has been created successfully",
  "metadata": [],
  "status": "success"
}

Retrieve list of Chats

To retrieve a list of all chats, a GET request to /openapi/v1/chats can be made. Query parameters can be optionally used to filter and paginate the results.

Request:

GET https://service-message-center.sandbox.infra.metro-markets.cloud/openapi/v1/chats?limit=15&offset=21

Response:

{
  "data": [
    {
      "buyer": {
        "firstName": "Quality Business",
        "id": "7cc2d1d0-bf2c-4af6-89c0-01fbb24a436a",
        "lastName": "Valid Vies"
      },
      "category": {
        "id": 211,
        "locale": "en",
        "name": "Order status",
        "parent": {
          "id": 210,
          "name": "Order"
        }
      },
      "createdAt": "2025-09-02T19:41:12+00:00",
      "id": "9fc8aac4-6fce-43f2-b230-0b372097729b",
      "isSeen": true,
      "lastMessageAt": "2025-09-02T19:41:12+00:00",
      "order": {
        "id": "4cff7a94-224c-45e4-8187-6d978e3afab5",
        "orderNumber": "O25-568200129071",
        "salesChannel": "pt"
      },
      "seller": {
        "accounts": [
          {
            "firstName": "Test",
            "id": "18461e1b-d845-4587-8ecb-90ba8838fc6e",
            "lastName": "Metro"
          }
        ],
        "organization": {
          "id": "581c41ea-6bc5-4716-a325-4a803c0ebff0",
          "shopName": "My DESHOP"
        }
      },
      "status": "WAITING_FOR_BUYER",
      "unseenMessagesCount": 0
    }
  ],
  "message": "[15] chats have been fetched successfully",
  "metadata": {
    "limit": 15,
    "offset": 21,
    "total": 57
  },
  "status": "success"
}

Retrieve list of Chats for a specific Order

To retrieve all chats for a specific Order, a GET request to /openapi/v1/orders/{orderId}/chats can be made.

Request:

GET https://service-message-center.sandbox.infra.metro-markets.cloud/openapi/v1/orders/4cff7a94-224c-45e4-8187-6d978e3afab5/chats

Response:

{
  "data": [
    {
      "buyer": {
        "firstName": "Quality Business",
        "id": "7cc2d1d0-bf2c-4af6-89c0-01fbb24a436a",
        "lastName": "Valid Vies"
      },
      "category": {
        "id": 211,
        "locale": "en",
        "name": "Order status",
        "parent": {
          "id": 210,
          "name": "Order"
        }
      },
      "createdAt": "2025-09-02T19:41:12+00:00",
      "id": "9fc8aac4-6fce-43f2-b230-0b372097729b",
      "isSeen": true,
      "lastMessageAt": "2025-09-02T19:41:12+00:00",
      "order": {
        "id": "4cff7a94-224c-45e4-8187-6d978e3afab5",
        "orderNumber": "O25-568200129071",
        "salesChannel": "pt"
      },
      "seller": {
        "accounts": [
          {
            "firstName": "Test",
            "id": "18461e1b-d845-4587-8ecb-90ba8838fc6e",
            "lastName": "Metro"
          }
        ],
        "organization": {
          "id": "581c41ea-6bc5-4716-a325-4a803c0ebff0",
          "shopName": "My DESHOP"
        }
      },
      "status": "WAITING_FOR_BUYER",
      "unseenMessagesCount": 0
    }
  ],
  "message": "Chats for orderId [4cff7a94-224c-45e4-8187-6d978e3afab5] have been fetched successfully",
  "metadata": [],
  "status": "success"
}

Retrieve Chats with unseen Messages

To retrieve all chats containing at least one unseen message from the seller, along with the total count, a GET request to /openapi/v1/chats/unseen can be made.

Request:

GET https://service-message-center.sandbox.infra.metro-markets.cloud/openapi/v1/chats/unseen

Response:

{
  "data": {
    "chats": [
      {
        "buyer": {
          "firstName": "Quality Business",
          "id": "7cc2d1d0-bf2c-4af6-89c0-01fbb24a436a",
          "lastName": "Valid Vies"
        },
        "category": {
          "id": 211,
          "locale": "en",
          "name": "Order status",
          "parent": {
            "id": 210,
            "name": "Order"
          }
        },
        "createdAt": "2025-09-02T19:41:12+00:00",
        "id": "9fc8aac4-6fce-43f2-b230-0b372097729b",
        "isSeen": true,
        "lastMessageAt": "2025-09-02T19:41:12+00:00",
        "order": {
          "id": "4cff7a94-224c-45e4-8187-6d978e3afab5",
          "orderNumber": "O25-568200129071",
          "salesChannel": "pt"
        },
        "seller": {
          "accounts": [
            {
              "firstName": "Test",
              "id": "18461e1b-d845-4587-8ecb-90ba8838fc6e",
              "lastName": "Metro"
            }
          ],
          "organization": {
            "id": "581c41ea-6bc5-4716-a325-4a803c0ebff0",
            "shopName": "My DESHOP"
          }
        },
        "status": "WAITING_FOR_BUYER",
        "unseenMessagesCount": 0
      }
    ],
    "count": 1
  },
  "message": "[1] chats with unseen messages have been fetched successfully",
  "status": "success"
}