unapply_cm_m Sample Call and Response
This example shows a client unapplying a credit memo line credit from an invoice gross line, based on the unapply_cm_m method defined in plsql_m_r73.yml.
This example covers unapplying one credit memo line from one invoice line in a single call. It does not cover update_cm_m, which changes credit memo header or line details rather than reversing an application.
Sample call
{
"rest_call": "unapply_cm_m",
"output_format": "json",
"client_no": 4471,
"auth_key": "b92f6e1c8a3d4f0e9b7c2a1d5e6f8091",
"acct_no": 100381,
"cm_unapply_details": [
{
"cm_no": 880213,
"cm_line_no": 2,
"invoice_no": 771002,
"invoice_line_no": 3,
"line_unapply_amount": 45.00
}
],
"do_write": true
}
The rest_call and output_format fields form the envelope added by the REST layer; they are not part of the method's own argument list in the yml. This example identifies the account using acct_no rather than the alternative client_acct_id. The cm_unapply_details array is required and describes each credit memo line unapplication; this example identifies the credit memo line using cm_line_no rather than the alternative cm_transaction_id, and identifies the invoice line using invoice_line_no rather than the alternative invoice_line_transaction_id. The optional line_unapply_amount specifies the gross amount to unapply from the invoice line; if omitted, Aria unapplies the full remaining applied amount. The optional do_write field is set to true so that Aria actually performs the unapplication rather than only calculating its effects.
Sample response
{
"error_code": 0,
"error_msg": "OK",
"unapplied_cm_details": [
{
"invoice_no_out": 771002,
"invoice_line_no_out": 3,
"invoice_line_trans_id_out": 990441,
"cm_no_out": 880213,
"cm_line_no_out": 2,
"cm_transaction_id_out": 550219,
"line_amt_unapplied": 39.13,
"line_tax_amt_unapplied": 5.87
}
]
}
An error_code of zero with an error_msg of "OK" indicates the unapplication succeeded. The unapplied_cm_details array echoes back the results of each requested unapplication, split between the gross amount unapplied, in line_amt_unapplied, and the corresponding tax amount unapplied, in line_tax_amt_unapplied; together these two amounts equal the requested line_unapply_amount of 45.00. Only one representative entry is shown; a call that unapplies multiple credit memo lines would return one entry per line in cm_unapply_details.