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

Miva Developer Docs

Retrieves the price groups assigned, or not assigned, to a customer.


Retrieves the price groups assigned, or not assigned, to a customer. Use Assigned and Unassigned to choose which groups come back. Each record has an assigned flag.

Before you begin#

  • The API token needs CustomerPriceGroupList_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 customer’s Customer_ID, Customer_Login or Edit_Customer.

Example requests#

Retrieve a customer’s price groups#

Returns the price groups the customer is assigned to.

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "CustomerPriceGroupList_Load_Query",
    "Count": 0,
    "Offset": 0,
    "Customer_Login": "{{Customer_Login}}",
    "Assigned": true,
    "Unassigned": false
}

Retrieve price groups the customer isn’t in#

Flips the two flags to return the price groups the customer is not assigned to.

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "CustomerPriceGroupList_Load_Query",
    "Count": 0,
    "Offset": 0,
    "Customer_Login": "{{Customer_Login}}",
    "Assigned": false,
    "Unassigned": true
}

Request parameters#

Parameter Type Required Description
customer_id
edit_customer
customer_login
Number
String
String
The customer id
The customer login
The customer login
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
Assigned Boolean No Assigned
Unassigned Boolean No Unassigned

Example response#

{
    "success": 1,
    "data": {
        "total_count": 1,
        "start_offset": 0,
        "data": [
            {
                "id": 2,
                "name": "Wholesale Pricing",
                "custscope": "X",
                "rate": "R",
                "discount": 0.0,
                "markup": 0.0,
                "dt_start": {
                    "time_t": 0,
                    "year": 1969,
                    "month": 12,
                    "day": 31,
                    "hour": 16,
                    "minute": 0,
                    "second": 0,
                    "timezone": -8
                },
                "dt_end": {
                    "time_t": 0,
                    "year": 1969,
                    "month": 12,
                    "day": 31,
                    "hour": 16,
                    "minute": 0,
                    "second": 0,
                    "timezone": -8
                },
                "qmn_subtot": 0.0,
                "qmx_subtot": 0.0,
                "qmn_quan": 0,
                "qmx_quan": 0,
                "qmn_weight": 0.0,
                "qmx_weight": 0.0,
                "bmn_subtot": 0.0,
                "bmx_subtot": 0.0,
                "bmn_quan": 0,
                "bmx_quan": 0,
                "bmn_weight": 0.0,
                "bmx_weight": 0.0,
                "priority": 0,
                "module": {
                    "id": 87,
                    "code": "discount_product",
                    "name": "Product Discount",
                    "provider": "Miva",
                    "api_ver": "9.01",
                    "version": "10.0000",
                    "module": "modules/discount/product.mvc",
                    "refcount": 1,
                    "active": true
                },
                "capabilities": {
                    "preitems": false,
                    "items": true,
                    "eligibility": "",
                    "basket": false,
                    "shipping": false,
                    "qualifying": false
                },
                "exclusion": false,
                "descrip": "",
                "display": true,
                "assigned": true
            }
        ]
    }
}

Response parameters#

Parameter Type Description
total_count Number Total Product Count
start_offset Number Start Offset
id Number Price Group Id
name String Price Group Name
custscope String One of the following values: C = Coupon Only, X = Specific Customers, L = All Logged-in Customers, A = All Shoppers
rate String Used in Legacy Price Group to determine discount type: R = Retail, C = Cost, D = Discount from Retail, M = Markup from cost.
discount Number Legacy Price Group Discount
markup Number Legacy Price Group Markup
dt_start Object Start Time
dt_end Object End Time
qmn_subtot Number Qualifying Product Minimum Subtotal
qmx_subtot Number Qualifying Product Maximum Subtotal
qmn_quan Number Qualifying Product Minimum Quantity
qmx_quan Number Qualifying Product Maximum Quantity
qmn_weight Number Qualifying Product Minimum Weight
qmx_weight Number Qualifying Product Maximum Weight
bmn_subtot Number Basket Minimum Subtotal
bmx_subtot Number Basket Maximum Subtotal
bmn_quan Number Basket Minimum Quantity
bmx_quan Number Basket Maximum Quantity
bmn_weight Number Basket Minimum Weight
bmx_weight Number Basket Maximum Weight
priority Number Used for order in which price groups are applied
module Object Discount Module Use for Price Group
capabilities Object Capabilities Object
exclusion Boolean Exclusion
descrip String Description
display Boolean Boolean to display discount description in basket
assigned Boolean true/false if customer is assigned to Price Group

dt_start#

Parameter Type Description
time_t Unix Timestamp Start Time as a Unix Timestamp
year Number Year
month Number Month
day Number Day of week represented as a integer
hour Number Hour
minute Number Minute
second Number Second
timezone Number Number of hours before or after GMT

dt_end#

Parameter Type Description
time_t Unix Timestamp Start Time as a Unix Timestamp
year Number Year
month Number Month
day Number Day of week represented as a integer
hour Number Hour
minute Number Minute
second Number Second
timezone Number Number of hours before or after GMT

module#

Parameter Type Description
id Number Discount Module Id
code String Module Code
name String Module Name
provider String Developer who created the discount module
api_ver Number Miva API Version the Module is using
module String Relative path to the module file on the server
refcount Number Number of Price Groups which are using this discount module
active Boolean Active

capabilities#

Parameter Type Description
preitems String If true, the module implements the DiscountModule_Discount_PreItems function
items Boolean If true, the module supports discounts to individual items and must implement the DiscountModule_Discount_Items function
eligibility String Controls Admin UI
basket Boolean If true, the module supports discounts to the overall basket and must implement the DiscountModule_Discount_Basket function
shipping Boolean If true, the module supports discounts to shipping methods and must implement both the DiscountModule_Discount_Shipping and the DiscountModule_Discount_ShippingMethodList functions
qualifying Boolean Qualifying
exclusion Boolean Exclusion
descrip String Description
display Boolean Boolean to display discount description in basket
assigned Boolean true/false if customer is assigned to Price Group

Additional options#

Pagination#

Count and Offset page through results, and the response’s total_count says how many price groups match. See Pagination. List Load Query overview explains the Filter and Sort formats.

Function Use it to
PriceGroupCustomer_Update_Assigned Assign a customer to a price group or remove them
PriceGroupCustomerList_Load_Query Load the customers in a price group
PriceGroupList_Load_Query List every price group in the store
Customer_ProductPriceList_Load_Query Load a customer’s product-specific prices
CustomerList_Load_Query Find the customer’s ID or login

Try in Postman#

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