Skip to content

PriceGroupBusinessAccountList_Load_Query#


Description#

This function loads a list of Business Account price groups.

Request Parameters#

Parameter
Type Description
pricegroup_id
pricegroup_code
edit_pricegroup
Number
String
String
ID of the Price Group.
Price Group code
Price Group code
assigned Boolean Boolean value indicating if the query returns assigned business accounts
unassigned Boolean Boolean value indicating if the query returns unassigned business accounts
count Number Maximum lines of data allowed to be returned in the response. This limit is used to prevent excessive amounts of data return
filter String A string for filtering returned data
offset Number Used with the Count parameter for paginating results of large datasets. Default 0 is no offset.
sort String The order for sorting returned data

Response Parameters#

Parameter
Type Description
success Boolean Boolean value indicating if the API request was successful
total_count Number The number of business accounts returned
start_offset Number The offset starting point for pagination of return data
data Array An array containing business account information
id Number Business account id
title String Business name associated with the id
tax_exempt Boolean Boolean value indicating if the business customer is tax exempt
order_cnt Number The number of orders the customer has placed
order_avg Number Average order total for the customer
formatted_order_avg String Currency formatted average order total for the customer
order_tot Number Total amount of all orders for the customer
formatted_order_tot String Currency formatted total amount of all orders
note_count Number Total number of notes for the customer
assigned Boolean Boolean value indicating if the customer is currently assigned to the price group

Example Request#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "PriceGroupBusinessAccountList_Load_Query",
    "PriceGroup_ID": 5,
    "Assigned": 1,
    "Unassigned": 1,
    "Filter": "",
    "Sort": "title",
    "Offset": 0,
    "Count": 18
}

Example Response#

{
    "success": 1,
    "data": {
        "total_count": 2,
        "start_offset": 0,
        "data": [
            {
                "id": 2,
                "title": "TestBusiness1",
                "tax_exempt": false,
                "order_cnt": 101,
                "order_avg": 381.34,
                "formatted_order_avg": "$381.34",
                "order_tot": 38515.6,
                "formatted_order_tot": "$38,515.60",
                "note_count": 0,
                "assigned": false
            },
            {
                "id": 4,
                "title": "Test_Biz_B",
                "tax_exempt": false,
                "order_cnt": 1,
                "order_avg": 135.9,
                "formatted_order_avg": "$135.90",
                "order_tot": 135.9,
                "formatted_order_tot": "$135.90",
                "note_count": 0,
                "assigned": true
            }
        ]
    }
}

Error Responses#

Error Code Error Message Error Description
MER-PGR-JSN-00006 Price group not found Price group not found