Skip to content

batch_get_financial_record async

batch_get_financial_record(
    keys: FinancialRecordKeyList,
    *,
    config_overrides: Optional[AsyncPaymentsClientConfig] = None,
) -> BatchGetFinancialRecordResponse

Retrieves up to 100 financial records in one request, including the details that are specific to each record's type. Identify each record by its ID or by its invoice ID. Results can be partial: each key that you request appears once in the response, either as a record in financialRecords or as an error in errors. A key that matches no record on your account is returned in errors and doesn't fail the request. This operation provides strongly consistent reads.

To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for both payments:BatchGetFinancialRecord and payments:GetPaymentStatus.

Parameters:

  • keys (FinancialRecordKeyList) –

    The keys of the financial records to retrieve. Each key is either the record's ID or its invoice ID.

Raises:

  • AccessDeniedException –

    The request is denied because you don't have sufficient access to perform this operation. Verify that you have the required permissions and try again. This error is also returned, instead of ResourceNotFoundException, when you aren't authorized for the resource, so the response doesn't reveal whether the resource exists.

  • InternalServerException –

    The request processing failed because of an unknown error, exception, or failure. Retry your request.

  • ThrottlingException –

    The request was denied due to request throttling. Reduce the frequency of your requests and try again.

  • ValidationException –

    The request isn't valid. Check reason and fieldList for the cause, correct the request, and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Invoke BatchGetFinancialRecord

>>> await client.batch_get_financial_record(keys=[{'identifier': 'INV-1234-5678-9012-3456'}, {'invoiceIdentifier': '999999999999'}])
Source code in docs_src/capo_payments/_services/async_payments.py
async def batch_get_financial_record(
    self,
    keys: "capo_payments.types.financial_record_key_list.FinancialRecordKeyList",
    *,
    config_overrides: Optional[AsyncPaymentsClientConfig] = None,
) -> "capo_payments.types.batch_get_financial_record_response.BatchGetFinancialRecordResponse":
    """<p>Retrieves up to 100 financial records in one request, including the details that are specific to each record's type. Identify each record by its ID or by its invoice ID. Results can be partial: each key that you request appears once in the response, either as a record in <code>financialRecords</code> or as an error in <code>errors</code>. A key that matches no record on your account is returned in <code>errors</code> and doesn't fail the request. This operation provides strongly consistent reads.</p> <p>To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for both <code>payments:BatchGetFinancialRecord</code> and <code>payments:GetPaymentStatus</code>.</p>

    Args:
        keys: <p>The keys of the financial records to retrieve. Each key is either the record's ID or its invoice ID.</p>

    Raises:
        capo_payments.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because you don't have sufficient access to perform this operation. Verify that you have the required permissions and try again. This error is also returned, instead of <code>ResourceNotFoundException</code>, when you aren't authorized for the resource, so the response doesn't reveal whether the resource exists.</p>
        capo_payments.errors.internal_server_exception.InternalServerException: <p>The request processing failed because of an unknown error, exception, or failure. Retry your request.</p>
        capo_payments.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Reduce the frequency of your requests and try again.</p>
        capo_payments.errors.validation_exception.ValidationException: <p>The request isn't valid. Check <code>reason</code> and <code>fieldList</code> for the cause, correct the request, and try again.</p>
        capo_payments.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Invoke BatchGetFinancialRecord

        >>> await client.batch_get_financial_record(keys=[{'identifier': 'INV-1234-5678-9012-3456'}, {'invoiceIdentifier': '999999999999'}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_payments.types.batch_get_financial_record_request.BatchGetFinancialRecordRequest]",
    ) -> AsyncOperationResponse[
        "capo_payments.types.batch_get_financial_record_response.BatchGetFinancialRecordResponse"
    ]:
        import capo_payments._operations.aws_payments.batch_get_financial_record

        (
            output,
            http_response,
        ) = await capo_payments._operations.aws_payments.batch_get_financial_record.async_batch_get_financial_record(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchGetFinancialRecord")
    )
    input_: capo_payments.types.batch_get_financial_record_request.BatchGetFinancialRecordRequest = {
        "keys": keys
    }

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