> ## Documentation Index
> Fetch the complete documentation index at: https://docs.golfjoin.co.kr/llms.txt
> Use this file to discover all available pages before exploring further.

# 빠른 시작

> 로그인부터 티 매물 등록, 마감까지 한 번에 따라 해 봅니다.

> 매니저 계정으로 로그인해 토큰을 받고, 티를 하나 올렸다가 마감해 봅니다. 테스트용 매물이 실제 사이트에 잠깐 노출되니, 먼 날짜로 올린 뒤 바로 마감하세요.

## 1. 로그인 주소 열기

`code_verifier`와 `state`를 만들고, 매니저의 기본 브라우저로 로그인 주소를 엽니다. 프로그램은 `127.0.0.1`의 빈 포트에서 돌아올 주소를 기다립니다.

```text theme={null}
https://golfjoin.co.kr/oauth/authorize
  ?response_type=code
  &client_id={client_id}
  &redirect_uri=http%3A%2F%2F127.0.0.1%3A53682%2Fcallback
  &state={state}
  &code_challenge={code_challenge}
  &code_challenge_method=S256
```

매니저가 조인성공에 로그인하고 **허용**을 누르면 아래 주소로 돌아옵니다.

```text theme={null}
http://127.0.0.1:53682/callback?code={code}&state={state}
```

받은 `state`가 처음 만든 값과 같은지 꼭 확인하세요. 다르면 그 응답은 버립니다.

## 2. 토큰 받기

```bash theme={null}
curl -X POST https://golfjoin.co.kr/api/v1/oauth/token \
  -d grant_type=authorization_code \
  -d client_id={client_id} \
  -d code={code} \
  -d redirect_uri=http://127.0.0.1:53682/callback \
  -d code_verifier={code_verifier}
```

```json theme={null}
{
  "access_token": "Y9m1...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "q2Lk...",
  "refresh_expires_in": 5184000
}
```

## 3. 골프장 ID 찾기

```bash theme={null}
curl "https://golfjoin.co.kr/api/v1/golf-courses?q=라싸"
```

```json theme={null}
{
  "courses": [
    { "id": 3, "name": "라싸", "region": "GYEONGGI_NORTH", "address": "경기도 포천시 이동면 제비울2길 161", "roadAddress": null, "slug": "rassa" }
  ]
}
```

## 4. 티 매물 등록

```bash theme={null}
curl -X POST https://golfjoin.co.kr/api/v1/manager/contents \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "golfCourseId": 3,
    "courseLabel": "레이크",
    "contentType": "JOIN",
    "playDate": "2026-12-20",
    "teeTime": "07:12",
    "playerCount": 1,
    "joinCondition": "무관",
    "price": 150000,
    "deposit": 0,
    "caddyType": "일반캐디",
    "cartIncluded": true,
    "mealIncluded": false,
    "contentText": "카트비 포함, 캐디피 별도입니다.",
    "externalId": "ext-20261220-0001"
  }'
```

```json theme={null}
{ "id": 188201, "usage": { "plan": { "id": 1, "name": "베이직", "monthlyPostLimit": 999999 }, "posts": { "used": 12, "limit": 999999 }, "month": "2026-11" } }
```

같은 `externalId`로 한 번 더 보내면 새로 만들지 않고 기존 매물 번호를 돌려줍니다.

```json theme={null}
{ "id": 188201, "duplicate": true }
```

## 5. 마감하기

```bash theme={null}
curl -X PATCH https://golfjoin.co.kr/api/v1/manager/contents \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ "id": 188201, "action": "close" }'
```

```json theme={null}
{ "ok": true, "status": "EXPIRED" }
```

## 다음 단계

* 토큰 갱신과 연결 해제는 [인증](https://docs.golfjoin.co.kr/api-introduction/authentication.md)을 보세요.
* 등록 항목과 값 목록은 [티 매물](https://docs.golfjoin.co.kr/api-introduction/tee-times.md)에 정리했습니다.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.