# 2. Kart Listesi

## Kart Liste

<mark style="color:blue;">`GET`</mark> `{{Base Address}}/api/paywall/masterpass/card/list`

Yukarıda verilmiş olan adrese istek atmanız yeterli olacaktır. Test ortamı ve Gerçek ortam için 'Base Address' istediğiniz gibi kullanabilirsiniz.

{% hint style="info" %}
Önemli: **Masterpass - Kart Listele** servisini kullanabilmeniz için 'Header' alanında '**apikeyprivate**' ve '**apiclientprivate**' parametrelerini göndermeniz gerekmektedir.\
\
[<mark style="color:green;">**PaymentAPI Adresi**</mark>](/ortam.md)
{% endhint %}

<table><thead><tr><th width="182">Parametre</th><th width="106.33333333333331">Tip</th><th width="97">Zorunlu</th><th>Açıklama</th></tr></thead><tbody><tr><td>apikeyprivate</td><td>string</td><td>Evet</td><td>Üye işyeri panelinden temin etmiş olduğunuz Private Key.</td></tr><tr><td>apiclientprivate</td><td>string</td><td>Evet</td><td>Üye işyeri panelinden temin etmiş olduğunuz Private Client.</td></tr><tr><td>sessionid</td><td>Guid</td><td>Evet</td><td>Ödeme özelinde oluşturulan oturuma ait kimlik bilgisidir. <a href="/pages/xpRDdgZPoDKXW4msT7aK"><mark style="color:blue;"><strong>Oturum Oluştur</strong></mark></a> servisi üzerinden oluşturabilirsiniz.</td></tr></tbody></table>

**Servisten dönen cevap:**

<table><thead><tr><th width="156">Parametre</th><th width="83.33333333333331">Tip</th><th>Açılama</th></tr></thead><tbody><tr><td>Body</td><td>object</td><td>Ödemeye ilişkin detay içeren JSON (opsiyonel)</td></tr><tr><td>ErrorCode</td><td>int</td><td>Hata kodu. İşlem başarılı ise '0' değerini döner.</td></tr><tr><td>Result</td><td>bool</td><td>True ya da false değeri döner. İşlem başarılı iste 'true' değerini döner</td></tr><tr><td>Message</td><td>string</td><td>İşlem hatalıysa, bu hataya dair belirtilen mesajdır, locale parametresine göre dil desteği sunar.</td></tr></tbody></table>

{% tabs %}
{% tab title="Başarılı ✅" %}

```json5
{
    "ErrorCodeType": 1,
    "ErrorMessage": null,
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "Session": {
            "SessionRenewed": false,
            "SessionId": "9b27433e-f36b-1410-80e5-004205aa382d"
        },
        "Masterpass": {
            "Result": {
                "AccountKey": "905123456710",
                "AccountState": "Activated",
                "Cards": [
                    {
                        "CardAlias": "55daa93d-4a99-45de-9431-bb93d0bbf92e",
                        "CardAuthorityUrl": "./assets/icon/Mastercard.svg",
                        "CardBin": "552879",
                        "CardId": 713633,
                        "CardIssuerIcaNumber": "3039",
                        "CardState": "Activated",
                        "CardType": "Credit",
                        "CardValidationType": "OTP",
                        "EftCode": null,
                        "ExpireDate": null,
                        "ExpireSoon": false,
                        "IsCardCreditOrSupportedDebit": true,
                        "IsDefaultCard": true,
                        "IsDefaultMoneySendCard": false,
                        "IsEightDigit": false,
                        "IsExpired": false,
                        "IsIssuerOtpSupported": true,
                        "IsMasterpassMember": true,
                        "MaskedCardNumber": "552879********08",
                        "ProductName": "YIKK",
                        "SourceMerchantId": 0,
                        "SourceMerchantName": null,
                        "SystemEntryDatetime": null,
                        "UniqueCardNumber": "07A7B67D915463CE5D8F14764334F7709FDAC68CE2381AD629E1EA6BA4B493AB"
                    },
                    {
                        "CardAlias": "f1eb4ddf-f0fd-4f16-a8bf-e19d0c7cfa33",
                        "CardAuthorityUrl": "./assets/icon/Maestro.svg",
                        "CardBin": "589004",
                        "CardId": 718546,
                        "CardIssuerIcaNumber": "2110",
                        "CardState": "Activated",
                        "CardType": "Debit",
                        "CardValidationType": "OTP",
                        "EftCode": "0046",
                        "ExpireDate": null,
                        "ExpireSoon": false,
                        "IsCardCreditOrSupportedDebit": false,
                        "IsDefaultCard": false,
                        "IsDefaultMoneySendCard": false,
                        "IsEightDigit": false,
                        "IsExpired": false,
                        "IsIssuerOtpSupported": true,
                        "IsMasterpassMember": true,
                        "MaskedCardNumber": "589004********16",
                        "ProductName": "Neo Maestro",
                        "SourceMerchantId": 0,
                        "SourceMerchantName": null,
                        "SystemEntryDatetime": null,
                        "UniqueCardNumber": "66BFD3745EEAE052A90FF9B427BA1CECB5F3573AB0E621FEF6F63604AA6810DC"
                    }
                ],
                "AccountInformation": {
                    "IsAccountLinked": true
                }
            },
            "BuildId": "83",
            "CorrelationId": "d5ac3ba9-bb68-419f-8dbd-6a5561e0353f",
            "Exception": null,
            "Message": "OK",
            "RequestId": null,
            "StatusCode": 200,
            "Version": null
        }
    }
}
```

{% endtab %}

{% tab title="Başarısız (Kullanıcı Bulunamadı) ❌" %}

* **Kullanıcı Bulunamadı**

Bu durum ilgili kullanıcının Masterpass'de kaydının bulunmadığı durumlarda yaşanır. Bu durumu aşmak için kullanıcıyı kart ekleme adımına yönlendirebilirisiniz. İlgili sürecin başarılı gerçekleşmesi durumda, kullanıcı otomatik oluşturulmuş olacaktır

```json5
{
    "ErrorCodeType": 1,
    "ErrorMessage": null,
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "Session": {
            "SessionRenewed": false,
            "SessionId": "9d27433e-f36b-1410-80e5-004205aa382d"
        },
        "Masterpass": {
            "Result": null,
            "BuildId": "83",
            "CorrelationId": null,
            "Exception": {
                "Level": "Http403",
                "Code": "USER_NOT_FOUND",
                "Message": "Kullanıcı bulunamadı."
            },
            "Message": "Forbidden",
            "RequestId": null,
            "StatusCode": 403,
            "Version": null
        }
    }
}
```

{% endtab %}

{% tab title="Başarısız (Yetki) ❌" %}

* **Hesap İş Yerine Bağlı Değil**

Bu durum ilgili kullanıcının şirketinize Masterpass akışları için yetki vermediği durumlarda yaşanır. Sorunu aşmak için yetki alma servisi çağırılmalıdır

```json5
{
    "ErrorCodeType": 1,
    "ErrorMessage": null,
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "Session": {
            "SessionRenewed": false,
            "SessionId": "b827433e-f36b-1410-80e5-004205aa382d"
        },
        "Masterpass": {
            "Result": null,
            "BuildId": "83",
            "CorrelationId": null,
            "Exception": {
                "Level": "NotFound",
                "Code": "ACCOUNT_NOT_LINKED_TO_MERCHANT",
                "Message": "Hesap iş yerine bağlı değil."
            },
            "Message": "NotFound",
            "RequestId": null,
            "StatusCode": 404,
            "Version": null
        }
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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://developer.paywall.one/masterpass-entegrasyonu/2.-kart-listesi.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.
