Skip to content

/AWS1/IF_BII=>GETINVOICEPDF()

About GetInvoicePDF

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.

Method Signature

METHODS /AWS1/IF_BII~GETINVOICEPDF
  IMPORTING
    !IV_INVOICEID TYPE /AWS1/BIISTRINGWITHOUTNEWLINE OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_biigetinvoicepdfrsp
  RAISING
    /AWS1/CX_BIIACCESSDENIEDEX
    /AWS1/CX_BIIINTERNALSERVEREX
    /AWS1/CX_BIIRESOURCENOTFOUNDEX
    /AWS1/CX_BIITHROTTLINGEX
    /AWS1/CX_BIIVALIDATIONEX
    /AWS1/CX_BIICLIENTEXC
    /AWS1/CX_BIISERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_invoiceid TYPE /AWS1/BIISTRINGWITHOUTNEWLINE /AWS1/BIISTRINGWITHOUTNEWLINE

Your unique invoice ID.

RETURNING

oo_output TYPE REF TO /aws1/cl_biigetinvoicepdfrsp /AWS1/CL_BIIGETINVOICEPDFRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->getinvoicepdf( |string| ).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_invoicepdf = lo_result->get_invoicepdf( ).
  IF lo_invoicepdf IS NOT INITIAL.
    lv_stringwithoutnewline = lo_invoicepdf->get_invoiceid( ).
    lv_stringwithoutnewline = lo_invoicepdf->get_documenturl( ).
    lv_timestamp = lo_invoicepdf->get_documenturlexpirdate( ).
    LOOP AT lo_invoicepdf->get_supplementaldocuments( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_stringwithoutnewline = lo_row_1->get_documenturl( ).
        lv_timestamp = lo_row_1->get_documenturlexpirdate( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDIF.

GetInvoicePDF without supplemental documents

GetInvoicePDF without supplemental documents

DATA(lo_result) = lo_client->getinvoicepdf( |abc123| ).

GetInvoicePDF with supplemental documents

GetInvoicePDF with supplemental documents

DATA(lo_result) = lo_client->getinvoicepdf( |abc123| ).