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

# Token Oluşturma

> Modern ödeme altyapısı için güçlü ve esnek API çözümü

<Warning>
  Tüm API çağrılarında, Authorization başlığı altında geçerli bir Bearer Token (access\_token) gönderilmesi zorunludur.
  Access token’lar oluşturulduktan sonra 10 dakika boyunca geçerlidir. Süre aşımında yeni bir token alınmalıdır.
</Warning>

<Info>
  Token oluşturma sürecinde Authorization Bearer `secret_key` ya da `public_key` olarak kullanılabilir. `public_key` ile oluşturulan token, sadece 3DS ödemeler için kullanılabilir. Diğer tüm endpoint'ler için access token gereklidir.
</Info>

***

İstek:

<CodeGroup>
  ```curl cURL theme={null}
  curl -L -X POST 'https://api.tahsilat.com/v1/token/get-token' \
  -H 'Content-Type: application/json' \
  -H 'Accept-Language: tr' \
  -H 'Authorization: Bearer {secret_key or public_key}'
  ```
</CodeGroup>

Yanıt:

<CodeGroup>
  ```json JSON theme={null}
  {
      "status": true,
      "message": "Token başarıyla oluşturuldu.",
      "errors": [],
      "error_code": null,
      "data": {
          "access_token": "4Ba7412xBvQbTEn9Ex0PZLrPpTO1dgBvL0Txz5gFbfM79JZHqJGjf8d4JqsKdi0aKgVBfJJ68Ib4SINkbu20HI3145...",
          "supports_3d": true,
          "supports_2d": false,
          "supports_white_label": true,
          "supports_installment": false,
          "expires_at": "2025-06-11T23:36:17+03:00"
      }
  }
  ```
</CodeGroup>

<div className="panels">
  <Panel>
    İstek

    <CodeGroup>
      ```md Endpoint theme={null}
      https://api.tahsilat.com/v1/
      ```
    </CodeGroup>

    <br />

    İstek

    <CodeGroup>
      ```curl cURL theme={null}
      curl -L -X POST 'https://api.tahsilat.com/v1/token/get-token' \
      -H 'Content-Type: application/json' \
      -H 'Accept-Language: tr' \
      -H 'Authorization: Bearer {secret_key or public_key}'
      ```
    </CodeGroup>

    <br />

    Yanıt

    <CodeGroup>
      ```json JSON theme={null}
      {
          "status": true,
          "message": "Token başarıyla oluşturuldu.",
          "errors": [],
          "error_code": null,
          "data": {
              "access_token": "4Ba7412xBvQbTEn9Ex0PZLrPpTO1dgBvL0Txz5gFbfM79JZHqJGjf8d4JqsKdi0aKgVBfJJ68Ib4SINkbu20HI3145...",
              "supports_3d": true,
              "supports_2d": false,
              "supports_white_label": true,
              "supports_installment": false,
              "expires_at": "2025-06-11T23:36:17+03:00"
          }
      }
      ```
    </CodeGroup>

    <Note>
      Secret key sadece arka uçta kullanılmalı ve asla açıkta olmamalıdır.
      Public key’i güvenle mobil ve web uygulamalarınızda kullanabilirsiniz.
    </Note>
  </Panel>
</div>
