Skip to main content
Aria Knowledge Central

edit_surcharge_m Sample Call and Response

This example edits an existing surcharge, updating its name and description, confirming its scope, and defining two pricing tiers along with one named rate schedule for the surcharge. It is based on the edit_surcharge_m definition in methods_m_r73.yml, the Admin Tools API method file for the Aria release 73 build.

This example covers a surcharge that applies broadly to all plan charges, so it does not include the plan_no, service_no, or item_no fields, which the yml file requires only for more targeted scope values. It also does not cover the deprecated currency_cd and apply_to_zero_invoice_ind fields.

Sample call

{
  "rest_call": "edit_surcharge_m",
  "output_format": "json",
  "client_no": 100589,
  "auth_key": "8f3e2c9a1b7d4f6e9c2a5b8d1e4f7a2c",
  "surcharge_no": 9004,
  "surcharge_name": "Regulatory Recovery Fee",
  "description": "Recovers estimated regulatory compliance costs applied to all plan charges.",
  "ext_description": "Regulatory Recovery Fee",
  "scope_no": 2,
  "surcharge_scope": 1,
  "surcharge_tier": [
    {
      "from": 1,
      "to": 100,
      "rate": 0.50
    },
    {
      "from": 101,
      "rate": 0.35
    }
  ],
  "schedule": [
    {
      "schedule_name": "Standard USD Schedule",
      "currency_cd": "usd",
      "is_default": 1,
      "min_surcharge_to_apply": 5.00,
      "include_zero": 0
    }
  ]
}

The rest_call and output_format fields are REST-layer envelope fields and are not part of the method arguments defined in the yml file itself. client_no and auth_key are the standard Aria-assigned client identifier and authentication key that every call requires.

The surcharge_no field identifies which surcharge to edit. The yml file defines surcharge_no and the client-defined client_surcharge_id as an alternative required pair, so only one of the two needs to appear in a given call; this example uses surcharge_no, the Aria-assigned numeric identifier. surcharge_name, description, and ext_description are all required fields that rename and redescribe the surcharge; ext_description is the description visible to the account holder on the statement.

The scope_no field is required and controls which charges the surcharge applies to. This example uses value 2, meaning the surcharge applies to all plan charges across all plans, so it does not need to identify specific plans or services. surcharge_scope, available only for Aria’s EOM clients, further restricts the surcharge to the account itself (value 1) rather than to a master plan instance (value 2) or both (value 3).

surcharge_tier is a required array of pricing tiers. This example includes two tiers: the first covers units 1 through 100 at a rate of 0.50, and the second covers unit 101 onward at a rate of 0.35, leaving out the optional “to” field on the last tier to indicate no upper bound. schedule is a separate, optional array that defines named rate schedules for the surcharge; this example includes one schedule marked as the default for United States dollars, with a minimum surcharge threshold of 5.00 before the surcharge applies, and include_zero set to 0 so that zero-amount tiers are ignored on the invoice.

This example leaves out client_surcharge_id, since surcharge_no already identifies the surcharge, and it leaves out plan_no, client_plan_id, service_no, client_service_id, item_no, client_sku, and locale_no or locale_name, none of which apply to this scope or story. It also leaves out currency_cd and apply_to_zero_invoice_ind, both of which the yml file marks as deprecated, and client_item_id, which the yml file also marks as deprecated.

Sample response

{
  "error_code": 0,
  "error_msg": "OK",
  "surcharge_no": 9004
}

An error_code of zero with an error_msg of “OK” indicates that Aria successfully edited the surcharge. The surcharge_no field in the response echoes back the identifier of the surcharge that was edited.

TOP
  • Was this article helpful?