Skip to content

send_agreement_payment_request

send_agreement_payment_request(
    agreement_id: AgreementId,
    term_id: TermId,
    name: PaymentRequestName,
    charge_amount: PositiveAmountUpto8Decimals,
    *,
    config_overrides: Optional[MarketplaceAgreementClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    description: Optional[PaymentRequestDescription] = None,
) -> SendAgreementPaymentRequestOutput

Allows sellers (proposers) to submit a payment request to buyers (acceptors) for a specific charge amount for an agreement that includes a VariablePaymentTerm. The payment request is created in PENDING_APPROVAL status, at which point the buyer can accept or reject it.

The agreement must be active and have a VariablePaymentTerm to support payment requests. The chargeAmount must not exceed the remaining available balance under the VariablePaymentTerm maxTotalChargeAmount.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

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

  • agreement_id (AgreementId) –

    The unique identifier of the agreement for which the payment request is being submitted. Use GetAgreementTerms to retrieve agreement term details.

  • term_id (TermId) –

    The unique identifier of the VariablePaymentTerm for the agreement that the payment request is being sent for.

  • name (PaymentRequestName) –

    A descriptive name for the payment request (5-64 characters).

  • charge_amount (PositiveAmountUpto8Decimals) –

    The amount requested to be charged to the buyer, positive decimal value in the currency of the accepted term.

    A ValidationException is returned if the chargeAmount exceeds the available balance, if the agreement doesn't have an active VariablePaymentTerm, or if the termId is invalid.

  • description (Optional[PaymentRequestDescription], default: None ) –

    An optional detailed description of the payment request (1-2000 characters).

Raises:

Source code in docs_src/capo_marketplace_agreement/_services/marketplace_agreement.py
def send_agreement_payment_request(
    self,
    agreement_id: "capo_marketplace_agreement.types.agreement_id.AgreementId",
    term_id: "capo_marketplace_agreement.types.term_id.TermId",
    name: "capo_marketplace_agreement.types.payment_request_name.PaymentRequestName",
    charge_amount: "capo_marketplace_agreement.types.positive_amount_upto8_decimals.PositiveAmountUpto8Decimals",
    *,
    config_overrides: Optional[MarketplaceAgreementClientConfig] = None,
    client_token: Optional[
        "capo_marketplace_agreement.types.client_token.ClientToken"
    ] = None,
    description: Optional[
        "capo_marketplace_agreement.types.payment_request_description.PaymentRequestDescription"
    ] = None,
) -> "capo_marketplace_agreement.types.send_agreement_payment_request_output.SendAgreementPaymentRequestOutput":
    """<p>Allows sellers (proposers) to submit a payment request to buyers (acceptors) for a specific charge amount for an agreement that includes a <code>VariablePaymentTerm</code>. The payment request is created in <code>PENDING_APPROVAL</code> status, at which point the buyer can accept or reject it.</p> <note> <p>The agreement must be active and have a <code>VariablePaymentTerm</code> to support payment requests. The <code>chargeAmount</code> must not exceed the remaining available balance under the <code>VariablePaymentTerm</code> <code>maxTotalChargeAmount</code>.</p> </note>

    Args:
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
        agreement_id: <p>The unique identifier of the agreement for which the payment request is being submitted. Use <code>GetAgreementTerms</code> to retrieve agreement term details.</p>
        term_id: <p>The unique identifier of the <code>VariablePaymentTerm</code> for the agreement that the payment request is being sent for.</p>
        name: <p>A descriptive name for the payment request (5-64 characters).</p>
        charge_amount: <p>The amount requested to be charged to the buyer, positive decimal value in the currency of the accepted term.</p> <note> <p>A <code>ValidationException</code> is returned if the <code>chargeAmount</code> exceeds the available balance, if the agreement doesn't have an active <code>VariablePaymentTerm</code>, or if the <code>termId</code> is invalid.</p> </note>
        description: <p>An optional detailed description of the payment request (1-2000 characters).</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_marketplace_agreement.types.send_agreement_payment_request_input.SendAgreementPaymentRequestInput]",
    ) -> OperationResponse[
        "capo_marketplace_agreement.types.send_agreement_payment_request_output.SendAgreementPaymentRequestOutput"
    ]:
        import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.send_agreement_payment_request

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

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

        return capo_marketplace_agreement.types.send_agreement_payment_request_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_marketplace_agreement.types.send_agreement_payment_request_output.SendAgreementPaymentRequestOutput",
    ) -> dict[str, Any]:
        import capo_marketplace_agreement.types.send_agreement_payment_request_output

        return capo_marketplace_agreement.types.send_agreement_payment_request_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "SendAgreementPaymentRequest",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_marketplace_agreement.types.send_agreement_payment_request_input.SendAgreementPaymentRequestInput = {
        "agreement_id": agreement_id,
        "term_id": term_id,
        "name": name,
        "charge_amount": charge_amount,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description

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