Skip to main content
Aria Knowledge Central

update_coupon_m Sample Call and Response

This example shows a call to update_coupon_m that revises an existing coupon’s messaging and expiry rules and links it to a recurring credit template that already exists, based on the update_coupon_m method defined in methods_m_r73.yml, Admin Tools API, release seventy-three.

This example covers every required field, plus a representative set of optional fields describing a status change, an updated expiry window, an association to an existing recurring credit template, and a coupon scope restriction. It does not cover defining a brand-new recurring credit template, discount rule, or discount bundle inline as part of the same call.

Sample call

{
  "rest_call": "update_coupon_m",
  "output_format": "json",
  "client_no": 100024,
  "auth_key": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
  "coupon_cd": "SUMMER25OFF",
  "coupon_desc": "Twenty-five Percent Off Summer Promotion",
  "coupon_msg": "Enjoy twenty-five percent off your first invoice this summer.",
  "status_ind": 1,
  "no_of_uses": 500,
  "start_date": "2026-06-01",
  "end_date": "2026-08-31",
  "existing_template": [
    {
      "template_no": 30122
    }
  ],
  "coupon_scope": 3
}

The rest_call and output_format fields sit outside the method’s own documented arguments in the yml; the REST layer common to the Admin Tools API adds these two fields to every call. Client_no and auth_key come from the shared param_defaults block. Coupon_cd and coupon_desc are the method’s own required fields (nullable: false); coupon_cd also serves as the identifier of the existing coupon being updated, since this method has no separate numeric coupon number field.

Status_ind is an enum of two values: one means active and zero means inactive; this example reactivates the coupon. No_of_uses, start_date, and end_date together describe the coupon’s expiry detail, here allowing up to five hundred uses between June first and August thirty-first, 2026.

Existing_template links this coupon to a recurring credit template that a prior call to create_credit_template_m already created (credit_template_no thirty thousand one hundred twenty-two). The yml documents this field with indexed REST array syntax (existing_template[0][template_no], existing_template[1][template_no], and so on), so it is represented here as a JSON array of objects even though this example includes only one entry; a coupon associated with several templates would include one object per template. This example uses the Aria-assigned template_no rather than its alternative, the client-defined template_id.

Coupon_scope is an enum of four values (one through four, meaning application to the account only, the master plan instance stack only, both, or individual plan instances, respectively); this example uses three, meaning the coupon can be applied to the account and to the master plan instance stack.

Sample response

{
  "error_code": 0,
  "error_msg": "OK",
  "coupon_cd": "SUMMER25OFF"
}

An error_code of zero and an error_msg of “OK” together indicate that Aria updated the coupon successfully. Coupon_cd echoes back the coupon code that was updated.

Left out of this example are the template field, which would let this same call define a brand-new recurring credit template inline rather than linking to one that already exists; the discount_rule and discount_bundle fields and their existing_discount_rule and existing_discount_bundle counterparts, which attach discount rules or bundles instead of a recurring credit template; and locale_no and locale_name, which apply only when working with translated coupon text in a specific locale.

TOP
  • Was this article helpful?