# Update Setting

<mark style="color:orange;">**`PUT`**</mark> `https://api.sfox.com/v1/enterprise/monetization/settings/:id`

This endpoint allows Partners to update the monetization amount of existing monetization settings. For example, you would use this endpoint to increase or decrease the monetization amount of a specific monetization setting. Once updated, all future orders or transactions will be charged the new monetization amount.

### Path Parameters

<table><thead><tr><th width="176">Name</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code> <mark style="color:red;">required</mark></td><td>number</td><td>The monetization ID of the setting to be updated</td></tr></tbody></table>

### Body Parameters

<table><thead><tr><th width="308">Name</th><th width="105">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>new_monetization_amount</code> <mark style="color:red;">required</mark></td><td>number</td><td>The updated monetization amount. <br>Must be > 0.</td></tr></tbody></table>

### Responses

<details>

<summary><mark style="color:green;"><strong>200 OK</strong></mark></summary>

{% code title="Setting Updated" %}

```json
{
    "data": {
        "monetization_id": 1310717,
        "monetization_feature": "Spot Trading",
        "monetization_feature_code": "SPOT_TRADE",
        "monetization_method": "Fee Rate",
        "monetization_method_code": "FEE_RATE",
        "monetization_amount": 0.01,
        "user_id": "client25",
        "currency_code": null,
        "security_pair_raw": null,
        "date_updated": "2023-06-07T21:49:22.000Z"
    }
}
```

{% endcode %}

</details>

<details>

<summary><mark style="color:red;"><strong>422 Unprocessable Content</strong></mark></summary>

{% code title="Invalid amount, format, or ID" %}

```json
{
    "error": "new_monetization_amount must be greater than 0"
}

{
    "error": "new_monetization_amount must be a number"
}

{
    "error": "Invalid monetization ID."
}
```

{% endcode %}

</details>

<details>

<summary><mark style="color:red;"><strong>403 Forbidden</strong></mark></summary>

{% code title="No permission" %}

```json
{
    "error": "You do not have RFQ monetization permission"
}

{
    "error": "You do not have FEE_RATE monetization permission for RFQ"
}
```

{% endcode %}

</details>

### Response Body

| Key                         | Description                                       |
| --------------------------- | ------------------------------------------------- |
| `monetization_id`           | Unique ID for this monetization setting           |
| `monetization_feature`      | Feature the fee will apply to                     |
| `monetization_feature_code` | API readable monetization feature                 |
| `monetization_method`       | Monetization method of the setting                |
| `monetization_method_code`  | API readable monetization method                  |
| `monetization_amount`       | Monetization amount in decimal format             |
| `user_id`                   | User Id of the user that the fee is specified for |
| `currency_code`             | Currency that the fee is specified for            |
| `currency_pair`             | Currency pair that the fee is specifed for        |
| `date_updated`              | Datetime the fee was created or updated           |

### Example Requests

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

```sh
curl -X PUT \
  -H 'Content-type: application/json' \
  -H 'Authorization: Bearer <ENTERPRISE_API_KEY>' \
  --data '{ "new_monetization_amount": 0.01}'  \
  'https://api.sfox.com/v1/enterprise/monetization/settings/1310717'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

const config = {
  method: 'put',
  url: 'https://api.sfox.com/v1/enterprise/monetization/settings/1310717',
  headers: {
    "Content-Type": "application/json",
    'Authorization': `Bearer ${process.env.ENTERPRISE_API_KEY}`
  },
  data: {
    new_monetization_amount: 0.01
  }
}

axios(config)
  .then((response) => {
    console.log(response.status);
    console.log(response.data);
  })
  .catch((error) => {
    console.error(error.response.status);
    console.error(error.response.data);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests 
import os

data = requests.put(
  "https://api.sfox.com/v1/enterprise/monetization/settings/1310717",
  headers={
    "Authorization": f"Bearer {os.environ['ENTERPRISE_API_KEY']}"
  },
  json={
    "new_monetization_amount": 0.01
  }
)
print(data.status_code)
print(data.json())
```

{% 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://docs.sfox.com/connect/rest-api/monetization/update-setting.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.
