# 1. Get Debt

## **Retrieve debt information based on payment**

<mark style="color:blue;">`GET`</mark> `{{Base Adres}}/api/paywall/marketplace/report/debt/payment`

{% hint style="info" %}
**Important:** To use the Payment-Based Debt service, you must include the **apikeypublic** and **apiclientpublic** parameters in the **Header** section.\
\
[<mark style="color:green;">**PaymentAPI Address**</mark>](https://developer.paywall.one/payment-orchestration-integration-document/environment)
{% endhint %}

<table><thead><tr><th width="188">Parameter</th><th width="79">Type</th><th width="139.04296875">Compulsory</th><th width="403">Description</th></tr></thead><tbody><tr><td>apikeypublic</td><td>string</td><td>Yes</td><td>Public Key obtained from the merchant panel.</td></tr><tr><td>apiclientpublic</td><td>string</td><td>Yes</td><td>Public Client obtained from the merchant panel.</td></tr><tr><td>paymentid</td><td>int</td><td>Yes</td><td>Payment ID information in Paywall</td></tr></tbody></table>

**Response returned from the service:**

<table><thead><tr><th width="189">Parameter</th><th width="100.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>ErrorCode</td><td>int</td><td>Error code. Returns '0' if the operation is successful.</td></tr><tr><td>Result</td><td>bool</td><td>Returns a true or false value. Returns 'true' if the operation is successful.</td></tr><tr><td>Message</td><td>string</td><td>If the operation fails, this is the message describing the error, supporting localization based on the locale parameter.</td></tr><tr><td>Body</td><td>object</td><td>Detailed information about the transaction</td></tr></tbody></table>

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": [
        {
            "DebtId": 947,
            "Type": 2,
            "TypeName": "Cargo",
            "MemberId": 148,
            "MemberName": "test",
            "CurrencyId": 1,
            "Currency": "TRY",
            "ProductId": 2114065,
            "ProductAmount": 100.00,
            "DebtAmount": 120.00,
            "DebtStatusId": 1,
            "DebtTransactionId": 0,
            "Cargo": {
                "CargoId": 466722,
                "CargoOwnerType": 1,
                "CargoCost": 120.00
            },
            "Discount": null,
            "CalculationDateTime": "2023-09-15T14:53:58.5074"
        },
        {
            "DebtId": 948,
            "Type": 1,
            "TypeName": "Discount",
            "MemberId": 148,
            "MemberName": "test",
            "CurrencyId": 1,
            "Currency": "TRY",
            "ProductId": 2114065,
            "ProductAmount": 100.00,
            "DebtAmount": 9.90,
            "DebtStatusId": 1,
            "DebtTransactionId": 0,
            "Cargo": null,
            "Discount": {
                "DiscountId": 465176,
                "DiscountOwnerType": 1,
                "DiscountType": 1,
                "Discount": 10.00
            },
            "CalculationDateTime": "2023-09-15T14:53:58.530093"
        }
    ]
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
