WAFV2 / Client / list_settlement_records
list_settlement_records¶
- WAFV2.Client.list_settlement_records(**kwargs)¶
Retrieves individual settlement transaction records for monetization. Each record represents a single payment transaction between a client and your protected resource. This operation is only available for
CLOUDFRONTscope. The maximum supported time window is 90 days. When noCurrencyModefilter is provided, results default toREAL. To retrieve test data, include aCurrencyModefilter with the valueTEST.See also: AWS API Documentation
Request Syntax
response = client.list_settlement_records( TimeWindow={ 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1) }, Scope='CLOUDFRONT'|'REGIONAL', Currency='USDC', Filters=[ { 'Name': 'string', 'Values': [ 'string', ] }, ], SortBy='TIMESTAMP'|'AMOUNT'|'NAME'|'STATUS', SortOrder='ASC'|'DESC', Limit=123, NextMarker='string' )
- Parameters:
TimeWindow (dict) –
[REQUIRED]
The time range for the query. Specify start and end timestamps.
StartTime (datetime) – [REQUIRED]
The beginning of the time range from which you want
GetSampledRequeststo return a sample of the requests that your Amazon Web Services resource received. You must specify the times in Coordinated Universal Time (UTC) format. UTC format includes the special designator,Z. For example,"2016-09-27T14:50Z". You can specify any time range in the previous three hours.EndTime (datetime) – [REQUIRED]
The end of the time range from which you want
GetSampledRequeststo return a sample of the requests that your Amazon Web Services resource received. You must specify the times in Coordinated Universal Time (UTC) format. UTC format includes the special designator,Z. For example,"2016-09-27T14:50Z". You can specify any time range in the previous three hours.
Scope (string) –
[REQUIRED]
Specifies whether this is for a Amazon CloudFront distribution (
CLOUDFRONT) or for a regional application (REGIONAL).Currency (string) –
[REQUIRED]
The currency for the amounts in the response.
Filters (list) –
Optional filters to narrow the results. You can filter by payer address, status, source name, network, or other settlement fields.
(dict) –
A filter for narrowing monetization statistics and settlement record results. Specify a filter name and one or more values to match.
Filter behavior:
Multiple values within one filter: OR (match any)
Multiple filters: AND (all must match)
No duplicate filter names allowed (rejected with error)
Duplicate values within a filter are silently deduplicated
If no
CurrencyModefilter is specified, defaults toREAL
Name (string) – [REQUIRED]
The filter name. Format: Key is a string, Value is a list of strings.
Enum-restricted (invalid values rejected):
CurrencyMode:REAL,TESTChainName:BASE,SOLANA,BASE_SEPOLIA,SOLANA_DEVNETSettlementStatus:SETTLED,PENDING,FAILED,SERVICE_ERROR,SKIPPED_ORIGIN_ERROR,DUPLICATEHttpSourceName:CF,ALB,APIGW,APPRUNNER,COGNITO,VERIFIED_ACCESS
ARN-validated:
WebACLArn: valid WAFv2 web ACL ARN
Free-text (any string up to 256 chars):
SourceName: The name of the bot. Populated from Bot Control verified bot labels.SourceCategory: The category classification of the bot. From Bot Control categorization.Intent: The declared intent of the bot request.Organization: The organization operating the bot.UriPathPrefix: The URI path of the request that was monetized.RequestId: The WAF request ID associated with the transaction. Matches the requestId in WAF logs. Pattern:^[a-zA-Z0-9:._\-=+/]+$TransactionId: The blockchain transaction identifier. Pattern:^[a-zA-Z0-9:._\-=+/]+$TerminatingRuleName: The name of the WAF rule that triggered the Monetize action.PayerAddress: The blockchain wallet address of the paying client. Pattern:^[a-zA-Z0-9:._\-=+/]+$HttpSourceId: The identifier of the Amazon Web Services resource associated with the web ACL (for example, CloudFront distribution ID).
Values (list) – [REQUIRED]
The values to filter on. Specify as a list of strings. Results match any of the specified values (OR logic). Duplicate values are silently deduplicated. Maximum: 20 values per filter.
(string) –
SortBy (string) – The field to sort settlement records by:
TIMESTAMP,AMOUNT,NAME, orSTATUS.SortOrder (string) – The sort order:
ASCfor ascending orDESCfor descending.Limit (integer) – The maximum number of settlement records to return. Minimum: 1. Maximum: 100.
NextMarker (string) – When you get a paginated response, this marker indicates that additional results are available.
- Return type:
dict
- Returns:
Response Syntax
{ 'Settlements': [ { 'Timestamp': datetime(2015, 1, 1), 'PayerAddress': 'string', 'WalletAddress': 'string', 'Status': 'SETTLED'|'PENDING'|'FAILED'|'SERVICE_ERROR'|'SKIPPED_ORIGIN_ERROR'|'DUPLICATE', 'Amount': 'string', 'Currency': 'USDC', 'Network': 'string', 'TransactionId': 'string', 'RequestId': 'string', 'SourceName': 'string', 'Organization': 'string', 'SourceCategory': 'string', 'Intent': 'string', 'Verified': True|False, 'ContentPath': 'string', 'WebAclArn': 'string', 'RequestTimestamp': datetime(2015, 1, 1) }, ], 'NextMarker': 'string' }
Response Structure
(dict) –
Settlements (list) –
The list of settlement records.
(dict) –
A single settlement transaction record for AI bot monetization. Contains details about the payment including timestamp, amount, status, and the parties involved.
Timestamp (datetime) –
The timestamp when the settlement was recorded.
PayerAddress (string) –
The blockchain wallet address of the paying AI agent.
WalletAddress (string) –
Your receiving wallet address.
Status (string) –
The status of the settlement. Possible values:
SETTLED- The payment was successfully settled on the blockchain and the transfer from the payer’s wallet to the publisher’s wallet is confirmed. TheTransactionIdfield contains the on-chain transaction hash. Content is served to the client.PENDING- The blockchain transaction has been submitted but not yet confirmed on-chain. This is a transient state that automatically resolves to eitherSETTLEDorFAILED. No action is required. While pending, content is not served and the API returns a 402 response. Clients can retry the request.FAILED- The payment settlement was attempted but failed. Possible causes include insufficient funds, an expired payment authorization, or a reverted blockchain transaction. ThefailureReasonfield contains a machine-readable error code. Content is not served.SERVICE_ERROR- Settlement could not be completed due to an internal service issue or an issue with the payment network. Content is not served. The client’s payment authorization remains valid and the request can be retried.SKIPPED_ORIGIN_ERROR- The origin returned a non-2xx response, so settlement was intentionally skipped. The client is not charged.DUPLICATE- A prior request with the same payment payload has already been settled. This status typically appears when a previous attempt timed out but the payment was ultimately processed. The client is not charged again.
Amount (string) –
The payment amount in the specified currency.
Currency (string) –
The currency of the payment amount.
Network (string) –
The blockchain network on which the settlement occurred.
TransactionId (string) –
The blockchain transaction identifier. You can use this to verify the transaction on a blockchain explorer.
RequestId (string) –
The WAF request ID associated with this settlement.
SourceName (string) –
The name of the AI bot that made the payment.
Organization (string) –
The organization associated with the AI bot.
SourceCategory (string) –
The category of the AI bot source.
Intent (string) –
The declared intent of the AI bot request.
Verified (boolean) –
Whether the AI bot’s identity was verified.
ContentPath (string) –
The content path that was accessed.
WebAclArn (string) –
The ARN of the web ACL that processed the request.
RequestTimestamp (datetime) –
The timestamp of the original web request.
NextMarker (string) –
When you get a paginated response, this marker indicates that additional results are available.
Exceptions
WAFV2.Client.exceptions.WAFInternalErrorExceptionWAFV2.Client.exceptions.WAFInvalidParameterExceptionWAFV2.Client.exceptions.WAFNonexistentItemExceptionWAFV2.Client.exceptions.WAFInvalidOperationException