Skip to content

CouponBusinessAccountList_Load_Query#


Description#

This function allows you to load one or more business accounts assigned to a coupon.

Request Body Parameters#

Parameter
Type Description
count Number Count is used to tell Miva how many records to return.
offset Offset Used in conjunction with the Count parameter for paginating results of large datasets. Default is 0.
sort String Field to sort results by. Available sorting fields listed below. Use - prefix for a descending sort.
filter Object Array of Object containing search filters. See usage here
Coupon_ID
Coupon_Code
Edit_Coupon
Number
String
String
ID of the coupon.
Coupon code
Coupon code

Search Filter Columns#

Column
Description
title Business Account Title
note_count Number of notes assigned to the business account
tax_exempt Boolean value for tax exemption
order_cnt Order count for the coupon
order_avg Order average for the coupon
order_tot Order total for the coupon

Supported Sort Columns#

One of these values would be passed in the sort request parameter to have the results sorted by that column. Value may be preceded by “-” for a descending sort.

Column
Description
id
title Business Account Title
note_count Number of notes assigned to the business account
tax_exempt Boolean value for tax exemption
order_cnt Order count for the coupon
order_avg Order average for the coupon
order_tot Order total for the coupon
max_per Maximum count per coupon
active Boolean value for active or inactive

Response Parameters#

Parameter
Type Description
total_count Number total_count is the total number of records that match your search criteria. Note: this is not always the total coupons returned. Based on the Count and Offset parameters passed, the number of records returned could be different than the total_count.
start_offset Number Number number of the starting offset number of coupons to return. Used in conjunction with the Count parameter for paginating results of large datasets.
id Number Business Account Id
title String Business Account Title
order_cnt Number Total orders by business account
order_avg Number Average value of orders by the business account
formatted_order_avg Number Formatted average value of orders by the business account
order_tot Number Total number of orders by the business account
formatted_order_tot Number Formatted order total of orders by the business account
note_count Number Note count for business account
assigned Boolean Assigned to coupon

Example Request#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "CouponBusinessAccountList_Load_Query",
    "Coupon_Code": "COUPON_CODE"
}

Example Response#

{
    "success": 1,
    "data": {
        "total_count": 2,
        "start_offset": 0,
        "data": [
            {
                "id": 1,
                "title": "Group A",
                "tax_exempt": false,
                "order_cnt": 0,
                "order_avg": 0.0,
                "formatted_order_avg": "$0.00",
                "order_tot": 0.0,
                "formatted_order_tot": "$0.00",
                "note_count": 0,
                "assigned": true
            },
            {
                "id": 2,
                "title": "Group B",
                "tax_exempt": true,
                "order_cnt": 0,
                "order_avg": 0.0,
                "formatted_order_avg": "$0.00",
                "order_tot": 0.0,
                "formatted_order_tot": "$0.00",
                "note_count": 0,
                "assigned": true
            }
        ]
    }
}