Skip to content

CustomerCreditHistoryList_Load_Query#


Description#

This function allows you to load a list Credit History Transactions for a specific customer.

Request Body Parameters#

Parameter
Type Description
customer_id
edit_customer
customer_login
Number
String
String
The customer id
The customer login
The customer login
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
total_count Number total_count is the total number of records that match your search criteria. Note: this is not always the total products 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 of the starting offset number of products to return. Used in conjunction with the Count parameter for paginating results of large datasets.
id Number Credit History Transaction ID
user_id Number The Id of the Admin user who added the transaction. 0 if not placed by an Admin user
cust_id Number The Id of the Customer for the transaction list
order_id Number The Order ID the transaction references. If no order, it is 0
txref Number Optional Transaction Reference
descrip String The description for the transaction list
amount Number The amount of customer credit for the transaction
dtstamp Date Timestamp The timestamp for when the transaction took place
user_name String The User name of the admin user if it was added by an Admin. If no admin, the string returns empty.

Example Request#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "CustomerCreditHistoryList_Load_Query",
    "Customer_Login": "bheyde",
    "Count": 0,
    "Offset": 0,
    "Sort": "-id",
    "Filter": []
}

Example Response#

{
    "success": 1,
    "data": {
        "total_count": 4,
        "start_offset": 0,
        "data": [
            {
                "id": 6,
                "user_id": 0,
                "cust_id": 15,
                "order_id": 0,
                "txref": "12345",
                "descrip": "Credit For Order 12345",
                "amount": 10.5,
                "formatted_amount": "$10.50",
                "dtstamp": 1600968503,
                "user_name": ""
            },
            {
                "id": 5,
                "user_id": 0,
                "cust_id": 15,
                "order_id": 0,
                "txref": "12345",
                "descrip": "Credit For Order 12345",
                "amount": 10.5,
                "formatted_amount": "$10.50",
                "dtstamp": 1600968503,
                "user_name": ""
            },
            {
                "id": 4,
                "user_id": 0,
                "cust_id": 15,
                "order_id": 0,
                "txref": "12345",
                "descrip": "Credit For Order 12345",
                "amount": 10.5,
                "formatted_amount": "$10.50",
                "dtstamp": 1600968502,
                "user_name": ""
            },
            {
                "id": 3,
                "user_id": 0,
                "cust_id": 15,
                "order_id": 0,
                "txref": "12345",
                "descrip": "Credit For Order 12345",
                "amount": 10.5,
                "formatted_amount": "$10.50",
                "dtstamp": 1600968239,
                "user_name": ""
            }
        ]
    }
}