> For the complete documentation index, see [llms.txt](https://store-help.nhn-commerce.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://store-help.nhn-commerce.com/app/counsel/kakao_friend_talk/07.md).

# 헤드리스 사용 가이드

## 친구톡 캠페인 통계 동작 원리

* 친구톡 발송 시 링크되는 URL 에 trackingKey 를 파라메터로 전달합니다.
* 예를 들어 쇼핑몰 홈페이지로 클릭을 유도하는 친구톡 발행 시 <mark style="color:blue;"><http://쇼핑몰주소?trackingKey={친구톡캠페인의추적키}></mark> 로 링크가 전달됩니다.&#x20;
* 쇼핑몰에서는 전달된 trackingKey 를 request 값으로 전달하면 웹훅 이벤트를 통해 친구톡 통계 DB에 수집됩니다.

<figure><img src="/files/acQCij6pJKrzTJT4AsRH" alt=""><figcaption></figcaption></figure>

***

## trackingKey 를 전달해야 하는 API

### **◼︎ 로그인**

아래 API 에 query parameter로 전달받은 trackingKey 를 전달합니다.

* [ID, PW 를 이용하여 accessToken 발행하여 로그인 하는 API](https://docs.shopby.co.kr/?url.primaryName=auth/#/Authentication/post-oauth-token-1-success)<br>
* [open ID 로그인을 이용하여 accessToken 을 발행하여 로그인 하는 API<br>](https://docs.shopby.co.kr/?url.primaryName=auth/#/Authentication/post-oauth-openid)

<mark style="color:purple;">**✓  예제**</mark>

{% code overflow="wrap" %}

```
curl --request POST
--url https://shop-api.shopby.co.kr/oauth/token?trackingKey={친구톡캠페인의추적키}
--header 'accept: application/json'
--header 'clientid: {쇼핑몰의 clientid} '
--header 'content-type: application/json'
--header 'platform: PC'
--header 'version: 1.0'
--data '{"memberId":"gildong","password":"testpw123","keepLogin":true,"captcha":null,"provider":null}'
```

{% endcode %}

### **◼︎ 주문**

아래 API 에 query parameter로 전달받은 trackingKey 를 전달합니다.

* [주문서 작성하기 API](https://docs.shopby.co.kr/?url.primaryName=order/#/OrderSheet/post-order-sheet)

<figure><img src="/files/e1mVUQxQLxKxDRpsNUVY" alt=""><figcaption></figcaption></figure>

<img alt="" class="gitbook-drawing">


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://store-help.nhn-commerce.com/app/counsel/kakao_friend_talk/07.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
