Skip to main content
Aria Knowledge Central

cancel_acct_plan_m Sample Call and Response

This example shows a call that cancels a supplemental plan instance on an account and invoices the resulting proration immediately, based on the cancel_acct_plan_m method defined in the plsql_m_r73.yml release file.

This example covers an immediate cancellation with forced proration and an immediate proration invoice. It does not cover future-dated cancellations using effective_date, anniversary-date cancellations using offset_interval, or returning the plan instance change queue.

Sample call

{
  "rest_call": "cancel_acct_plan_m",
  "output_format": "json",
  "client_no": 4001,
  "auth_key": "a1b2c3d4e5f6g7h8i9j0",
  "acct_no": 305567,
  "plan_instance_no": 780234,
  "client_receipt_id": "CANCEL-2026-0724-001",
  "comments": "Customer requested cancellation of premium streaming plan effective immediately.",
  "assignment_directive": 4,
  "do_write": "true",
  "invoice_unbilled_usage": "true",
  "proration_invoice_timing": 0
}

The acct_no field is used instead of its alternative, client_acct_id, and plan_instance_no is used instead of its alternative, client_plan_instance_id. The assignment_directive value of 4 tells Aria to cancel the plan immediately while forcing proration, regardless of the client's pre-configured default proration rule; other values in this same field's enumeration honor the client default, force no proration, or defer the change to the account's next anniversary date or to a specified effective_date. The do_write field is passed as the string "true" so that the cancellation is actually performed rather than only previewed. The invoice_unbilled_usage field is passed as "true" so that any unbilled usage on the plan is invoiced as part of the mid-term cancellation. The proration_invoice_timing value of 0 generates a separate invoice immediately for the prorated charges, rather than deferring them to the next anniversary date.

Sample response

{
  "error_code": 0,
  "error_msg": "OK",
  "proration_result_amount": -3.81,
  "invoice_no": 9043221,
  "total_charges_before_tax": 8.00,
  "total_tax_charges": 0.66,
  "total_charges_after_tax": 8.66,
  "total_credit": 12.47,
  "total_tax_credit": 1.03,
  "total_credit_before_tax": 11.44,
  "total": -3.81,
  "acct_plan_line_items": [
    {
      "bill_to_address_no": 220981,
      "ship_to_address_no": 220981
    }
  ]
}

An error_code of 0 together with an error_msg of "OK" indicates that the cancellation was performed without error. The negative proration_result_amount and total values indicate a net credit to the account, since the unused remainder of the prepaid period outweighs the charge for the invoiced unbilled usage. The acct_plan_line_items array would contain one entry per invoice line item created by this cancellation; this example shows a single representative entry and leaves out that entry's bill_from_address_no and ship_from_address_no, since this scenario did not require a separate bill-from or ship-from address override. This example also leaves out proration_credit_result_amount, proration_credit_amount, proration_tax_amount, and plan_instance_queue, since include_plan_instance_queue was not requested, and it leaves out third_party_errors, since no tax-engine error occurred.

TOP
  • Was this article helpful?