BedrockAgentCore / Client / delete_payment_instrument

delete_payment_instrument

BedrockAgentCore.Client.delete_payment_instrument(**kwargs)

Delete a payment instrument

Marks a payment instrument as deleted by updating its status to DELETED. This is a soft delete operation that preserves the record in the database for audit and compliance purposes. The record remains queryable for audit purposes but is excluded from normal list and get operations.

Deleting an already-deleted or non-existent instrument returns ResourceNotFoundException (404).

Authorization: The caller must own the instrument (accountId, userId, and paymentManagerId must match). If authorization fails, a 403 Forbidden error is returned.

Timestamp Management: The updatedAt timestamp is set to the current time, while createdAt is preserved. The version field is incremented for optimistic locking.

Errors:

  • ResourceNotFoundException: The instrument does not exist or is already deleted

  • AccessDeniedException: The caller is not authorized to delete this instrument

  • ValidationException: Required fields are missing or invalid

  • InternalServerException: An unexpected server error occurred

See also: AWS API Documentation

Request Syntax

response = client.delete_payment_instrument(
    userId='string',
    paymentManagerArn='string',
    paymentConnectorId='string',
    paymentInstrumentId='string'
)
Parameters:
  • userId (string) – The user ID making the delete request. Must match the instrument’s userId.

  • paymentManagerArn (string) –

    [REQUIRED]

    The payment manager ARN. Must match the instrument’s paymentManagerArn.

  • paymentConnectorId (string) –

    [REQUIRED]

    The payment connector ID. Must match the instrument’s paymentConnectorId.

  • paymentInstrumentId (string) –

    [REQUIRED]

    The payment instrument ID to delete.

Return type:

dict

Returns:

Response Syntax

{
    'status': 'INITIATED'|'ACTIVE'|'FAILED'|'DELETED'
}

Response Structure

  • (dict) –

    Response structure for deleting a payment instrument

    Returns the deletion status with HTTP 200 OK status code on successful soft deletion.

    • status (string) –

      The status of the instrument after deletion. Always DELETED for successful soft delete.

Exceptions

  • BedrockAgentCore.Client.exceptions.AccessDeniedException

  • BedrockAgentCore.Client.exceptions.ValidationException

  • BedrockAgentCore.Client.exceptions.ResourceNotFoundException

  • BedrockAgentCore.Client.exceptions.ThrottlingException

  • BedrockAgentCore.Client.exceptions.InternalServerException