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

# Payment

POST https://#post10
Content-Type: application/json

Webhook related to payments, trigged upon

- Payment created: PAYMENT_CREATED
    
- Payment updated: PAYMENT_UPDATED
    
- Payment deleted: PAYMENT_DELETED
    

Using the provided invoiceId, use the GetInvoice API to retrieve more data. Using the provided paymentmethod.id use the GetPaymentMethods to retrieve more data

status:  
VALID: 1  
INVALID: 2  
PENDING: 3  
REFUNDED: 4

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /#post10:
    post:
      operationId: payment
      summary: Payment
      description: >-
        Webhook related to payments, trigged upon


        - Payment created: PAYMENT_CREATED
            
        - Payment updated: PAYMENT_UPDATED
            
        - Payment deleted: PAYMENT_DELETED
            

        Using the provided invoiceId, use the GetInvoice API to retrieve more
        data. Using the provided paymentmethod.id use the GetPaymentMethods to
        retrieve more data


        status:  

        VALID: 1  

        INVALID: 2  

        PENDING: 3  

        REFUNDED: 4
      tags:
        - subpackage_webhooks
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhooks_Payment_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                data:
                  $ref: >-
                    #/components/schemas/Post10PostRequestBodyContentApplicationJsonSchemaData
                type:
                  type: string
                tenant:
                  type: string
                signature:
                  type: string
                timestamp:
                  type: integer
              required:
                - id
                - data
                - type
                - tenant
                - signature
                - timestamp
servers:
  - url: https:/
    description: https://{server}
  - url: https://your-webhook-url
    description: https://your-webhook-url
components:
  schemas:
    Post10PostRequestBodyContentApplicationJsonSchemaDataPaymentmethod:
      type: object
      properties:
        id:
          type: integer
        translation:
          description: Any type
        institutionId:
          description: Any type
        logOnlyPaymentMethod:
          type: boolean
      required:
        - id
        - logOnlyPaymentMethod
      title: Post10PostRequestBodyContentApplicationJsonSchemaDataPaymentmethod
    Post10PostRequestBodyContentApplicationJsonSchemaData:
      type: object
      properties:
        id:
          type: integer
        amount:
          type: integer
        createdAt:
          type: string
          format: date-time
        invoiceId:
          type: integer
        publicNotes:
          type: string
        privateNotes:
          type: string
        paymentmethod:
          $ref: >-
            #/components/schemas/Post10PostRequestBodyContentApplicationJsonSchemaDataPaymentmethod
      required:
        - id
        - amount
        - createdAt
        - invoiceId
        - publicNotes
        - privateNotes
        - paymentmethod
      title: Post10PostRequestBodyContentApplicationJsonSchemaData
    Webhooks_Payment_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Webhooks_Payment_Response_200

```

## Examples



**Request**

```json
{
  "id": "214fb720-2248-44e0-9bfd-72171f9e72de",
  "data": {
    "id": 5,
    "amount": 300,
    "createdAt": "2024-10-02T16:08:33.387+00:00",
    "invoiceId": 16,
    "publicNotes": "Sample note",
    "privateNotes": "Sample note",
    "paymentmethod": {
      "id": 1,
      "logOnlyPaymentMethod": true
    }
  },
  "type": "PAYMENT_CREATED",
  "tenant": "my-school",
  "signature": "b2fl8PdPRVsq0vre6DpdHJwHse8Ln+WlY0Vx32aKxtE=",
  "timestamp": 1727885313393
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://https/#post10"

payload = {
    "id": "214fb720-2248-44e0-9bfd-72171f9e72de",
    "data": {
        "id": 5,
        "amount": 300,
        "createdAt": "2024-10-02T16:08:33.387+00:00",
        "invoiceId": 16,
        "publicNotes": "Sample note",
        "privateNotes": "Sample note",
        "paymentmethod": {
            "id": 1,
            "logOnlyPaymentMethod": True
        }
    },
    "type": "PAYMENT_CREATED",
    "tenant": "my-school",
    "signature": "b2fl8PdPRVsq0vre6DpdHJwHse8Ln+WlY0Vx32aKxtE=",
    "timestamp": 1727885313393
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://https/#post10';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"id":"214fb720-2248-44e0-9bfd-72171f9e72de","data":{"id":5,"amount":300,"createdAt":"2024-10-02T16:08:33.387+00:00","invoiceId":16,"publicNotes":"Sample note","privateNotes":"Sample note","paymentmethod":{"id":1,"logOnlyPaymentMethod":true}},"type":"PAYMENT_CREATED","tenant":"my-school","signature":"b2fl8PdPRVsq0vre6DpdHJwHse8Ln+WlY0Vx32aKxtE=","timestamp":1727885313393}'
};

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

```go
package main

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

func main() {

	url := "https://https/#post10"

	payload := strings.NewReader("{\n  \"id\": \"214fb720-2248-44e0-9bfd-72171f9e72de\",\n  \"data\": {\n    \"id\": 5,\n    \"amount\": 300,\n    \"createdAt\": \"2024-10-02T16:08:33.387+00:00\",\n    \"invoiceId\": 16,\n    \"publicNotes\": \"Sample note\",\n    \"privateNotes\": \"Sample note\",\n    \"paymentmethod\": {\n      \"id\": 1,\n      \"logOnlyPaymentMethod\": true\n    }\n  },\n  \"type\": \"PAYMENT_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"b2fl8PdPRVsq0vre6DpdHJwHse8Ln+WlY0Vx32aKxtE=\",\n  \"timestamp\": 1727885313393\n}")

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

	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
require 'uri'
require 'net/http'

url = URI("https://https/#post10")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"id\": \"214fb720-2248-44e0-9bfd-72171f9e72de\",\n  \"data\": {\n    \"id\": 5,\n    \"amount\": 300,\n    \"createdAt\": \"2024-10-02T16:08:33.387+00:00\",\n    \"invoiceId\": 16,\n    \"publicNotes\": \"Sample note\",\n    \"privateNotes\": \"Sample note\",\n    \"paymentmethod\": {\n      \"id\": 1,\n      \"logOnlyPaymentMethod\": true\n    }\n  },\n  \"type\": \"PAYMENT_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"b2fl8PdPRVsq0vre6DpdHJwHse8Ln+WlY0Vx32aKxtE=\",\n  \"timestamp\": 1727885313393\n}"

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

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

HttpResponse<String> response = Unirest.post("https://https/#post10")
  .header("Content-Type", "application/json")
  .body("{\n  \"id\": \"214fb720-2248-44e0-9bfd-72171f9e72de\",\n  \"data\": {\n    \"id\": 5,\n    \"amount\": 300,\n    \"createdAt\": \"2024-10-02T16:08:33.387+00:00\",\n    \"invoiceId\": 16,\n    \"publicNotes\": \"Sample note\",\n    \"privateNotes\": \"Sample note\",\n    \"paymentmethod\": {\n      \"id\": 1,\n      \"logOnlyPaymentMethod\": true\n    }\n  },\n  \"type\": \"PAYMENT_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"b2fl8PdPRVsq0vre6DpdHJwHse8Ln+WlY0Vx32aKxtE=\",\n  \"timestamp\": 1727885313393\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/#post10', [
  'body' => '{
  "id": "214fb720-2248-44e0-9bfd-72171f9e72de",
  "data": {
    "id": 5,
    "amount": 300,
    "createdAt": "2024-10-02T16:08:33.387+00:00",
    "invoiceId": 16,
    "publicNotes": "Sample note",
    "privateNotes": "Sample note",
    "paymentmethod": {
      "id": 1,
      "logOnlyPaymentMethod": true
    }
  },
  "type": "PAYMENT_CREATED",
  "tenant": "my-school",
  "signature": "b2fl8PdPRVsq0vre6DpdHJwHse8Ln+WlY0Vx32aKxtE=",
  "timestamp": 1727885313393
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://https/#post10");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"id\": \"214fb720-2248-44e0-9bfd-72171f9e72de\",\n  \"data\": {\n    \"id\": 5,\n    \"amount\": 300,\n    \"createdAt\": \"2024-10-02T16:08:33.387+00:00\",\n    \"invoiceId\": 16,\n    \"publicNotes\": \"Sample note\",\n    \"privateNotes\": \"Sample note\",\n    \"paymentmethod\": {\n      \"id\": 1,\n      \"logOnlyPaymentMethod\": true\n    }\n  },\n  \"type\": \"PAYMENT_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"b2fl8PdPRVsq0vre6DpdHJwHse8Ln+WlY0Vx32aKxtE=\",\n  \"timestamp\": 1727885313393\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "id": "214fb720-2248-44e0-9bfd-72171f9e72de",
  "data": [
    "id": 5,
    "amount": 300,
    "createdAt": "2024-10-02T16:08:33.387+00:00",
    "invoiceId": 16,
    "publicNotes": "Sample note",
    "privateNotes": "Sample note",
    "paymentmethod": [
      "id": 1,
      "logOnlyPaymentMethod": true
    ]
  ],
  "type": "PAYMENT_CREATED",
  "tenant": "my-school",
  "signature": "b2fl8PdPRVsq0vre6DpdHJwHse8Ln+WlY0Vx32aKxtE=",
  "timestamp": 1727885313393
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://https/#post10")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```