package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/webhooks/{id}"
payload := strings.NewReader("{\n \"active\": true,\n \"description\": \"Primary settlement consumer\",\n \"events\": [\n \"operation.settled\",\n \"operation.rejected\"\n ],\n \"headers\": {},\n \"secret\": \"<string>\",\n \"timeoutSeconds\": 10,\n \"url\": \"https://client.example.com/webhooks/slc\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}