Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Add Manual Balance Entry

Add a manual balance entry
client.V1.Contracts.AddManualBalanceEntry(ctx, body) error
post/v1/contracts/addManualBalanceLedgerEntry

Add a manual balance entry

Parameters
bodyIDfieldAmountfieldCustomerIDfieldReasonfieldSegmentIDfieldContractIDfieldTimestampfieldV1ContractAddManualBalanceEntryParams
Hide ParametersShow Parameters
IDfield
param.Field[string]

ID of the balance (commit or credit) to update.

formatuuid
Amountfield
param.Field[float64]

Amount to add to the segment. A negative number will draw down from the balance.

CustomerIDfield
param.Field[string]

ID of the customer whose balance is to be updated.

formatuuid
Reasonfield
param.Field[string]

Reason for the manual adjustment. This will be displayed in the ledger.

SegmentIDfield
param.Field[string]

ID of the segment to update.

formatuuid
ContractIDfield
optional
param.Field[string]

ID of the contract to update. Leave blank to update a customer level balance.

formatuuid
Timestampfield
optional
param.Field[Time]

RFC 3339 timestamp indicating when the manual adjustment takes place. If not provided, it will default to the start of the segment.

formatdate-time
package main

import (
  "context"

  "github.com/Metronome-Industries/metronome-go"
  "github.com/Metronome-Industries/metronome-go/option"
)

func main() {
  client := metronome.NewClient(
    option.WithBearerToken("My Bearer Token"),
  )
  err := client.V1.Contracts.AddManualBalanceEntry(context.TODO(), metronome.V1ContractAddManualBalanceEntryParams{
    ID: metronome.F("6162d87b-e5db-4a33-b7f2-76ce6ead4e85"),
    Amount: metronome.F(-1000.000000),
    CustomerID: metronome.F("13117714-3f05-48e5-a6e9-a66093f13b4d"),
    Reason: metronome.F("Reason for entry"),
    SegmentID: metronome.F("66368e29-3f97-4d15-a6e9-120897f0070a"),
    ContractID: metronome.F("d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc"),
  })
  if err != nil {
    panic(err.Error())
  }
}