get_coupon_history_m Sample Call and Response
This example queries for the application history of one coupon code on a specific account, based on the get_coupon_history_m method defined in app_m_r73.yml for the Object Query API.
This example includes every required argument, along with a query_string built from queryable fields that narrows the search to one account and one coupon code, and a representative pair of coupon-history entries showing that the same coupon code was applied twice. It does not attempt to show every field this method can return.
Sample call
{
"rest_call": "get_coupon_history_m",
"output_format": "json",
"client_no": 60214,
"auth_key": "3f9c2b7a-91de-4a2c-88fb-4e6d0a5c7f21",
"query_string": "acct_no = 30182034 AND coupon_cd = \"SAVE10FALL\"",
"limit": 10,
"offset": 0
}
This method does not accept username or password arguments at all, unlike the other methods in this batch, so only client_no and auth_key serve as the required identifiers here; query_string is also required, since the shared param_defaults definition marks it nullable false. The query_string in this example uses acct_no and coupon_cd, both of which carry queryable true directly under coupon_history_m; other legal filter fields include user_id, client_acct_id, master_plan_instance_id, client_master_plan_instance_id, coupon_create_date, coupon_cancel_date, plan_instance_no, client_plan_instance_id, and coupon_assignment_level. output_format and rest_call are envelope fields added by the REST gateway rather than being part of the method's own documented arguments. limit and offset are optional paging controls.
Sample response
{
"error_code": 0,
"error_msg": "OK",
"starting_record": 0,
"total_records": 3,
"coupon_history_m": [
{
"acct_no": 30182034,
"user_id": "jrivera_novara",
"client_acct_id": "ACCT-10493",
"master_plan_instance_id": "9004471",
"client_master_plan_instance_id": "MPI-NOVARA-01",
"currency_cd": "USD",
"coupon_cd": "SAVE10FALL",
"coupon_create_date": "2026-03-01",
"coupon_status": "1",
"plan_instance_no": 9004471,
"client_plan_instance_id": "PI-NOVARA-01",
"coupon_assignment_level": 2
},
{
"acct_no": 30182034,
"user_id": "jrivera_novara",
"client_acct_id": "ACCT-10493",
"currency_cd": "USD",
"coupon_cd": "SAVE10FALL",
"coupon_create_date": "2025-11-01",
"coupon_status": "-1",
"coupon_cancel_date": "2025-12-01",
"coupon_assignment_level": 1
}
]
}
An error_code of zero with an error_msg of "OK" indicates the query succeeded. total_records is set to three to show that this account and coupon code combination has more history than this example displays; only the first two entries are shown in coupon_history_m, and the real array would continue with a third entry. The first entry shows the coupon currently active, applied at coupon_assignment_level 2, which the yml documents as the MPI Stack Level, against the master plan instance shown in master_plan_instance_id. The second entry shows an earlier application of the same coupon code at coupon_assignment_level 1, the Account Level, which was later canceled, as shown by coupon_cancel_date; coupon_status follows the yml's documented convention of "1" for active and "-1" for canceled. Since the second entry was applied at the account level rather than to a specific plan instance, it does not include master_plan_instance_id, client_master_plan_instance_id, plan_instance_no, or client_plan_instance_id.