get_payment_instrument_balance
async
¶
get_payment_instrument_balance(
payment_manager_arn: PaymentManagerArn,
payment_connector_id: PaymentConnectorId,
payment_instrument_id: PaymentInstrumentId,
chain: BlockchainChainId,
token: InstrumentBalanceToken,
*,
config_overrides: Optional[AsyncBedrockAgentCoreClientConfig] = 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/async_bedrock_agent_core.py
5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 | |