# Retrieve Session

This service is used to retrieve the current status of the session created after the payment process. To query a session, the `checkoutFormToken` of the payment form and the `paymentId` of the related transaction must be provided.

Instead of returning direct payment details, the service response includes session-related information. In this context, fields such as `sessionToken`, `memberIdentifier`, `sessionStatus`, and `paymentType` can be used to track the session status and user-related information.

It is recommended to use this service after the payment flow is completed to verify the final state of the session and obtain user session details. This ensures that the payment process can be securely monitored without relying on client-side redirects.

### Retrieve Session

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

#### **Headers**

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

### Request

```json
{
  "locale": "tr",
  "conversationId": "123456789",
  "checkoutFormToken": "ab468ec8-c4ab-4449-b15b-69782f7786c6",
  "paymentId": "29414275"
}
```

### **Request Parameters**

<table><thead><tr><th width="190.3515625">Paremetre</th><th>Tip</th><th>Zorunluluk</th><th>Açıklama</th></tr></thead><tbody><tr><td><code>checkoutFormToken</code></td><td>string</td><td>Evet</td><td>Token value of the payment form associated with the transaction.</td></tr><tr><td><code>locale</code></td><td>string</td><td>Hayır</td><td>Language value sent in the request. Can be <code>EN</code> or <code>TR</code>.</td></tr><tr><td><code>conversationId</code></td><td>string</td><td>Hayır</td><td>A value sent within the request and returned in the response, used to match request and response.</td></tr><tr><td><code>paymentId</code></td><td>string</td><td>Evet</td><td>The payment identifier of the completed transaction.</td></tr></tbody></table>

### Response

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

```json
{
    "status": "success",
    "locale": "tr",
    "systemTime": 1775471642206,
    "sessionInfo": {
        "sessionToken": "f2f06a82-6480-4d2b-811d-93168ddce577",
        "sessionStatus": "PASSIVE",
        "memberIdentifier": "702831f3-1cc6-4b25-ad2b-878afc64f408",
        "paymentType": "CARD_PAYMENT"
    }
}
```

{% endtab %}

{% tab title="400" %}

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

{% endtab %}
{% endtabs %}

### **Response Parameters**

<table><thead><tr><th width="190.3515625">Paremetre</th><th>Tip</th><th>Açıklama</th></tr></thead><tbody><tr><td><code>status</code></td><td>string</td><td>Result of the request.</td></tr><tr><td><code>locale</code></td><td>string</td><td>The locale value sent in the request.</td></tr><tr><td><code>systemTime</code></td><td>Long</td><td>Transaction time (epoch ms).</td></tr><tr><td><code>sessionToken</code></td><td>string</td><td>Session key information of the payment transaction performed by the member.</td></tr><tr><td><code>sessionStatus</code></td><td>string</td><td>Status of the session. Can be <code>ACTIVE</code> or <code>PASSIVE</code>.</td></tr><tr><td><code>memberIdentifier</code></td><td>string</td><td>Unique key of the member.</td></tr><tr><td><code>paymentType</code></td><td>string</td><td><p></p><p>Indicates the payment type. Can be <code>FUND</code> or <code>CARD_PAYMENT</code>.</p><ul><li><code>FUND</code>: Wallet balance payment</li><li><code>CARD_PAYMENT</code>: Card payment</li></ul></td></tr></tbody></table>
