Created by potrace 1.16, written by Peter Selinger 2001-2019

Miva Developer Docs

Retrieves the customer-specific prices for a product.


Retrieves the customers in a customer-specific price group along with each one’s price for a product. It’s a module function, so Function is always Module and the Customer Specific Pricing module’s code and function name go in Module_Code and Module_Function. Use Discounted and Undiscounted to choose which customers come back.

Before you begin#

  • The API token needs Product_CustomerPriceList_Load_Query, either assigned directly under Functions or through a group. See Create an API token.
  • Requests must be signed if the token requires it. See Make a signed request with HMAC.
  • You need the name of the customer-specific price group (PriceGroup_Name) and the product’s Product_Code.

Example requests#

Retrieve customers with a discounted price#

Returns every customer in the price group who has a discounted price for the product, sorted by login.

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "Module",
    "Module_Code": "discount_customerspecific",
    "Module_Function": "Product_CustomerPriceList_Load_Query",
    "PriceGroup_Name": "Customer Specific Pricing",
    "Product_Code": "{{Product_Code}}",
    "Discounted": true,
    "Undiscounted": false,
    "Count": 0,
    "Offset": 0,
    "Sort": "login",
    "Filter": []
}

Retrieve customers without a discounted price#

Flips the flags to return the first 10 customers who don’t have a discounted price for the product.

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "Module",
    "Module_Code": "discount_customerspecific",
    "Module_Function": "Product_CustomerPriceList_Load_Query",
    "PriceGroup_Name": "Customer Specific Pricing",
    "Product_Code": "{{Product_Code}}",
    "Discounted": false,
    "Undiscounted": true,
    "Count": 10,
    "Offset": 0,
    "Sort": "login"
}

Request parameters#

Parameter Type Required Description
count Number No Maximum lines of data allowed to be returned in the response. This limit is used to prevent excessive amounts of data return
filter String No A string for filtering returned data
offset Number No Used with the Count parameter for paginating results of large datasets. Default 0 is no offset.
sort String No The order for sorting returned data
Function String Yes Always a value of “Module”
Module_Code String Always a value of discount_customerspecific
Module_Function String Always a value of Product_CustomerPriceList_Load_Query
PriceGroup_Name String Name of Customer Specific Price Group
Product_Code String Product Code Lookup
Discounted Boolean No Flag to only return customers who have a discounted price
Undiscounted Boolean No Flag to only return customers who don’t have a discounted price

Example response#

The response to the first example, shortened to one customer.

{
    "success": 1,
    "data": {
        "total_count": 2,
        "start_offset": 0,
        "data": [
            {
                "id": 13,
                "account_id": 0,
                "login": "drawspring",
                "pw_email": "[email protected]",
                "ship_id": 21,
                "ship_res": true,
                "ship_fname": "Mike",
                "ship_lname": "Thomas",
                "ship_email": "[email protected]",
                "ship_comp": "Fellowship of the sword",
                "ship_phone": "555-555-5555",
                "ship_fax": "",
                "ship_addr1": "Dancing Bull",
                "ship_addr2": "",
                "ship_city": "Greyminster",
                "ship_state": "WY",
                "ship_zip": "82001",
                "ship_cntry": "US",
                "bill_id": 22,
                "bill_fname": "Hennet",
                "bill_lname": "Talararil",
                "bill_email": "[email protected]",
                "bill_comp": "Fellowship of the sword",
                "bill_phone": "555-555-5555",
                "bill_fax": "",
                "bill_addr1": "Dancing Bull",
                "bill_addr2": "",
                "bill_city": "Greyminster",
                "bill_state": "WY",
                "bill_zip": "82001",
                "bill_cntry": "US",
                "tax_exempt": false,
                "note_count": 0,
                "dt_created": 1595517714,
                "dt_login": 0,
                "dt_pwchg": 1595517714,
                "credit": 0.00,
                "formatted_credit": "$0.00",
                "business_title": "",
                "discounted_price": 10.00
            }
        ]
    }
}
Full response
{
    "success": 1,
    "data": {
        "total_count": 2,
        "start_offset": 0,
        "data": [
            {
                "id": 13,
                "account_id": 0,
                "login": "drawspring",
                "pw_email": "[email protected]",
                "ship_id": 21,
                "ship_res": true,
                "ship_fname": "Mike",
                "ship_lname": "Thomas",
                "ship_email": "[email protected]",
                "ship_comp": "Fellowship of the sword",
                "ship_phone": "555-555-5555",
                "ship_fax": "",
                "ship_addr1": "Dancing Bull",
                "ship_addr2": "",
                "ship_city": "Greyminster",
                "ship_state": "WY",
                "ship_zip": "82001",
                "ship_cntry": "US",
                "bill_id": 22,
                "bill_fname": "Hennet",
                "bill_lname": "Talararil",
                "bill_email": "[email protected]",
                "bill_comp": "Fellowship of the sword",
                "bill_phone": "555-555-5555",
                "bill_fax": "",
                "bill_addr1": "Dancing Bull",
                "bill_addr2": "",
                "bill_city": "Greyminster",
                "bill_state": "WY",
                "bill_zip": "82001",
                "bill_cntry": "US",
                "tax_exempt": false,
                "note_count": 0,
                "dt_created": 1595517714,
                "dt_login": 0,
                "dt_pwchg": 1595517714,
                "credit": 0.00,
                "formatted_credit": "$0.00",
                "business_title": "",
                "discounted_price": 10.00
            },
            {
                "id": 3,
                "account_id": 0,
                "login": "parovarium",
                "pw_email": "[email protected]",
                "ship_id": 1,
                "ship_res": true,
                "ship_fname": "John",
                "ship_lname": "Smith",
                "ship_email": "[email protected]",
                "ship_comp": "MivaCorp",
                "ship_phone": "555-555-5555",
                "ship_fax": "555-555-1212",
                "ship_addr1": "5060 Santa Fe St",
                "ship_addr2": "",
                "ship_city": "San Diego",
                "ship_state": "CA",
                "ship_zip": "92109",
                "ship_cntry": "US",
                "bill_id": 2,
                "bill_fname": "Testy",
                "bill_lname": "Testerman",
                "bill_email": "[email protected]",
                "bill_comp": "MivaCorp",
                "bill_phone": "555-555-5555",
                "bill_fax": "555-555-1212",
                "bill_addr1": "5060 Santa Fe St",
                "bill_addr2": "",
                "bill_city": "San Diego",
                "bill_state": "CA",
                "bill_zip": "92109",
                "bill_cntry": "US",
                "tax_exempt": false,
                "note_count": 0,
                "dt_created": 1595517714,
                "dt_login": 0,
                "dt_pwchg": 1595517714,
                "credit": 0.00,
                "formatted_credit": "$0.00",
                "business_title": "",
                "discounted_price": 17.56
            }
        ]
    }
}

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 Customer Id
account_id Number Business Account Id
login String Customer Login
pw_email String Forgot Password Email
ship_id Number Shipping Address ID
ship_res Boolean Boolean flag used to determine if commercial or residential rates are returned.
ship_fname String Shipping First Name
ship_lname String Customer Last Name
ship_email String Shipping Email Address
ship_comp String Shipping Company
ship_phone String Shipping Phone Number
ship_fax String Shipping Fax Number
ship_addr1 String Shipping Address 1
ship_addr2 String Shipping Address 2
ship_city String Shipping City
ship_state String Shipping State. 2 digit state code
ship_zip String Shipping Zip Code
ship_cntry String Shipping Country. 2 digit country code
bill_id Number Billing Address Id
bill_fname String Billing First Name
bill_lname String Customer Last Name
bill_email String Billing Email Address
bill_comp String Billing Company
bill_phone String Billing Phone Number
bill_fax String Billing Fax Number
bill_addr1 String Billing Address 1
bill_addr2 String Billing Address 2
bill_city String Billing City
bill_state String Billing State. 2 digit state code
bill_zip String Billing Zip Code
bill_cntry String Billing Country. 2 digit country code
note_count Number Number of Notes assigned to customer record
dt_created Unix Timestamp Unix timestamp of the date account was created.
dt_login Unix Timestamp Date Time of Last Login
credit Number Customer Account Credit
formatted_credit String Currency Formatted Customer Account Credit
business_title String Business Account Name
discounted_price Number Specific Discounted Price for this customer (for the product requested)

Additional options#

List Load Query overview explains the filter format and every operator.

Pagination#

Count and Offset page through results, and the response’s total_count says how many customers match. See Pagination.

Function Use it to
Customer_ProductPriceList_Load_Query Load a customer’s specific prices across products
PriceGroupList_Load_Query Find price groups
PriceGroupCustomerList_Load_Query Load the customers assigned to a price group
PriceGroupProductList_Load_Query Load the products assigned to a price group
ProductList_Load_Query Find products

Try in Postman#

In the Miva: JSON API: Authenticated collection, open Products > Product_CustomerPriceList_Load_Query. See Set Up Postman.