> 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.

# UpdatePayment

PATCH https://dreamclassapi/v1/financial/invoices/payment/%7BpaymentId%7D
Content-Type: application/json

Update editable fields of a payment

Input variables

- paymentId: number of the invoice
    
- json representation of editable fields of a Payment
    
    - publicNotes
        
    - privateNotes
        
    - date
        

For payment id check the GetInvoce endpoint

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /dreamclassapi/v1/financial/invoices/payment/%7BpaymentId%7D:
    patch:
      operationId: update-payment
      summary: UpdatePayment
      description: |-
        Update editable fields of a payment

        Input variables

        - paymentId: number of the invoice
            
        - json representation of editable fields of a Payment
            
            - publicNotes
                
            - privateNotes
                
            - date
                

        For payment id check the GetInvoce endpoint
      tags:
        - subpackage_invoices
      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/Invoices_UpdatePayment_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                date:
                  type: string
                  format: date
                publicNotes:
                  type: string
                privateNotes:
                  type: string
              required:
                - date
                - publicNotes
                - privateNotes
servers:
  - url: https:/
    description: https://{server}
  - url: https://your-webhook-url
    description: https://your-webhook-url
components:
  schemas:
    DreamclassapiV1FinancialInvoicesPayment7BpaymentId7DPatchResponsesContentApplicationJsonSchemaPaymentmethod:
      type: object
      properties:
        id:
          type: integer
        translation:
          type: string
        institutionId:
          type: integer
        logOnlyPaymentMethod:
          type: boolean
      required:
        - id
        - translation
        - institutionId
        - logOnlyPaymentMethod
      title: >-
        DreamclassapiV1FinancialInvoicesPayment7BpaymentId7DPatchResponsesContentApplicationJsonSchemaPaymentmethod
    Invoices_UpdatePayment_Response_200:
      type: object
      properties:
        id:
          type: integer
        date:
          type: string
          format: date
        amount:
          type: integer
        createdAt:
          type: string
          format: date-time
        invoiceId:
          type: integer
        publicNotes:
          type: string
        privateNotes:
          type: string
        paymentmethod:
          $ref: >-
            #/components/schemas/DreamclassapiV1FinancialInvoicesPayment7BpaymentId7DPatchResponsesContentApplicationJsonSchemaPaymentmethod
      required:
        - id
        - date
        - amount
        - createdAt
        - invoiceId
        - publicNotes
        - privateNotes
        - paymentmethod
      title: Invoices_UpdatePayment_Response_200

```

## Examples



**Request**

```json
{
  "date": "2021-01-01",
  "publicNotes": "3213213",
  "privateNotes": "test"
}
```

**Response**

```json
{
  "id": 63,
  "date": "2021-01-01",
  "amount": 1,
  "createdAt": "2025-09-18T11:58:12.448+00:00",
  "invoiceId": 24,
  "publicNotes": "test1",
  "privateNotes": "test2",
  "paymentmethod": {
    "id": 2,
    "translation": "PAYMENTMETHODS.BANK",
    "institutionId": 1,
    "logOnlyPaymentMethod": true
  }
}
```

**SDK Code**

```python Invoices_UpdatePayment_example
import requests

url = "https://https/dreamclassapi/v1/financial/invoices/payment/%7BpaymentId%7D"

payload = {
    "date": "2021-01-01",
    "publicNotes": "3213213",
    "privateNotes": "test"
}
headers = {
    "tenant": "{{tenant}}",
    "schoolCode": "{{schoolCode}}",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Invoices_UpdatePayment_example
const url = 'https://https/dreamclassapi/v1/financial/invoices/payment/%7BpaymentId%7D';
const options = {
  method: 'PATCH',
  headers: {
    tenant: '{{tenant}}',
    schoolCode: '{{schoolCode}}',
    'Content-Type': 'application/json'
  },
  body: '{"date":"2021-01-01","publicNotes":"3213213","privateNotes":"test"}'
};

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

```go Invoices_UpdatePayment_example
package main

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

func main() {

	url := "https://https/dreamclassapi/v1/financial/invoices/payment/%7BpaymentId%7D"

	payload := strings.NewReader("{\n  \"date\": \"2021-01-01\",\n  \"publicNotes\": \"3213213\",\n  \"privateNotes\": \"test\"\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 Invoices_UpdatePayment_example
require 'uri'
require 'net/http'

url = URI("https://https/dreamclassapi/v1/financial/invoices/payment/%7BpaymentId%7D")

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  \"date\": \"2021-01-01\",\n  \"publicNotes\": \"3213213\",\n  \"privateNotes\": \"test\"\n}"

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

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

HttpResponse<String> response = Unirest.patch("https://https/dreamclassapi/v1/financial/invoices/payment/%7BpaymentId%7D")
  .header("tenant", "{{tenant}}")
  .header("schoolCode", "{{schoolCode}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"date\": \"2021-01-01\",\n  \"publicNotes\": \"3213213\",\n  \"privateNotes\": \"test\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://https/dreamclassapi/v1/financial/invoices/payment/%7BpaymentId%7D', [
  'body' => '{
  "date": "2021-01-01",
  "publicNotes": "3213213",
  "privateNotes": "test"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'schoolCode' => '{{schoolCode}}',
    'tenant' => '{{tenant}}',
  ],
]);

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

```csharp Invoices_UpdatePayment_example
using RestSharp;

var client = new RestClient("https://https/dreamclassapi/v1/financial/invoices/payment/%7BpaymentId%7D");
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  \"date\": \"2021-01-01\",\n  \"publicNotes\": \"3213213\",\n  \"privateNotes\": \"test\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Invoices_UpdatePayment_example
import Foundation

let headers = [
  "tenant": "{{tenant}}",
  "schoolCode": "{{schoolCode}}",
  "Content-Type": "application/json"
]
let parameters = [
  "date": "2021-01-01",
  "publicNotes": "3213213",
  "privateNotes": "test"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://https/dreamclassapi/v1/financial/invoices/payment/%7BpaymentId%7D")! 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()
```