# Access Token Alma

Tokenization ödeme tetiklenebilmesi ve son ödeme bilgilerinin alınabilmesi için accessToken ihtiyaç bulunmaktadır. Bu servise yapılacak sorgu ile accessToken bilgisine ulaşılmaktadır.

{% hint style="info" %}
Oluşturulan accessToken'ın 5 dakikalık süresi bulunmaktadır. Bu süre aşıldığı taktirde yeni token oluşturulmalıdır.
{% endhint %}

### Access Token Alma

<mark style="color:green;">`POST`</mark> `https://api.iyzipay.com/v1/pay-with-iyzico/third-party-session/retrieve/access-token`<br>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Authorization`    |

### İstek Parametreleri

| Parametre          | Tip    | Açıklama                                                                                                                                                                         |
| ------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sessionToken`     | String | Member'ın aynı ödeme tipinde ödeme yaptığı session key bilgisidir.                                                                                                               |
| `memberIdentifier` | String | Member unique key bilgisidir. Bu key, ödeme işlemlerinde member bilgisi için kullanılır.                                                                                         |
| `locale`           | String | iyzico istek sonucunda dönen metinlerin dilini ayarlamak için kullanılır. Varsayılan değeri tr’dir. **en** olarak kullanılabilir.                                                |
| `conversationId`   | String | İstek esnasında gönderip, sonuçta alabileceğiniz bir değer, request/response eşleşmesi yapmak için kullanılabilir. En yaygın kullanış biçimi üye iş yerinin sipariş numarasıdır. |

### Örnek İstek

```json
{
    "sessionToken": "{{sessionToken}}",
    "memberIdentifier": "{{memberIdentifier}}",
    "locale": "tr",
    "conversationId": "test"
}
```

### **Örnek Yanıt**

{% tabs %}
{% tab title="200" %}

```json
{
    "status": "success",
    "locale": "tr",
    "systemTime": 1749027862133,
    "conversationId": "test",
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiItIiwic2NvcGUiOlsidGhpcmRQYXJ0eVNlc3Npb24iXSwic2Vzc2lvblRva2VuIjoiZDUzZWRiNzItNTNmMy00NmY0LTk5NWQtNDM1NzBhOTdiZDg4IiwiZXhwIjoxNzQ5MDI4MjIyLCJhdXRob3JpdGllcyI6WyJwd2lfdHBfc2Vzc2lvbl9jYXJkX2F1dGgiLCJwd2lfdHBfc2Vzc2lvbl9pbml0M2RzX2F1dGgiLCJwd2lfdHBfc2Vzc2lvbl9sYXN0X3BheW1lbnRfcmV0cmlldmUiLCJwd2lfdHBfc2Vzc2lvbl9mdW5kX2F1dGgiXSwianRpIjoiMTUwODdmNTgtZGE4Yy00OTFhLWFjN2QtYmYyODI2ODNmMGRlIiwiY2xpZW50X2lkIjoidGhpcmRQYXJ0eVNlc3Npb25DbGllbnQifQ.YC5McE1SdXrPeCpljrMU1X3kzc3FV7I8DoZ5G0qcS30"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "status": "failure",
    "errorCode": "260016",
    "errorMessage": "Session token bulunamadı.",
    "locale": "tr",
    "systemTime": 1749027045713
}
```

{% endtab %}
{% endtabs %}

### Yanıt Parametreleri

|                  |        |                                                                                                         |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------- |
| `status`         | String | İstek sonucunu ifade eder. success yada failure değerleri dönebilmektedir.                              |
| `locale`         | String | Dönen yanıtın dilini ifade eder.                                                                        |
| `systemTime`     | Long   | Dönen sonucun o anki unix timestamp değeridir.                                                          |
| `conversationId` | String | İstek esnasında gönderilen değer dönmektedir.                                                           |
| `accessToken`    | String | Member için servisler aracılığıyla ödeme tetikleyebileceği bearer token bilgisidir.                     |
| `errorCode`      | String | İşlem hatalıysa, bu hataya dair belirtilen koddur.                                                      |
| `errorMessage`   | String | İşlem hatalıysa, bu hataya dair detay belirtilen mesajdır, locale parametresine göre dil desteği sunar. |


---

# 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://docs.iyzico.com/odeme-metotlari/tokenize-cuzdan-odemesi/tokenization-entegrasyonu/access-token-alma.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.
