> For the complete documentation index, see [llms.txt](https://developers.payssam.kr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.payssam.kr/preparation/api-key.md).

# API 키

## API key 이해하기

결제선생 파트너 연동 시 각 파트너별로 고유한 API key를 발급받게 됩니다.\
API key는 사업장 정보를 인증함과 동시에 결제선생 API에서 유효한 파트너를 통해 호출되었다는 인증도 같이 진행됩니다.\
따라서 발급받은 API key가 외부에 유출되지 않도록 유의하셔야 합니다.

## API key 발급 받기

API key는 파트너가 임의로 사용할 수 없습니다.\
운영환경과 개발환경에 따라 API key가 엄격하게 구분되어 있으며 각 API key의 발급 시점이 별도로 존재합니다.\
(개발환경 API KEY는 V1, V2는 혼용이 가능합니다)

<details open>

<summary><strong>Sandbox API key 발급받기</strong></summary>

개발 환경 API key는 페이민트를 통해 파트너 계약을 맺음과 동시에 발급이 진행됩니다.\
발급받은 개발 환경 API key는 개발 환경에서만 사용할 수 있습니다.

</details>

<details open>

<summary><strong>Live API Key 발급받기</strong></summary>

운영 환경 API key는 개발환경에서 연동검수 완료 이후에 발급됩니다\
발급받은 운영 환경 API key는 운영 환경에서만 사용할 수 있습니다.

</details>

{% hint style="info" %}

#### API Key와 Merchant 구분

* `Merchant` 값은 하위사업장을 구분하는 값으로 일반적인 상점아이디(MID)와 유사합니다.
* 파트너에서 생성한 `Merchant` 는 결제선생에 전달되면 해당 사업장은 파트너의 하위사업장으로 등록됩니다.
  {% endhint %}

## 버전별 API key 사용하기

API key는 결제선생 api가 제공하는 v1, v2 버전의 모든 API에서 제한없이 사용할 수 있습니다


---

# 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://developers.payssam.kr/preparation/api-key.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.
