Skip to content

get_financial_record

get_financial_record(
    *,
    config_overrides: Optional[PaymentsClientConfig] = None,
    identifier: Optional[FinancialRecordIdentifier] = None,
    invoice_identifier: Optional[InvoiceId] = None,
) -> GetFinancialRecordResponse

Retrieves a single financial record, including the details that are specific to its type. Specify exactly one of the following:

  • The ID that Amazon Web Services Payments issued for the record, in identifier.

  • The invoice ID that Amazon Web Services Invoicing issued for an invoice or a credit memo, in invoiceIdentifier.

If you specify both or neither, the request fails with ValidationException. If no record on your account matches, the request fails with ResourceNotFoundException.

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:GetFinancialRecord and payments:GetPaymentStatus.

Parameters:

  • identifier (Optional[FinancialRecordIdentifier], default: None ) –

    The ID that Amazon Web Services Payments issued for the financial record, as returned in id.

  • invoice_identifier (Optional[InvoiceId], default: None ) –

    The invoice ID that Amazon Web Services Invoicing issued for an invoice or a credit memo. The operation returns the record that has this 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.

  • ResourceNotFoundException –

    The requested resource couldn't be found. Verify that the resource ID is correct. This error is returned only when you're authorized for the resource.

  • 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 GetFinancialRecord

>>> client.get_financial_record(identifier='INV-1234-5678-9012-3456')
Source code in docs_src/capo_payments/_services/payments.py
def get_financial_record(
    self,
    *,
    config_overrides: Optional[PaymentsClientConfig] = None,
    identifier: Optional[
        "capo_payments.types.financial_record_identifier.FinancialRecordIdentifier"
    ] = None,
    invoice_identifier: Optional["capo_payments.types.invoice_id.InvoiceId"] = None,
) -> "capo_payments.types.get_financial_record_response.GetFinancialRecordResponse":
    """<p>Retrieves a single financial record, including the details that are specific to its type. Specify exactly one of the following:</p> <ul> <li> <p>The ID that Amazon Web Services Payments issued for the record, in <code>identifier</code>.</p> </li> <li> <p>The invoice ID that Amazon Web Services Invoicing issued for an invoice or a credit memo, in <code>invoiceIdentifier</code>.</p> </li> </ul> <p>If you specify both or neither, the request fails with <code>ValidationException</code>. If no record on your account matches, the request fails with <code>ResourceNotFoundException</code>.</p> <p>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:GetFinancialRecord</code> and <code>payments:GetPaymentStatus</code>.</p>

    Args:
        identifier: <p>The ID that Amazon Web Services Payments issued for the financial record, as returned in <code>id</code>.</p>
        invoice_identifier: <p>The invoice ID that Amazon Web Services Invoicing issued for an invoice or a credit memo. The operation returns the record that has this 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.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource couldn't be found. Verify that the resource ID is correct. This error is returned only when you're authorized for the resource.</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 GetFinancialRecord

        >>> client.get_financial_record(identifier='INV-1234-5678-9012-3456')
    """

    def _handler(
        req: "OperationRequest[capo_payments.types.get_financial_record_request.GetFinancialRecordRequest]",
    ) -> OperationResponse[
        "capo_payments.types.get_financial_record_response.GetFinancialRecordResponse"
    ]:
        import capo_payments._operations.aws_payments.get_financial_record

        output, http_response = (
            capo_payments._operations.aws_payments.get_financial_record.get_financial_record(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetFinancialRecord")
    )
    input_: capo_payments.types.get_financial_record_request.GetFinancialRecordRequest = {}
    if identifier is not None:
        input_["identifier"] = identifier
    if invoice_identifier is not None:
        input_["invoice_identifier"] = invoice_identifier

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