get_payment_instrument_balance
¶
get_payment_instrument_balance(
payment_manager_arn: PaymentManagerArn,
payment_connector_id: PaymentConnectorId,
payment_instrument_id: PaymentInstrumentId,
chain: BlockchainChainId,
token: InstrumentBalanceToken,
*,
config_overrides: Optional[BedrockAgentCoreClientConfig] = None,
user_id: Optional[UserId] = None,
agent_name: Optional[PaymentAgentName] = None,
) -> GetPaymentInstrumentBalanceResponse
Get the balance of a payment instrument.
Parameters:
-
user_id(Optional[UserId], default:None) –The user ID associated with this payment instrument.
-
agent_name(Optional[PaymentAgentName], default:None) –The agent name associated with this request, used for observability.
-
payment_manager_arn(PaymentManagerArn) –The ARN of the payment manager that owns this payment instrument.
-
payment_connector_id(PaymentConnectorId) –The ID of the payment connector associated with this instrument.
-
payment_instrument_id(PaymentInstrumentId) –The ID of the payment instrument to query balance for.
-
chain(BlockchainChainId) –The specific blockchain chain to query balance on. Required because balances are chain-specific.
-
token(InstrumentBalanceToken) –The token to query balance for. Only tokens supported for X402 payments are returned.
Raises:
-
AccessDeniedException–The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.
-
InternalServerException–The exception that occurs when the service encounters an unexpected internal error. This is a temporary condition that will resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.
-
ResourceNotFoundException–The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.
-
ThrottlingException–The exception that occurs when the request was denied due to request throttling. This happens when you exceed the allowed request rate for an operation. Reduce the frequency of requests or implement exponential backoff retry logic in your application.
-
ValidationException–The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agentcore/_services/bedrock_agent_core.py
5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 | |