Skip to main content
Aria Knowledge Central

apply_cm_m Sample Call and Response

This example shows you how to apply a credit memo line against a specific invoice line, using the plsql_m_r73.yml definition for release seventy-three of the Aria Billing Cloud Core API.

This example covers one credit memo line applied to one invoice line through the credit_application_details array. It does not cover applying multiple credit memo lines in a single call, although the array supports that.

Sample call

{
  "rest_call": "apply_cm_m",
  "output_format": "json",
  "client_no": 3001,
  "auth_key": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "acct_no": 5544332,
  "credit_application_details": [
    {
      "cm_no": 660211,
      "cm_line_no": 1,
      "apply_to_invoice_no": 9012345,
      "apply_to_invoice_line_no": 2,
      "gross_line_application_amt": 49.00
    }
  ],
  "do_write": "true"
}

The credit_application_details field is an array of credit memo line applications, and this example includes one entry, though you could include more than one to apply several credit memo lines in the same call. Within that entry, cm_line_no identifies the credit memo line rather than the alternative cm_transaction_id, and apply_to_invoice_line_no identifies the invoice line rather than the alternative apply_to_invoice_line_tran_id. The account is identified by acct_no rather than the alternative client_acct_id. The do_write field is optional and defaults to true; this example sets it explicitly to true to confirm that Aria performs the credit application rather than merely calculating its effect.

Sample response

{
  "error_code": 0,
  "error_msg": "OK",
  "applied_cm_line_details": [
    {
      "applied_to_invoice_no": 9012345,
      "applied_to_invoice_line_no": 2,
      "invoice_line_transaction_id": 4456789,
      "cm_no_out": 660211,
      "cm_line_no_out": 1,
      "cm_transaction_id_out": 8823456,
      "line_amt_applied": 49.00,
      "line_tax_amt_applied": 0.00
    }
  ]
}

An error_code value of zero, together with an error_msg value of "OK", indicates that Aria applied the credit memo line successfully; this method's returns do not include an error_details field at all, unlike most other Core API methods. The applied_cm_line_details array echoes back one entry for each credit memo line application that Aria processed; this example shows a single entry because the sample call included a single entry, and additional entries would appear here if the call had applied more than one credit memo line.

TOP
  • Was this article helpful?