# 2. Card List

## Card Listing

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

It will be sufficient to send a request to the address provided above. You can use the 'Base Address' for both the Test environment and the Production environment as you wish.

{% hint style="info" %}
Important: To use the Masterpass - Card Listing service, you must include the parameters **'apikeyprivate'** and **'apiclientprivate'** in the 'Header' field.\
\
[<mark style="color:green;">**PaymentAPI Address**</mark>](https://developer.paywall.one/payment-orchestration-integration-document/environment)
{% endhint %}

<table><thead><tr><th width="182">Parameter</th><th width="106.33333333333331">Type</th><th width="145.37890625">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>apikeyprivate</td><td>string</td><td>Yes</td><td>The Private Key obtained from the merchant panel.</td></tr><tr><td>apiclientprivate</td><td>string</td><td>Yes</td><td>The Private Client obtained from the merchant panel.</td></tr><tr><td>sessionid</td><td>Guid</td><td>Yes</td><td>This is the identifier of the session created specifically for the payment. You can create it through the <a href="#card-listing">Create Session</a> service.</td></tr></tbody></table>

**Response returned from the service:**

<table><thead><tr><th width="156">Parameter</th><th width="83.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>Body</td><td>object</td><td>JSON containing payment details (optional)</td></tr><tr><td>ErrorCode</td><td>int</td><td>Error code. Returns '0' if the transaction is successful.</td></tr><tr><td>Result</td><td>bool</td><td>Returns either true or false. If the transaction is successful, it returns true.</td></tr><tr><td>Message</td><td>string</td><td>If the transaction fails, this is the error message provided, with language support based on the locale parameter.</td></tr></tbody></table>

{% tabs %}
{% tab title="Successful  ✅" %}

```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="Failed (User Not Found) ❌" %}

* **User Not Found**

This situation occurs when the relevant user is not registered in Masterpass. To resolve this, you can direct the user to the card addition step. If the process is completed successfully, the user will be created automatically.

```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="Failed (Authorization)  ❌" %}

* **Account Not Linked to Merchant**

This situation occurs when the relevant user has not granted your company authorization for Masterpass flows. To resolve the issue, the authorization service must be called.

```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 %}
