package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts"
payload := strings.NewReader("{\n \"alias\": \"@treasury_checking\",\n \"assetCode\": \"USD\",\n \"blocked\": true,\n \"entityId\": \"EXT-ACC-12345\",\n \"holderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"name\": \"Corporate Checking Account\",\n \"parentAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"portfolioId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"segmentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"status\": {\n \"code\": \"ACTIVE\",\n \"description\": \"Active status\"\n },\n \"type\": \"deposit\",\n \"skip\": {\n \"holder\": false\n }\n}")
req, _ := http.NewRequest("POST", 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))
}