> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidoc.dreamclass.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidoc.dreamclass.io/_mcp/server.

# UpdateFees

PATCH https://dreamclassapi/v1/financial/fees/update/31
Content-Type: application/json

Update editable fields of a fee

Input variables

- feeId: id of the fee
- json representation of editable fields of a Fee
    - cost
    - description
    - startDate
    - duration (applicable only for fees that are not oneoff)
    - interval (applicable only for fees that are not oneoff)

Reference: https://apidoc.dreamclass.io/dream-class-api/fees/update-fees

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /dreamclassapi/v1/financial/fees/update/31:
    patch:
      operationId: update-fees
      summary: UpdateFees
      description: |-
        Update editable fields of a fee

        Input variables

        - feeId: id of the fee
        - json representation of editable fields of a Fee
            - cost
            - description
            - startDate
            - duration (applicable only for fees that are not oneoff)
            - interval (applicable only for fees that are not oneoff)
      tags:
        - subpackage_fees
      parameters:
        - name: tenant
          in: header
          required: false
          schema:
            type: string
        - name: schoolCode
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Fees_UpdateFees_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                cost:
                  type: integer
                duration:
                  type: integer
                interval:
                  type: integer
                startDate:
                  type: string
                  format: date
                description:
                  type: string
              required:
                - cost
                - duration
                - interval
                - startDate
                - description
servers:
  - url: https:/
    description: https://{server}
  - url: https://your-webhook-url
    description: https://your-webhook-url
components:
  schemas:
    Fees_UpdateFees_Response_200:
      type: object
      properties:
        id:
          type: integer
        cost:
          type: integer
        type:
          description: Any type
        period:
          description: Any type
        duration:
          type: integer
        interval:
          type: integer
        startDate:
          type: string
          format: date
        description:
          type: string
        schoolPeriodId:
          description: Any type
      required:
        - id
        - cost
        - duration
        - interval
        - startDate
        - description
      title: Fees_UpdateFees_Response_200

```

## Examples



**Request**

```json
{
  "cost": 50,
  "duration": 10,
  "interval": 1,
  "startDate": "2023-06-01",
  "description": "test monthly fees"
}
```

**Response**

```json
{
  "id": 11,
  "cost": 50,
  "duration": 10,
  "interval": 1,
  "startDate": "2023-06-01",
  "description": "test monthly fees"
}
```

**SDK Code**

```python Fees_UpdateFees_example
import requests

url = "https://https/dreamclassapi/v1/financial/fees/update/31"

payload = {
    "cost": 50,
    "duration": 10,
    "interval": 1,
    "startDate": "2023-06-01",
    "description": "test monthly fees"
}
headers = {
    "tenant": "{{tenant}}",
    "schoolCode": "{{schoolCode}}",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Fees_UpdateFees_example
const url = 'https://https/dreamclassapi/v1/financial/fees/update/31';
const options = {
  method: 'PATCH',
  headers: {
    tenant: '{{tenant}}',
    schoolCode: '{{schoolCode}}',
    'Content-Type': 'application/json'
  },
  body: '{"cost":50,"duration":10,"interval":1,"startDate":"2023-06-01","description":"test monthly fees"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Fees_UpdateFees_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/dreamclassapi/v1/financial/fees/update/31"

	payload := strings.NewReader("{\n  \"cost\": 50,\n  \"duration\": 10,\n  \"interval\": 1,\n  \"startDate\": \"2023-06-01\",\n  \"description\": \"test monthly fees\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("tenant", "{{tenant}}")
	req.Header.Add("schoolCode", "{{schoolCode}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Fees_UpdateFees_example
require 'uri'
require 'net/http'

url = URI("https://https/dreamclassapi/v1/financial/fees/update/31")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["tenant"] = '{{tenant}}'
request["schoolCode"] = '{{schoolCode}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cost\": 50,\n  \"duration\": 10,\n  \"interval\": 1,\n  \"startDate\": \"2023-06-01\",\n  \"description\": \"test monthly fees\"\n}"

response = http.request(request)
puts response.read_body
```

```java Fees_UpdateFees_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://https/dreamclassapi/v1/financial/fees/update/31")
  .header("tenant", "{{tenant}}")
  .header("schoolCode", "{{schoolCode}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"cost\": 50,\n  \"duration\": 10,\n  \"interval\": 1,\n  \"startDate\": \"2023-06-01\",\n  \"description\": \"test monthly fees\"\n}")
  .asString();
```

```php Fees_UpdateFees_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://https/dreamclassapi/v1/financial/fees/update/31', [
  'body' => '{
  "cost": 50,
  "duration": 10,
  "interval": 1,
  "startDate": "2023-06-01",
  "description": "test monthly fees"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'schoolCode' => '{{schoolCode}}',
    'tenant' => '{{tenant}}',
  ],
]);

echo $response->getBody();
```

```csharp Fees_UpdateFees_example
using RestSharp;

var client = new RestClient("https://https/dreamclassapi/v1/financial/fees/update/31");
var request = new RestRequest(Method.PATCH);
request.AddHeader("tenant", "{{tenant}}");
request.AddHeader("schoolCode", "{{schoolCode}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cost\": 50,\n  \"duration\": 10,\n  \"interval\": 1,\n  \"startDate\": \"2023-06-01\",\n  \"description\": \"test monthly fees\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Fees_UpdateFees_example
import Foundation

let headers = [
  "tenant": "{{tenant}}",
  "schoolCode": "{{schoolCode}}",
  "Content-Type": "application/json"
]
let parameters = [
  "cost": 50,
  "duration": 10,
  "interval": 1,
  "startDate": "2023-06-01",
  "description": "test monthly fees"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://https/dreamclassapi/v1/financial/fees/update/31")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```