BedrockAgentCore / Client / create_payment_session

create_payment_session

BedrockAgentCore.Client.create_payment_session(**kwargs)

Create a new payment session.

See also: AWS API Documentation

Request Syntax

response = client.create_payment_session(
    userId='string',
    agentName='string',
    paymentManagerArn='string',
    limits={
        'maxSpendAmount': {
            'value': 'string',
            'currency': 'USD'
        }
    },
    expiryTimeInMinutes=123,
    clientToken='string'
)
Parameters:
  • userId (string) – The user ID associated with this payment session.

  • agentName (string) – The agent name associated with this request, used for observability.

  • paymentManagerArn (string) –

    [REQUIRED]

    The ARN of the payment manager that owns this session.

  • limits (dict) –

    The spending limits for this payment session.

    • maxSpendAmount (dict) – [REQUIRED]

      The maximum amount that can be spent in the session.

      • value (string) – [REQUIRED]

        The numeric value of the amount.

      • currency (string) – [REQUIRED]

        The currency code for the amount.

  • expiryTimeInMinutes (integer) –

    [REQUIRED]

    The session expiry time in minutes. Must be between 15 and 480 minutes.

  • clientToken (string) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'paymentSession': {
        'paymentSessionId': 'string',
        'paymentManagerArn': 'string',
        'limits': {
            'maxSpendAmount': {
                'value': 'string',
                'currency': 'USD'
            }
        },
        'userId': 'string',
        'expiryTimeInMinutes': 123,
        'createdAt': datetime(2015, 1, 1),
        'availableLimits': {
            'availableSpendAmount': {
                'value': 'string',
                'currency': 'USD'
            },
            'updatedAt': datetime(2015, 1, 1)
        },
        'updatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) –

    Response structure for creating a payment session.

    • paymentSession (dict) –

      The created payment session.

      • paymentSessionId (string) –

        The unique identifier of the payment session.

      • paymentManagerArn (string) –

        The ARN of the payment manager that owns this session.

      • limits (dict) –

        The spending limits for the payment session.

        • maxSpendAmount (dict) –

          The maximum amount that can be spent in the session.

          • value (string) –

            The numeric value of the amount.

          • currency (string) –

            The currency code for the amount.

      • userId (string) –

        The user ID associated with this session.

      • expiryTimeInMinutes (integer) –

        The session expiry time in minutes.

      • createdAt (datetime) –

        The timestamp when the session was created.

      • availableLimits (dict) –

        The current available spending limits.

        • availableSpendAmount (dict) –

          The remaining available amount that can be spent.

          • value (string) –

            The numeric value of the amount.

          • currency (string) –

            The currency code for the amount.

        • updatedAt (datetime) –

          The timestamp when the available limits were last updated.

      • updatedAt (datetime) –

        The timestamp when the session was last updated.

Exceptions

  • BedrockAgentCore.Client.exceptions.ServiceQuotaExceededException

  • BedrockAgentCore.Client.exceptions.AccessDeniedException

  • BedrockAgentCore.Client.exceptions.ConflictException

  • BedrockAgentCore.Client.exceptions.ValidationException

  • BedrockAgentCore.Client.exceptions.ThrottlingException

  • BedrockAgentCore.Client.exceptions.InternalServerException