Skip to main content
Aria Knowledge Central

get_coupon_group_details_m Sample Call and Response

This example shows an administrative client retrieving the full detail of a single coupon group, group number 71042, including the coupon codes assigned to it, based on the get_coupon_group_details_m method defined in methods_m_r73.yml.

This example covers a single coupon group's identifying fields plus the array of coupon codes assigned to it. It does not cover the full detail of any individual coupon in that array (its discount amount, eligible plans, and so on), which is the scope of the related get_coupon_details_m method instead.

Sample call

{
  "rest_call": "get_coupon_group_details_m",
  "output_format": "json",
  "client_no": 400218,
  "auth_key": "7f3a9c1d2e4b5f6a8c9d0e1f2a3b4c5d",
  "group_no": 71042
}

Besides client_no and auth_key, this call passes group_no, the Aria-assigned identifier for the coupon group. group_no and client_defined_id form an alt_required_field pair, meaning either one alone identifies the group; this example uses the Aria-assigned numeric identifier rather than the client-defined one.

Sample response

{
  "error_code": 0,
  "error_msg": "OK",
  "coupon_groups": [
    {
      "group_no": 71042,
      "client_defined_id": "SEASONAL-PROMOS",
      "group_name": "Seasonal Promotions",
      "description": "Coupons grouped for recurring seasonal campaigns",
      "precedence": "10",
      "coupons": [
        { "coupon_cd": "SUMMER25" },
        { "coupon_cd": "WELCOME10" },
        { "coupon_cd": "HOLIDAY15" }
      ]
    }
  ]
}

An error_code of zero with an error_msg of “OK” indicates the request succeeded. The yml wraps this method's result in the same pluralized coupon_groups field used by the list-all method, get_coupon_groups_m, and does not mark it struct: single, so this response models it as an array; because a single group_no or client_defined_id was requested, that array always contains exactly one entry. The nested coupons array lists three coupon codes assigned to this group as a representative sample; a coupon group in practice can have many more coupons assigned to it than shown here. Each entry in that array is an object with a single coupon_cd field, matching the yml's own schema_name of coupon_codes, rather than a flat array of strings.

TOP
  • Was this article helpful?