# 4. Decrease Earnings

## Decrease earnings by earning ID (EarningId)

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

{% hint style="info" %}
Important: To use the Decrease Earnings service, you need to send the parameters **apikeypublic** and **apiclientpublic** in the 'Header' field.\
\
[<mark style="color:green;">**PaymentAPI Address**</mark>](https://developer.paywall.one/payment-orchestration-integration-document/environment)
{% endhint %}

{% hint style="warning" %}
To perform this operation, the earning must not have been paid yet. Otherwise, the Paywall service will return an error message.
{% 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>The Public Key you obtained from the member workplace panel.</td></tr><tr><td>apiclientpublic</td><td>string</td><td>Yes</td><td>The Public Client you obtained from the member workplace panel.</td></tr></tbody></table>

**Parameters to be sent to the service:**

<table><thead><tr><th width="189">Parameter</th><th width="100.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>Id</td><td>int</td><td>The Id (identity) of the earning</td></tr><tr><td>Earning</td><td>decimal</td><td>The amount you want to decrease the earning by</td></tr></tbody></table>

**Response 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 true or false. 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 explaining the error. Supports language localization based on the locale parameter.</td></tr><tr><td>Body</td><td>object</td><td>Detailed information about the operation.</td></tr></tbody></table>

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

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

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