create_cm_m Sample Call and Response
This example shows a typical call to create_cm_m that creates a credit memo against a specific invoice to credit back one overcharged line item, along with a representative response. The example is based on the method definition in plsql_m_r73.yml.
This example includes every field required to create a working credit memo and a representative set of commonly used optional fields, not every field the method accepts.
Sample call
{
"rest_call": "create_cm_m",
"output_format": "json",
"client_no": 10023,
"auth_key": "8f3e2b1a9c7d4e6f0a1b2c3d4e5f6789",
"acct_no": 3300457,
"orig_invoice_no": 8827341,
"cm_reason_cd": 4,
"cm_comments": "Customer was overcharged for the July billing cycle due to a rate table error; issuing a credit memo to correct the invoice.",
"customer_facing_comments": "Credit applied to correct a billing error on your July invoice.",
"do_write": "true",
"cm_line_items": [
{
"line_no": 2,
"master_plan_instance_no": 8801122,
"service_no": 40031,
"cm_line_amount": 15.00,
"cm_line_comments": "Correction for rate table error on the recurring service charge."
}
]
}
rest_call and output_format are added by the REST layer common to every Core API call; they do not appear among the method's own documented arguments. acct_no identifies the account the credit memo is created against; client_acct_id is the client-defined alternative, and only one of the two is supplied, not both.
orig_invoice_no references the invoice this credit memo corrects. Because an original invoice is referenced and credit_ref_type is left out of this example, the credit memo defaults to an invoice-based credit memo; supplying credit_ref_type explicitly instead marks the credit memo as a general credit, a price-change credit, or a cancellation credit.
cm_line_items is an array because a credit memo can credit more than one original invoice line at once; this example includes one entry. Within it, line_no references the specific line on the original invoice being credited, master_plan_instance_no and service_no identify the plan instance and service the credited charge belongs to, and cm_line_amount is the amount credited back for that line. Their client-defined alternatives (client_master_plan_instance_id and client_service_id) are not shown.
do_write is set to true, meaning Aria actually creates the credit memo. Setting it to false instead calculates and returns the would-be effects of the credit memo without creating it, useful for presenting a confirmation page to a user before committing the change.
Sample response
{
"error_code": 0,
"error_msg": "OK",
"cm_no": 771540,
"created_by": "rwest",
"created_date": "2026-07-24",
"cm_total": 15.00,
"cm_reason_cd_out": 4,
"cm_comments_out": "Customer was overcharged for the July billing cycle due to a rate table error; issuing a credit memo to correct the invoice.",
"customer_facing_comments_out": "Credit applied to correct a billing error on your July invoice.",
"cm_details": [
{
"cm_line_no": 1,
"applied_invoice_no": 8827341,
"applied_invoice_line_no": 2,
"master_plan_instance_no_out": 8801122,
"service_no_out": 40031,
"cm_transaction_id": 6612044,
"cm_line_amount_out": 15.00
}
],
"client_cm_seq_id_2": "CM-2026-07-0091"
}
error_code of 0 with error_msg of "OK" indicates the credit memo was created successfully. cm_no is the Aria-assigned unique identifier for the credit memo, and cm_total is its total amount. created_by and created_date record who created the credit memo and when.
cm_details is an array; it holds one entry per line credited, and a credit memo covering more than one original invoice line would return more entries here. Each entry ties the credit memo line (cm_line_no, cm_transaction_id) back to the original invoice and line it corrects (applied_invoice_no, applied_invoice_line_no) and the plan instance and service credited.
This response omits credit_ref_type_out, cm_tax_details (populated only when tax was credited back as part of the memo), and client_appended_cm_seq_id (populated only when the client has configured a prefix or suffix for credit memo sequence identifiers). It also omits the deprecated client_cm_seq_id field, using client_cm_seq_id_2 in its place, and the deprecated client_item_id_out field within cm_details.