> For the complete documentation index, see [llms.txt](https://docs.iyzico.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.iyzico.com/en/payment-methods/tokenization/tokenization-integration/last-payment-detail-info.md).

# Last Payment Detail Info

This service returns the details of the member’s most recent payment.\
It must be called using the `accessToken` obtained from the **Access Token Retrieval Service**.

## Retrieve Last Payment Info

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

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Authorization`    |
| access-token  | `{{accessToken}}`  |

### **Request Parameter**

| Parameter          | Type   | Required | Description                                                                                                                                                         |
| ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sessionToken`     | String | Yes      | This is the session key information that the Member pays in the same payment type.                                                                                  |
| `memberIdentifier` | String | Yes      | Member unique key information. This key is used for member information in payment transactions.                                                                     |
| `locale`           | String | No       | Used to set the language of the texts returned as a result of iyzico request. The default value is en. can be used as en.                                           |
| `conversationId`   | String | No       | A value that you can send during the request and receive at the end can be used to match request/response. The most common use case is the merchant's order number. |

### Request

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

### Response

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

```json
{
    "status": "success",
    "locale": "en",
    "systemTime": 1749032543970,
    "conversationId": "conversationId",
    "card": {
        "cardHolderName": "John Doe",
        "cardAssociation": "MASTER_CARD",
        "cardFamily": "Advantage",
        "binNumber": "55047200",
        "lastFourDigits": "0003",
        "cardBankName": "HSBC",
        "cardType": "CREDIT_CARD",
        "expireMonth": "05",
        "expireYear": "2026",
        "expired": false,
        "willExpireSoon": false
    },
    "paymentType": "CARD_PAYMENT",
    "sessionToken": "f403ef2f-fb08-4111-afd6-495811ef6b25",
    "token": "e54b957b-a153-410c-8761-79c9bd4ff44f",
    "paymentId": 24259238
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "status": "failure",
    "errorCode": "100311",
    "errorMessage": "Access token expired",
    "systemTime": 1750250774313
}
```

{% endtab %}
{% endtabs %}

### Response Parameters

| Parameter         | Type    | Description                                                                                                                                                                                              |
| ----------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`          | String  | Service response result (success / failure).                                                                                                                                                             |
| `locale`          | String  | Specifies the language of the returned response.                                                                                                                                                         |
| `systemTime`      | Long    | Response system unix timestamp value.                                                                                                                                                                    |
| `conversationId`  | String  | If set, conversation ID to match request and response.                                                                                                                                                   |
| `cardHolderName`  | String  | <p>Name and Surname of the Cardholder.<br>Returns when payment is made with the card.</p>                                                                                                                |
| `cardAssociation` | String  | <p>Returns when payment is made by card.<br>Valid values are VISA, MASTER\_CARD, AMERICAN\_EXPRESS, TROY</p>                                                                                             |
| `errorCode`       | String  | If the operation was failed, this is the code that indicates the error.                                                                                                                                  |
| `errorMessage`    | String  | If the operation is failed, this is a message detailing the error, with language support according to the locale parameter.                                                                              |
| `cardFamily`      | String  | <p>Returns when payment is made by card.<br>Returns card family information.<br>Valid values Bonus, Axess, World, Maximum, Paraf, CardFinans, Advantage</p>                                              |
| `binNumber`       | String  | <p>Returns when payment is made by card.<br>First 8 digits of the card.</p>                                                                                                                              |
| `lastFourDigits`  | String  | <p>Returns when payment is made by card.<br>Last 4 digits of the card.</p>                                                                                                                               |
| `cardBankName`    | String  | <p>Returns when payment is made by card.<br>Card Bank Name.</p>                                                                                                                                          |
| `cardType`        | String  | <p>Returns when payment is made by card.<br>If the payment card is a local card, it returns the card type information. It takes the values DEBIT\_CARD and CREDIT\_CARD.</p>                             |
| `expireMonth`     | String  | <p>Returns when payment is made by card.<br>Expiry date is returned on a month basis.</p>                                                                                                                |
| `expireYear`      | String  | <p>Returns when payment is made by card.<br>Returns the expire date in years.</p>                                                                                                                        |
| `expired`         | boolean | <p>Returns when payment is made by card.<br>Card expire information<br>takes true and false values.<br>Returns true if the card has expired.</p>                                                         |
| `willExpireSoon`  | boolean | <p>Returns when payment is made by card.<br>This is the expiration information of the card in this month.<br>takes true and false values.<br>Returns true if the card will expire within this month.</p> |
| `paymentType`     | String  | <p>Specifies the payment type. It can return FUND or CARD\_PAYMENT.<br>FUND Balance Payment<br>CARD\_PAYMENT: Card Payment</p>                                                                           |
| `sessionToken`    | String  | It is the session key information that the Member pays in the same payment type.                                                                                                                         |
| `token`           | String  | Unique value created for checkout form. It is generated for each transaction and returned to the merchant.                                                                                               |
| `paymentId`       | Stirng  | The ID of the payment must be kept by the merchant. It is used for payment cancellation and communication with iyzico.                                                                                   |
