Skip to content

batch_create_billing_adjustment_request

batch_create_billing_adjustment_request(
    billing_adjustment_request_entries: BatchCreateBillingAdjustmentRequestEntryList,
    *,
    config_overrides: Optional[MarketplaceAgreementClientConfig] = None,
) -> BatchCreateBillingAdjustmentRequestOutput

Allows sellers (proposers) to submit billing adjustment requests for one or more invoices within an agreement. Each entry in the batch specifies an invoice and the adjustment amount. The operation returns successfully created adjustment request IDs and any errors for entries that failed to process.

Each entry requires a unique clientToken for idempotency.

Parameters:

Raises:

Examples:

Create billing adjustment requests

>>> client.batch_create_billing_adjustment_request(billing_adjustment_request_entries=[{'originalInvoiceId': 'E2E20230929a108cfae', 'agreementId': 'agmt-SvIzsqYMyQwI3GWgJAe17URx', 'adjustmentAmount': '500.00', 'currencyCode': 'USD', 'clientToken': '71a5e82e-a49b-4075-8c7f-52df1d294379', 'adjustmentReasonCode': 'OTHER', 'description': 'Customer requested adjustment due to service outage during critical business period.'}])
Source code in docs_src/capo_marketplace_agreement/_services/marketplace_agreement.py
def batch_create_billing_adjustment_request(
    self,
    billing_adjustment_request_entries: "capo_marketplace_agreement.types.batch_create_billing_adjustment_request_entry_list.BatchCreateBillingAdjustmentRequestEntryList",
    *,
    config_overrides: Optional[MarketplaceAgreementClientConfig] = None,
) -> "capo_marketplace_agreement.types.batch_create_billing_adjustment_request_output.BatchCreateBillingAdjustmentRequestOutput":
    """<p>Allows sellers (proposers) to submit billing adjustment requests for one or more invoices within an agreement. Each entry in the batch specifies an invoice and the adjustment amount. The operation returns successfully created adjustment request IDs and any errors for entries that failed to process.</p> <note> <p>Each entry requires a unique <code>clientToken</code> for idempotency.</p> </note>

    Args:
        billing_adjustment_request_entries: <p>A list of billing adjustment request entries. Each entry specifies the invoice and adjustment details.</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.conflict_exception.ConflictException: <p>Request was denied due to a resource conflict.</p>
        capo_marketplace_agreement.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</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:
        Create billing adjustment requests

        >>> client.batch_create_billing_adjustment_request(billing_adjustment_request_entries=[{'originalInvoiceId': 'E2E20230929a108cfae', 'agreementId': 'agmt-SvIzsqYMyQwI3GWgJAe17URx', 'adjustmentAmount': '500.00', 'currencyCode': 'USD', 'clientToken': '71a5e82e-a49b-4075-8c7f-52df1d294379', 'adjustmentReasonCode': 'OTHER', 'description': 'Customer requested adjustment due to service outage during critical business period.'}])
    """

    def _handler(
        req: "OperationRequest[capo_marketplace_agreement.types.batch_create_billing_adjustment_request_input.BatchCreateBillingAdjustmentRequestInput]",
    ) -> OperationResponse[
        "capo_marketplace_agreement.types.batch_create_billing_adjustment_request_output.BatchCreateBillingAdjustmentRequestOutput"
    ]:
        import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.batch_create_billing_adjustment_request

        output, http_response = (
            capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.batch_create_billing_adjustment_request.batch_create_billing_adjustment_request(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_marketplace_agreement.types.batch_create_billing_adjustment_request_input.BatchCreateBillingAdjustmentRequestInput",
    ) -> dict[str, Any]:
        import capo_marketplace_agreement.types.batch_create_billing_adjustment_request_input

        return capo_marketplace_agreement.types.batch_create_billing_adjustment_request_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "BatchCreateBillingAdjustmentRequest", redact_input=_redact_input
        ),
    )
    input_: capo_marketplace_agreement.types.batch_create_billing_adjustment_request_input.BatchCreateBillingAdjustmentRequestInput = {
        "billing_adjustment_request_entries": billing_adjustment_request_entries
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output