# 문의

## 채팅방 목록 조회

> 채팅방 목록을 조회합니다.\
> \
> \## 필터\
> \
> \- \`ALL\`: 전체 채팅방\
> \
> \- \`UNREAD\`: 읽지 않은 메시지가 있는 채팅방\
> \
> \- \`UNANSWERED\`: 진행 중인 세션이 있는 채팅방 (셀러가 답변하지 않은 상태가 아닌, 세션이 on-going인 상태)\
> \
> \## 페이징\
> \
> \- \`page\` 파라미터를 사용한 offset 페이징을 지원합니다.\
> \
> \- \`size\`는 최대 100까지 지정할 수 있습니다. (기본값: 20)

```json
{"openapi":"3.0.1","info":{"title":"ShoppingFep API","version":"snapshot"},"servers":[{"url":"https://shopping-fep.toss.im"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"BusinessChatRoomsFepResponse":{"required":["hasNext","rooms"],"type":"object","properties":{"rooms":{"type":"array","description":"채팅방 목록","items":{"$ref":"#/components/schemas/BusinessChatRoomSummaryFepResponse"}},"hasNext":{"type":"boolean","description":"다음 페이지 존재 여부"}}},"BusinessChatRoomSummaryFepResponse":{"required":["lastSession","receiver","roomId","sessionStatus","unreadCount"],"type":"object","properties":{"roomId":{"type":"integer","description":"채팅방 ID","format":"int64"},"receiver":{"$ref":"#/components/schemas/ReceiverFepResponse"},"lastMessage":{"$ref":"#/components/schemas/LastMessageFepResponse"},"unreadCount":{"type":"integer","description":"읽지 않은 메시지 수","format":"int64"},"sessionStatus":{"type":"string","description":"세션 상태 (ACTIVE: 문의 진행 중, CLOSED: 문의 완료)"},"lastSession":{"$ref":"#/components/schemas/SessionFepResponse"}},"description":"채팅방 목록"},"ReceiverFepResponse":{"required":["name","tossUserNo","type"],"type":"object","properties":{"type":{"type":"string","description":"수신자 유형"},"tossUserNo":{"type":"integer","description":"토스 사용자 번호","format":"int64"},"name":{"type":"string","description":"수신자 이름"},"profileImageUrl":{"type":"string","description":"프로필 이미지 URL"}},"description":"수신자 정보"},"LastMessageFepResponse":{"required":["content","isRead","messageId","senderType","sentAt"],"type":"object","properties":{"messageId":{"type":"integer","description":"메시지 ID","format":"int64"},"content":{"type":"string","description":"메시지 내용"},"senderType":{"type":"string","description":"발신자 유형"},"sentAt":{"type":"string","description":"발신 시각","format":"date-time"},"isRead":{"type":"boolean","description":"읽음 여부"}},"description":"마지막 메시지"},"SessionFepResponse":{"required":["sessionId","startedAt","status"],"type":"object","properties":{"sessionId":{"type":"integer","description":"세션 ID","format":"int64"},"status":{"type":"string","description":"세션 상태 (ACTIVE: 문의 진행 중, CLOSED: 문의 완료)"},"startedAt":{"type":"string","description":"세션 시작 시각","format":"date-time"},"endedAt":{"type":"string","description":"세션 종료 시각","format":"date-time"},"startCard":{"$ref":"#/components/schemas/StartCardFepResponse"}},"description":"마지막 세션 정보"},"StartCardFepResponse":{"type":"object","properties":{"chatEntryRefId":{"type":"integer","description":"채팅 진입 참조 ID","format":"int64"},"inquiryType":{"type":"string","description":"문의 유형","enum":["PRODUCT","DELIVERY","EXCHANGE","RETURN","CANCEL","OTHER"]},"entryRefType":{"type":"string","description":"진입 참조 유형","enum":["PRODUCT","ORDER_PRODUCT"]},"entryRefIds":{"type":"object","additionalProperties":{"type":"object","description":"진입 참조 ID 목록"},"description":"진입 참조 ID 목록"},"renderInfo":{"$ref":"#/components/schemas/RenderInfoFepResponse"}},"description":"시작 카드 정보"},"RenderInfoFepResponse":{"type":"object","properties":{"thumbnail":{"type":"string","description":"썸네일 URL"},"link":{"type":"string","description":"링크 URL"},"title":{"type":"string","description":"제목"},"subtitle":{"type":"string","description":"부제목"},"badge":{"type":"string","description":"배지"}},"description":"렌더링 정보"}}},"paths":{"/api/v3/shopping-fep/business-chat/rooms":{"get":{"tags":["비즈니스 채팅"],"summary":"채팅방 목록 조회","description":"채팅방 목록을 조회합니다.\n\n## 필터\n\n- `ALL`: 전체 채팅방\n\n- `UNREAD`: 읽지 않은 메시지가 있는 채팅방\n\n- `UNANSWERED`: 진행 중인 세션이 있는 채팅방 (셀러가 답변하지 않은 상태가 아닌, 세션이 on-going인 상태)\n\n## 페이징\n\n- `page` 파라미터를 사용한 offset 페이징을 지원합니다.\n\n- `size`는 최대 100까지 지정할 수 있습니다. (기본값: 20)","operationId":"getRooms_1","parameters":[{"name":"filter","in":"query","description":"필터","required":false,"schema":{"type":"string","default":"ALL","enum":["ALL","UNREAD","UNANSWERED"]}},{"name":"page","in":"query","description":"페이지 번호 (0부터 시작, offset 페이징)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"페이지 크기","required":false,"schema":{"type":"integer","format":"int32","default":20}},{"name":"partnerName","in":"query","description":"연동 프로그램명 또는 자사 서비스명","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"모든 응답은 200으로 내려갑니다 (성공 실패 포함) (장애상황에서만 5xx 노출)","content":{"application/json":{"schema":{"type":"object","properties":{"resultType":{"type":"string","description":"응답 결과 타입","enum":["SUCCESS","FAIL"]},"error":{"type":"object","properties":{"errorCode":{"type":"string","description":"에러 코드","enum":["INVALID_REQUEST","REQUEST_FAILED","COMMON_ERROR"]},"reason":{"type":"string","description":"에러 사유"}},"description":"에러 응답, resultType FAIL 시 제공"},"success":{"$ref":"#/components/schemas/BusinessChatRoomsFepResponse"}}}}}}}}}}}
```

## 메시지 목록 조회

> 채팅방의 메시지 목록을 조회합니다.\
> \
> \## 페이징\
> \
> \- \`before\` 파라미터를 사용한 커서 기반 페이징을 지원합니다.\
> \
> \- \`before\`가 0이면 최신 메시지부터 조회합니다.\
> \
> \- \`limit\`는 최대 100까지 지정할 수 있습니다. (기본값: 20)

```json
{"openapi":"3.0.1","info":{"title":"ShoppingFep API","version":"snapshot"},"servers":[{"url":"https://shopping-fep.toss.im"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"BusinessChatMessagesFepResponse":{"required":["hasMore","messages"],"type":"object","properties":{"messages":{"type":"array","description":"메시지 목록","items":{"$ref":"#/components/schemas/MessageFepResponse"}},"hasMore":{"type":"boolean","description":"이전 메시지 존재 여부"}}},"MessageFepResponse":{"required":["content","messageId","messageType","senderId","senderType","sentAt","sessionId"],"type":"object","properties":{"messageId":{"type":"integer","description":"메시지 ID","format":"int64"},"sessionId":{"type":"integer","description":"세션 ID","format":"int64"},"senderType":{"type":"string","description":"발신자 유형"},"senderId":{"type":"integer","description":"발신자 ID","format":"int64"},"messageType":{"type":"string","description":"메시지 유형 (NORMAL: 일반 텍스트 메시지, CUSTOM: 커스텀 메시지)"},"content":{"$ref":"#/components/schemas/MessageContentFepResponse"},"sentAt":{"type":"string","description":"발신 시각","format":"date-time"}},"description":"메시지 목록"},"MessageContentFepResponse":{"required":["imageUrls"],"type":"object","properties":{"text":{"type":"string","description":"텍스트 내용"},"imageUrls":{"type":"array","description":"이미지 URL 목록","items":{"type":"string","description":"이미지 URL 목록"}},"card":{"$ref":"#/components/schemas/CardFepResponse"}},"description":"메시지 내용"},"CardFepResponse":{"required":["chatEntryRefId","inquiryType"],"type":"object","properties":{"chatEntryRefId":{"type":"integer","description":"채팅 진입 참조 ID","format":"int64"},"inquiryType":{"type":"string","description":"문의 유형","enum":["PRODUCT","DELIVERY","EXCHANGE","RETURN","CANCEL","OTHER"]},"entryRefType":{"type":"string","description":"진입 참조 유형","enum":["PRODUCT","ORDER_PRODUCT"]},"entryRefIds":{"type":"object","additionalProperties":{"type":"object","description":"진입 참조 ID 목록"},"description":"진입 참조 ID 목록"},"renderInfo":{"$ref":"#/components/schemas/CardRenderInfoFepResponse"}},"description":"카드 정보"},"CardRenderInfoFepResponse":{"required":["title"],"type":"object","properties":{"thumbnail":{"type":"string","description":"썸네일 URL"},"link":{"type":"string","description":"링크 URL"},"title":{"type":"string","description":"제목"},"subtitle":{"type":"string","description":"부제목"},"badge":{"type":"string","description":"배지"}},"description":"렌더링 정보"}}},"paths":{"/api/v3/shopping-fep/business-chat/rooms/{roomId}/messages":{"get":{"tags":["비즈니스 채팅"],"summary":"메시지 목록 조회","description":"채팅방의 메시지 목록을 조회합니다.\n\n## 페이징\n\n- `before` 파라미터를 사용한 커서 기반 페이징을 지원합니다.\n\n- `before`가 0이면 최신 메시지부터 조회합니다.\n\n- `limit`는 최대 100까지 지정할 수 있습니다. (기본값: 20)","operationId":"getMessages","parameters":[{"name":"roomId","in":"path","description":"채팅방 ID","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"before","in":"query","description":"이 메시지 ID 이전의 메시지 조회 (0이면 최신 메시지부터 조회)","required":false,"schema":{"type":"integer","format":"int64","default":0}},{"name":"limit","in":"query","description":"조회 건수","required":false,"schema":{"type":"integer","format":"int32","default":20}},{"name":"partnerName","in":"query","description":"연동 프로그램명 또는 자사 서비스명","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"모든 응답은 200으로 내려갑니다 (성공 실패 포함) (장애상황에서만 5xx 노출)","content":{"application/json":{"schema":{"type":"object","properties":{"resultType":{"type":"string","description":"응답 결과 타입","enum":["SUCCESS","FAIL"]},"error":{"type":"object","properties":{"errorCode":{"type":"string","description":"에러 코드","enum":["INVALID_REQUEST","REQUEST_FAILED","COMMON_ERROR"]},"reason":{"type":"string","description":"에러 사유"}},"description":"에러 응답, resultType FAIL 시 제공"},"success":{"$ref":"#/components/schemas/BusinessChatMessagesFepResponse"}}}}}}}}}}}
```

## 답변 등록

> 메시지를 전송합니다.\
> \
> 메시지 전송 시 해당 메시지까지 자동 읽음 처리됩니다.\
> \
> \## 메시지 내용\
> \
> \- \`text\`: 텍스트 메시지 (최대 500자)\
> \
> \- \`imageUrls\`: 이미지 URL 목록 (최대 10개)\
> \
> \- 텍스트 또는 이미지 중 하나는 필수입니다.

```json
{"openapi":"3.0.1","info":{"title":"ShoppingFep API","version":"snapshot"},"servers":[{"url":"https://shopping-fep.toss.im"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SendBusinessChatMessageFepRequest":{"required":["content","roomId"],"type":"object","properties":{"roomId":{"type":"integer","description":"채팅방 ID","format":"int64"},"content":{"$ref":"#/components/schemas/MessageContentFepRequest"}}},"MessageContentFepRequest":{"required":["imageUrls"],"type":"object","properties":{"text":{"maxLength":500,"minLength":0,"type":"string","description":"텍스트 내용 (최대 500자)"},"imageUrls":{"maxItems":10,"minItems":0,"type":"array","description":"이미지 URL 목록 (최대 10개)","items":{"type":"string","description":"이미지 URL 목록 (최대 10개)"}}},"description":"메시지 내용"},"BusinessChatSendMessageFepResponse":{"required":["messageId","roomId","sentAt","sessionId"],"type":"object","properties":{"roomId":{"type":"integer","description":"채팅방 ID","format":"int64"},"messageId":{"type":"integer","description":"메시지 ID","format":"int64"},"sessionId":{"type":"integer","description":"세션 ID","format":"int64"},"sentText":{"type":"string","description":"전송된 텍스트"},"sentAt":{"type":"string","description":"전송 시각","format":"date-time"}}}}},"paths":{"/api/v3/shopping-fep/business-chat/messages":{"post":{"tags":["비즈니스 채팅"],"summary":"답변 등록","description":"메시지를 전송합니다.\n\n메시지 전송 시 해당 메시지까지 자동 읽음 처리됩니다.\n\n## 메시지 내용\n\n- `text`: 텍스트 메시지 (최대 500자)\n\n- `imageUrls`: 이미지 URL 목록 (최대 10개)\n\n- 텍스트 또는 이미지 중 하나는 필수입니다.","operationId":"sendMessage_1","parameters":[{"name":"partnerName","in":"query","description":"연동 프로그램명 또는 자사 서비스명","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendBusinessChatMessageFepRequest"}}},"required":true},"responses":{"200":{"description":"모든 응답은 200으로 내려갑니다 (성공 실패 포함) (장애상황에서만 5xx 노출)","content":{"application/json":{"schema":{"type":"object","properties":{"resultType":{"type":"string","description":"응답 결과 타입","enum":["SUCCESS","FAIL"]},"error":{"type":"object","properties":{"errorCode":{"type":"string","description":"에러 코드","enum":["INVALID_REQUEST","REQUEST_FAILED","COMMON_ERROR"]},"reason":{"type":"string","description":"에러 사유"}},"description":"에러 응답, resultType FAIL 시 제공"},"success":{"$ref":"#/components/schemas/BusinessChatSendMessageFepResponse"}}}}}}}}}}}
```

## 세션 종료

> 문의 세션을 종료합니다.\
> \
> ACTIVE 상태의 세션만 종료할 수 있으며, 이미 종료된 세션인 경우 기존 종료 정보를 반환합니다.

```json
{"openapi":"3.0.1","info":{"title":"ShoppingFep API","version":"snapshot"},"servers":[{"url":"https://shopping-fep.toss.im"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"BusinessChatCloseSessionFepResponse":{"required":["closedAt","closedBy","sessionId","status"],"type":"object","properties":{"sessionId":{"type":"integer","description":"세션 ID","format":"int64"},"status":{"type":"string","description":"세션 상태 (ACTIVE: 문의 진행 중, CLOSED: 문의 완료)"},"closedAt":{"type":"string","description":"세션 종료 시각","format":"date-time"},"closedBy":{"type":"integer","description":"세션 종료한 비즈 사용자 번호","format":"int64"}}}}},"paths":{"/api/v3/shopping-fep/business-chat/rooms/{roomId}/sessions/close":{"post":{"tags":["비즈니스 채팅"],"summary":"세션 종료","description":"문의 세션을 종료합니다.\n\nACTIVE 상태의 세션만 종료할 수 있으며, 이미 종료된 세션인 경우 기존 종료 정보를 반환합니다.","operationId":"closeSession","parameters":[{"name":"roomId","in":"path","description":"채팅방 ID","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"partnerName","in":"query","description":"연동 프로그램명 또는 자사 서비스명","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"모든 응답은 200으로 내려갑니다 (성공 실패 포함) (장애상황에서만 5xx 노출)","content":{"application/json":{"schema":{"type":"object","properties":{"resultType":{"type":"string","description":"응답 결과 타입","enum":["SUCCESS","FAIL"]},"error":{"type":"object","properties":{"errorCode":{"type":"string","description":"에러 코드","enum":["REQUEST_FAILED","COMMON_ERROR"]},"reason":{"type":"string","description":"에러 사유"}},"description":"에러 응답, resultType FAIL 시 제공"},"success":{"$ref":"#/components/schemas/BusinessChatCloseSessionFepResponse"}}}}}}}}}}}
```

> ### API 연동 중 문의사항이나 개선 제안이 있으신가요?

{% hint style="info" %}
토스쇼핑 API 연동에 대한 질문이나, 건의사항이 있다면 [연동/개발 문의](https://discord.gg/xPz6H9NZ3P)에 남겨주세요. 다른 유저의 문의를 참고하거나, 토스쇼핑 담당자와 질의를 주고 받을 수 있어요.
{% endhint %}
