getInvoicePDF method
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.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter invoiceId :
Your unique invoice ID.
Implementation
Future<GetInvoicePDFResponse> getInvoicePDF({
required String invoiceId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'Invoicing.GetInvoicePDF'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InvoiceId': invoiceId,
},
);
return GetInvoicePDFResponse.fromJson(jsonResponse.body);
}