# 4. Decrease Earnings

## **Product-Based Earnings Decrease**

<mark style="color:orange;">`PUT`</mark> `{{Base Adres}}/api/paywall/marketplace/earning/decrease/product`

{% hint style="info" %}
**Important:** To use the Product-Based Earnings Decrease 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="126.9921875">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></tbody></table>

**The parameters to be sent to the service are as follows:**

<table><thead><tr><th width="189">Parameter</th><th width="100.33333333333331">Type</th><th>Descripiton</th></tr></thead><tbody><tr><td>ProductId</td><td>int</td><td>Product ID information. It is returned within the Paywall response object at the time of payment.</td></tr><tr><td>Earning</td><td>decimal</td><td>The amount by which you want to decrease the earnings</td></tr><tr><td>ApplyAll</td><td>bool</td><td><p>It affects both the earnings for the product and the earnings generated for the platform (you) associated with the product.</p><p></p><p>Example: If TRUE is sent, both your seller’s earnings and your platform’s earnings will be affected.</p></td></tr></tbody></table>

**Response returned from the service:**

<table><thead><tr><th width="189">Parameter</th><th width="100.33333333333331">Type</th><th>Descripiton</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 true or false. Returns 'true' if the operation is successful.</td></tr><tr><td>Message</td><td>string</td><td>If the operation failed, this is the message describing the error, with language support based on the locale parameter.</td></tr><tr><td>Body</td><td>object</td><td>Operation detail information</td></tr></tbody></table>

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

```json
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": null
}
```

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