> For the complete documentation index, see [llms.txt](https://docs.payengine.co/payengine-api-v2.5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payengine.co/payengine-api-v2.5/onboarding/retrieve-merchant-details-1.md).

# Update Merchant Fee Schedule

This endpoint allows you to update the fee schedule for an existing merchant in the system. By providing a merchant ID and a new fee schedule ID, you can modify the fee structure associated with a specific merchant account.

#### HTTP Method and URL

<mark style="color:orange;">`PATCH`</mark>`https://<Platform-host>/merchant/:merchant_id/fee-schedule`

#### Path Parameters

You need to specify the following path parameter in the request URL:

<table><thead><tr><th width="168">Name</th><th width="106">Type</th><th width="116">Required</th><th>Description</th></tr></thead><tbody><tr><td>merchant_id</td><td>string</td><td>Yes</td><td>The unique identifier for the merchant whose fee schedule is to be updated.</td></tr></tbody></table>

#### Request Parameters

Include the following parameter in your request body to specify which fee schedule to apply to the merchant:

<table><thead><tr><th>Name</th><th width="117">Type</th><th width="111">Required</th><th>Description</th></tr></thead><tbody><tr><td>fee_schedule_id</td><td>string</td><td>Yes</td><td>The identifier of the new fee schedule to apply to the specified merchant. This ID should correspond to a fee schedule that is already defined in the system.</td></tr></tbody></table>

#### Responses

The server can return the following responses:

* `200` OK: The response body contains a message `"merchant updated"`. This status code indicates that the fee schedule has been successfully updated for the merchant.
* Error response: If the update cannot be completed due to an issue, such as an invalid merchant ID or fee schedule ID, the server will respond with an appropriate error message and status code. This may include `400 Bad Request` if the request is malformed, `404 Not Found` if the merchant or fee schedule ID does not exist, or other codes depending on the nature of the error.

{% tabs %}
{% tab title="200 Response" %}

| Name          | Type    | Description      |
| ------------- | ------- | ---------------- |
| message       | string  | Merchant updated |
| data          | boolean | true \| false    |
| {% endtab %}  |         |                  |
| {% endtabs %} |         |                  |

#### Example

Here is an example of a successful request and response using cURL:

**Request**

<pre class="language-shell"><code class="lang-shell"><strong>curl -X POST "https://&#x3C;Platform-host>/api/v2/merchant/802db58e-9f7e-4825-af6d-a2779f08038d/fee-schedule/update" \
</strong>     -H "Content-Type: application/json" \
     -d '{"fee_schedule_id": "new_fee_schedule_id"}'
</code></pre>

**Successful Response**

```json
{
  "message": "merchant updated"
}
```

Please ensure that you replace `<Platform-host>` with the actual host address of the Platform API, and substitute real values for 802db58e-9f7e-4825-af6d-a2779f08038d (merchant ID) and `new_fee_schedule_id` (new fee schedule ID).

This endpoint is crucial for maintaining up-to-date fee schedules for your merchants, allowing for flexibility and adaptation to new pricing strategies or adjustments in your business model.
