Ledgers

Create ledger

Create a new ledger with the Go SDK.

POST/ledgers

Use client.Ledger.Create to create a new ledger for your system.

Call the method

ledger, _, _ := client.Ledger.Create(blnkgo.CreateLedgerRequest{
	Name: "Customer wallets",
	MetaData: blnkgo.MetaData{
		"environment": "production",
	},
})
FieldTypeDescription
NamestringDisplay name for the ledger.
MetaDataMetaDataOptional key-value metadata.

Response

{
  "ledger_id": "ldg_073f7ffe-9dfd-42ce-aa50-d1dca1788adc",
  "name": "Customer wallets",
  "created_at": "2024-02-20T05:28:03.558281542Z",
  "meta_data": {
    "environment": "production"
  }
}

Go response (*blnkgo.Ledger)

FieldTypeDescription
LedgerIDstringUnique ID for the ledger.
NamestringName you passed in the request.
CreatedAttime.TimeDate and time the ledger was created.
MetaDataMetaDataMetadata object, if you sent one.