get_statement_for_invoice_m Sample Call and Response
This example retrieves the statement document associated with a specific invoice on an account, based on the get_statement_for_invoice_m method defined in plsql_m_r73.yml.
This example includes every required field and a representative set of optional fields that request a specific statement template and MIME-encoded output. It does not cover every optional field the method accepts.
Sample call
{
"rest_call": "get_statement_for_invoice_m",
"output_format": "json",
"client_no": 1275,
"auth_key": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"acct_no": 900412233,
"invoice_no": 700188451,
"do_encoding": "true",
"alt_stmt_template_no": 4021
}
The rest_call and output_format fields form the envelope that the REST layer adds to every call; they are not part of the method's own documented arguments. The acct_no field identifies the account and is one of two alternative fields for this purpose; this example uses the Aria-assigned acct_no rather than the client-defined client_acct_id. The do_encoding field is set to true, which instructs Aria to acquire the statement content after applying MIME encoding, rather than the default value of false. The alt_stmt_template_no field requests a specific statement template rather than the template already associated with the invoice; it is one of two alternative fields for that purpose, and this example uses the Aria-assigned template number rather than the client-defined alt_client_stmt_template_id. The method's own description notes that this template override is honored only when no statement content has already been generated and stored for the invoice.
Sample response
{
"error_code": 0,
"error_msg": "OK",
"out_statement": "PGh0bWw+PGJvZHk+PGgxPkFjY291bnQgU3RhdGVtZW50PC9oMT48cD5JbnZvaWNlIDcwMDE4ODQ1MTwvcD48L2JvZHk+PC9odG1sPg==",
"mime_type": "text/html"
}
An error_code of zero, together with an error_msg of "OK," indicates that Aria located the invoice and returned the statement successfully. Because this example sets do_encoding to true, the out_statement field contains a MIME-encoded (Base64) representation of the underlying statement markup rather than the raw markup itself; the value shown here is truncated for illustration and would be much longer in an actual response. This example does not cover the case where do_encoding is left at its default value of false, in which case out_statement would contain the unencoded statement content directly.