Skip to content

list_agreement_invoice_line_items async

list_agreement_invoice_line_items(
    agreement_id: ResourceId,
    group_by: LineItemGroupBy,
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
    invoice_id: Optional[ResourceId] = None,
    invoice_type: Optional[InvoiceType] = None,
    invoice_billing_period: Optional[InvoiceBillingPeriod] = None,
    before_issued_time: Optional[Timestamp] = None,
    after_issued_time: Optional[Timestamp] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListAgreementInvoiceLineItemsOutput

Allows sellers (proposers) to retrieve aggregated billing data from AWS Marketplace agreements using flexible grouping. Supports invoice-level aggregation with filtering by billing period, invoice type, and issued date.

The groupBy parameter is required and supports only INVOICE_ID as a value. The agreementId parameter is required.

Parameters:

  • agreement_id (ResourceId) –

    The unique identifier of the agreement.

  • group_by (LineItemGroupBy) –

    Specifies a grouping strategy for line items. Currently supports INVOICE_ID.

  • invoice_id (Optional[ResourceId], default: None ) –

    An optional filter to retrieve invoice information for a specific invoice.

  • invoice_type (Optional[InvoiceType], default: None ) –

    An optional filter for the type of invoice. Valid values are INVOICE and CREDIT_MEMO.

  • invoice_billing_period (Optional[InvoiceBillingPeriod], default: None ) –

    An optional filter for the billing period associated with the invoice.

  • before_issued_time (Optional[Timestamp], default: None ) –

    An optional filter for invoices issued before the specified timestamp.

  • after_issued_time (Optional[Timestamp], default: None ) –

    An optional filter for invoices issued after the specified timestamp.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return in the response.

  • next_token (Optional[NextToken], default: None ) –

    A token to specify where to start pagination.

Raises:

Examples:

List agreement invoice line items

>>> await client.list_agreement_invoice_line_items(agreement_id='agmt-EXAMPLESvIzsqYMyQwI3', group_by='INVOICE_ID')
Source code in docs_src/capo_marketplace_agreement/_services/async_marketplace_agreement.py
async def list_agreement_invoice_line_items(
    self,
    agreement_id: "capo_marketplace_agreement.types.resource_id.ResourceId",
    group_by: "capo_marketplace_agreement.types.line_item_group_by.LineItemGroupBy",
    *,
    config_overrides: Optional[AsyncMarketplaceAgreementClientConfig] = None,
    invoice_id: Optional[
        "capo_marketplace_agreement.types.resource_id.ResourceId"
    ] = None,
    invoice_type: Optional[
        "capo_marketplace_agreement.types.invoice_type.InvoiceType"
    ] = None,
    invoice_billing_period: Optional[
        "capo_marketplace_agreement.types.invoice_billing_period.InvoiceBillingPeriod"
    ] = None,
    before_issued_time: Optional[
        "capo_marketplace_agreement.types.timestamp.Timestamp"
    ] = None,
    after_issued_time: Optional[
        "capo_marketplace_agreement.types.timestamp.Timestamp"
    ] = None,
    max_results: Optional[
        "capo_marketplace_agreement.types.max_results.MaxResults"
    ] = None,
    next_token: Optional[
        "capo_marketplace_agreement.types.next_token.NextToken"
    ] = None,
) -> "capo_marketplace_agreement.types.list_agreement_invoice_line_items_output.ListAgreementInvoiceLineItemsOutput":
    """<p>Allows sellers (proposers) to retrieve aggregated billing data from AWS Marketplace agreements using flexible grouping. Supports invoice-level aggregation with filtering by billing period, invoice type, and issued date.</p> <note> <p>The <code>groupBy</code> parameter is required and supports only <code>INVOICE_ID</code> as a value. The <code>agreementId</code> parameter is required.</p> </note>

    Args:
        agreement_id: <p>The unique identifier of the agreement.</p>
        group_by: <p>Specifies a grouping strategy for line items. Currently supports <code>INVOICE_ID</code>.</p>
        invoice_id: <p>An optional filter to retrieve invoice information for a specific invoice.</p>
        invoice_type: <p>An optional filter for the type of invoice. Valid values are <code>INVOICE</code> and <code>CREDIT_MEMO</code>.</p>
        invoice_billing_period: <p>An optional filter for the billing period associated with the invoice.</p>
        before_issued_time: <p>An optional filter for invoices issued before the specified timestamp.</p>
        after_issued_time: <p>An optional filter for invoices issued after the specified timestamp.</p>
        max_results: <p>The maximum number of results to return in the response.</p>
        next_token: <p>A token to specify where to start pagination.</p>

    Raises:
        capo_marketplace_agreement.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_marketplace_agreement.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_marketplace_agreement.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_marketplace_agreement.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_marketplace_agreement.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_marketplace_agreement.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List agreement invoice line items

        >>> await client.list_agreement_invoice_line_items(agreement_id='agmt-EXAMPLESvIzsqYMyQwI3', group_by='INVOICE_ID')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_marketplace_agreement.types.list_agreement_invoice_line_items_input.ListAgreementInvoiceLineItemsInput]",
    ) -> AsyncOperationResponse[
        "capo_marketplace_agreement.types.list_agreement_invoice_line_items_output.ListAgreementInvoiceLineItemsOutput"
    ]:
        import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.list_agreement_invoice_line_items

        (
            output,
            http_response,
        ) = await capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.list_agreement_invoice_line_items.async_list_agreement_invoice_line_items(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAgreementInvoiceLineItems")
    )
    input_: capo_marketplace_agreement.types.list_agreement_invoice_line_items_input.ListAgreementInvoiceLineItemsInput = {
        "agreement_id": agreement_id,
        "group_by": group_by,
    }
    if invoice_id is not None:
        input_["invoice_id"] = invoice_id
    if invoice_type is not None:
        input_["invoice_type"] = invoice_type
    if invoice_billing_period is not None:
        input_["invoice_billing_period"] = invoice_billing_period
    if before_issued_time is not None:
        input_["before_issued_time"] = before_issued_time
    if after_issued_time is not None:
        input_["after_issued_time"] = after_issued_time
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output