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

# Getting Started

> Exchange your credential for an access token, then make your first call

The API uses the OAuth 2.0 client credentials grant. You exchange your `client_id` and `client_secret` for an access token, and send that token on every request.

**1. Get your credential**

A merchant finds its `client_id` and `client_secret` in the [Quidkey Console](https://console.quidkey.com). A partner gets them from Quidkey.

> [!WARNING]
>
> The `client_secret` is a secret. Keep it on your server, never in a browser or a mobile app, and never in a URL.

**2. Get an access token**

Call [`POST /oauth2/token`](https://docs.quidkey.com/api-v1/standards/access#tokens) with `grant_type=client_credentials`. Send a form-encoded body, as OAuth 2.0 defines, or JSON.

```bash Form body theme={null}
curl -X POST 'https://api.quidkey.com/v1/oauth2/token' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'grant_type=client_credentials' \
  -d 'client_id=YOUR_CLIENT_ID' \
  -d 'client_secret=YOUR_CLIENT_SECRET'
```

```bash HTTP Basic theme={null}
curl -X POST 'https://api.quidkey.com/v1/oauth2/token' \
  -u 'YOUR_CLIENT_ID:YOUR_CLIENT_SECRET' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'grant_type=client_credentials'
```

```bash JSON body theme={null}
curl -X POST 'https://api.quidkey.com/v1/oauth2/token' \
  -H 'Content-Type: application/json' \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET"
  }'
```

The response follows OAuth 2.0, so it isn't a resource document:

```json Response theme={null}
{
  "access_token": "ACCESS_TOKEN",
  "token_type": "Bearer",
  "expires_in": 900
}
```

There's no refresh token. When the token expires, after `expires_in` seconds, exchange your credential again. A failure answers OAuth's own errors: `401 invalid_client` when the credential isn't accepted, and `400 invalid_request` when the request is malformed.

**3. Read your API key**

Call `GET /api-keys/current` with the token. It reads the credential that made the request, and its `owner` is the account that holds it.

```bash theme={null}
curl 'https://api.quidkey.com/v1/api-keys/current' \
  -H 'Authorization: Bearer ACCESS_TOKEN'
```

```json Response theme={null}
{
  "result": {
    "_type": "api_key",
    "_uri": "/api-keys/key_1",
    "_view": "full",
    "id": "key_1",
    "owner": { "_link": "/merchants/m_1", "_type": "merchant", "id": "m_1" },
    "created_at": null,
    "updated_at": null
  },
  "entities": {},
  "not_included": []
}
```

The `id` is the `client_id` you sent. For a merchant, `owner` links to the merchant, and `?include=owner` adds it to `entities`. For a partner, `owner` carries `_type: "partner"` and the partner's `id`, with no `_link`, because the API doesn't publish partners. Use that `id` in partner routes such as `GET /partners/{id}/merchants`.

## What's Next

> [card] [The standards](https://docs.quidkey.com/api-v1/standards/responses.md)
>
> How every response, link, error and retry works

> [card] [Take a payment with hosted checkout](https://docs.quidkey.com/api-v1/journeys/hosted-checkout.md)
>
> Create a payment transaction and send the customer to pay

> [card] [Onboard a merchant](https://docs.quidkey.com/api-v1/journeys/onboard-a-merchant.md)
>
> For partners: from a new merchant to going live

> [card] [Webhooks](https://docs.quidkey.com/api-v1/webhooks.md)
>
> Receive and verify events


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