# 7. Hesap ile Bağlantı Kur

## Hesap ile Bağlantı Kur

<mark style="color:green;">`POST`</mark> `{{Base Address}}/api/paywall/masterpass/merchant/link`

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 - Hesap ile Bağlantı Kur** 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></tbody></table>

#### Servise gönderilmesi gereken parametreler şu şekildedir:

<table><thead><tr><th width="228">Parametre</th><th width="106">Tip</th><th width="123">Zorunlu</th><th>Açıklama</th></tr></thead><tbody><tr><td>SessionId</td><td>Guid</td><td>Evet</td><td><a href="/pages/xpRDdgZPoDKXW4msT7aK">Oturum Kimliği</a> bilgisi</td></tr></tbody></table>

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

```json5
{
    "SessionId": "2193433e-f36b-1410-825e-001264113a90"
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
// Soon
```

{% endtab %}

{% tab title="GO" %}

```go
// Soon
```

{% endtab %}

{% tab title="Java" %}

```java
// Soon
```

{% endtab %}

{% tab title="PHP" %}

```php
// Soon
```

{% endtab %}

{% tab title="Python" %}

```python
// Soon
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
// Soon
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
// Soon
```

{% endtab %}

{% tab title="Curl" %}

```sh
// Soon
```

{% endtab %}
{% endtabs %}

**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>

{% hint style="info" %}
**`Body > Masterpass > Result > StatusCode` ve `Body > Masterpass > Result > ResponseCode` dizini altındaki parametre kontrol edilerek akış kurulmalıdır**

* [**Masterpass ResponseCode Listesi**](/sistem-verileri/masterpass-cevap-kodlari.md)
  {% endhint %}

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

```json5
{
    "ErrorCodeType": 1,
    "ErrorMessage": null,
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "Session": {
            "SessionRenewed": false,
            "SessionId": "b827433e-f36b-1410-80e5-004205aa382d"
        },
        "Masterpass": {
            "Result": {
                "RetrievalReferenceNumber": "100005844117",
                "ResponseCode": "5001",
                "Description": "Telefonunuza gelen tek kullanımlık şifreyi girerek kart doğrulama işlemini tamamlayınız",
                "Token": "c0645409b83f4344bf588ef4142559a9",
                "CardIssuerName": "Akbank",
                "MaskedPan": "************0016"
            },
            "BuildId": "83",
            "CorrelationId": "261efc9a-7296-42ef-b5b7-0ee0ca512e6b",
            "Exception": null,
            "Message": "Accepted",
            "RequestId": null,
            "StatusCode": 202,
            "Version": null
        }
    }
}
```

{% endtab %}

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

```json
{
    "ErrorCodeType": 1,
    "ErrorMessage": null,
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "Session": {
            "SessionRenewed": false,
            "SessionId": "c227433e-f36b-1410-80e5-004205aa382d"
        },
        "Masterpass": {
            "Result": null,
            "BuildId": "83",
            "CorrelationId": null,
            "Exception": {
                "Level": "NotFound",
                "Code": "ACCOUNT_NOT_FOUND",
                "Message": "Hesap bulunamadı."
            },
            "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/7.-hesap-ile-baglanti-kur.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.
