Skip to content

Get the balance of a payment instrument

Description

Get the balance of a payment instrument.

Usage

bedrockagentcore_get_payment_instrument_balance(userId, agentName,
  paymentManagerArn, paymentConnectorId, paymentInstrumentId, chain,
  token)

Arguments

  • userId

    The user ID associated with this payment instrument.

  • agentName

    The agent name associated with this request, used for observability.

  • paymentManagerArn

    [required] The ARN of the payment manager that owns this payment instrument.

  • paymentConnectorId

    [required] The ID of the payment connector associated with this instrument.

  • paymentInstrumentId

    [required] The ID of the payment instrument to query balance for.

  • chain

    [required] The specific blockchain chain to query balance on. Required because balances are chain-specific.

  • token

    [required] The token to query balance for. Only tokens supported for X402 payments are returned.

Value

A list with the following syntax:

list(
  paymentInstrumentId = "string",
  tokenBalance = list(
    amount = "string",
    decimals = 123,
    token = "USDC",
    network = "ETHEREUM"|"SOLANA",
    chain = "BASE"|"BASE_SEPOLIA"|"ETHEREUM"|"SOLANA"|"SOLANA_DEVNET"
  )
)

Request syntax

svc$get_payment_instrument_balance(
  userId = "string",
  agentName = "string",
  paymentManagerArn = "string",
  paymentConnectorId = "string",
  paymentInstrumentId = "string",
  chain = "BASE"|"BASE_SEPOLIA"|"ETHEREUM"|"SOLANA"|"SOLANA_DEVNET",
  token = "USDC"
)