# 1. Get Earnings

## **Retrieve earnings information based on product**

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

{% hint style="info" %}
**Important:** To use the Product-Based Earnings 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="107">Compolsory</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>productid</td><td>int</td><td>Yes</td><td>ID information of the product related to the payment 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": {
        "PaymentId": 111222,
        "ProductId": 2114065,
        "ProductExternalId": "ProductId",
        "ProductName": "ProductName",
        "ProductAmount": 100.00,
        "MerchantEarningId": 2104,
        "MerchantEarning": 0.00,
        "MerchantReflectionDate": "2023-09-17T00:00:00",
        "SubMerchantEarningId": 2103,
        "SubMerchantEarning": 99.00,
        "SubMerchantReflectionDate": "2023-11-18T00:00:00",
        "MerchantEarningStatusId": 10,
        "MerchantPayoutTransactionId": 0,
        "SubMerchantEarningStatusId": 11,
        "SubMerchantPayoutTransactionId": 0
    }
}
```

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