Skip to content

get_invoice_pdf async

get_invoice_pdf(
    invoice_id: StringWithoutNewLine,
    *,
    config_overrides: Optional[AsyncInvoicingClientConfig] = None,
) -> GetInvoicePDFResponse

Returns a URL to download the invoice document and supplemental documents associated with an invoice. The URLs are pre-signed and have expiration time. For special cases like Brazil, where Amazon Web Services generated invoice identifiers and government provided identifiers do not match, use the Amazon Web Services generated invoice identifier when making API requests. To grant IAM permission to use this operation, the caller needs the invoicing:GetInvoicePDF policy action.

Parameters:

Raises:

Examples:

GetInvoicePDF without supplemental documents

>>> await client.get_invoice_pdf(invoice_id='abc123')
GetInvoicePDF with supplemental documents
>>> await client.get_invoice_pdf(invoice_id='abc123')
Source code in docs_src/capo_invoicing/_services/async_invoicing.py
async def get_invoice_pdf(
    self,
    invoice_id: "capo_invoicing.types.string_without_new_line.StringWithoutNewLine",
    *,
    config_overrides: Optional[AsyncInvoicingClientConfig] = None,
) -> "capo_invoicing.types.get_invoice_pdf_response.GetInvoicePDFResponse":
    """<p>Returns a URL to download the invoice document and supplemental documents associated with an invoice. The URLs are pre-signed and have expiration time. For special cases like Brazil, where Amazon Web Services generated invoice identifiers and government provided identifiers do not match, use the Amazon Web Services generated invoice identifier when making API requests. To grant IAM permission to use this operation, the caller needs the <code>invoicing:GetInvoicePDF</code> policy action.</p>

    Args:
        invoice_id: <p> Your unique invoice ID. </p>

    Raises:
        capo_invoicing.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</p>
        capo_invoicing.errors.internal_server_exception.InternalServerException: <p>The processing request failed because of an unknown error, exception, or failure. </p>
        capo_invoicing.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found. </p>
        capo_invoicing.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_invoicing.errors.validation_exception.ValidationException: <p> The input fails to satisfy the constraints specified by an Amazon Web Services service. </p>
        capo_invoicing.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        GetInvoicePDF without supplemental documents

        >>> await client.get_invoice_pdf(invoice_id='abc123')
        GetInvoicePDF with supplemental documents

        >>> await client.get_invoice_pdf(invoice_id='abc123')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_invoicing.types.get_invoice_pdf_request.GetInvoicePDFRequest]",
    ) -> AsyncOperationResponse[
        "capo_invoicing.types.get_invoice_pdf_response.GetInvoicePDFResponse"
    ]:
        import capo_invoicing._operations.invoicing.get_invoice_pdf

        (
            output,
            http_response,
        ) = await capo_invoicing._operations.invoicing.get_invoice_pdf.async_get_invoice_pdf(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetInvoicePDF")
    )
    input_: capo_invoicing.types.get_invoice_pdf_request.GetInvoicePDFRequest = {
        "invoice_id": invoice_id
    }

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