Skip to content

CouponCustomerList_Load_Query#


This function loads a list of customers by coupon.

Request Parameters#

Parameter
Type Description
Coupon_ID
Coupon_Code
Edit_Coupon
Number
String
String
ID of the coupon.
Coupon code
Coupon code
assigned Boolean Indicates if the query should return assigned coupons.
unassigned Boolean Indicates if the query should return unassigned coupons.
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
#filter)

Supported Search Filter Columns#

Search Filter Description
id Coupon ID
code Coupon Code

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.

Sort Description
id Coupon ID

Response Parameters#

Parameter
Type Description
success Boolean Indicates if the API request was successful.
total_count Number Number of coupons returned.
start_offset Number Offset starting point for pagination of return data.
id Number Customer coupon ID.
account_id Number Account ID associated with the customer coupon.
login String Customer’s login name.
pw_email String Email for the customer password.
ship_id Number Shipping ID associated with the customer.
ship_res Boolean Indicates if the shipping address is residential.
ship_fname String Shipping first name.
ship_lname String Shipping last name.
ship_email String Shipping email address.
ship_comp String Shipping company name.
ship_phone String Shipping phone number.
ship_fax String Shipping fax number.
ship_addr1 String First shipping address field.
ship_addr2 String Second shipping address field.
ship_city String Shipping city.
ship_state String Shipping state.
ship_zip String Shipping zip code.
ship_cntry String Shipping country.
bill_id Number Billing ID of the customer.
bill_fname String Billing first name.
bill_lname String Billing last name.
bill_email String Billing email address.
bill_comp String Billing company name.
bill_phone String Billing phone number.
bill_fax String Billing fax number.
bill_addr1 String First billing address field.
bill_addr2 String Second billing address field.
bill_city String Billing city.
bill_state String Billing state.
bill_zip String Billing zip code.
bill_cntry String Billing country.
tax_exempt Boolean Indicates if the customer is tax exempt.
order_cnt Number Number of orders placed by the customer.
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.
dt_created Number Unix timestamp for the customer creation date.
dt_login Number Unix timestamp for the customer’s most recent login date.
dt_pwchg Number Unix timestamp for the date the customer changed their password.
credit Number Amount of any customer credit on file.
formatted_credit String Currency-formatted amount of any customer credit on file.
business_title String Customer’s business title.
assigned Boolean Indicates if the customer is currently assigned to the coupon.

Example Request#

{
    "Store_code": "beta",
    "Function": "CouponCustomerList_Load_Query",
    "Coupon_ID": 1,
    "Assigned": 1,
    "Unassigned": 1,
    "Filter": "",
    "Sort": "id",
    "Offset": 0,
    "Count": 24
}

Example Response#

{
  "success": 1,
  "data": {
    "total_count": 18,
    "start_offset": 0,
    "data": [
      {
        "id": 1,
        "account_id": 2,
        "login": "jondoe",
        "pw_email": "noreply@miva.com",
        "ship_id": 1,
        "ship_res": true,
        "ship_fname": "Maynard",
        "ship_lname": "Batalla",
        "ship_email": "noreply@miva.com",
        "ship_comp": "MivaCorp",
        "ship_phone": "555-555-5555",
        "ship_fax": "555-555-1212",
        "ship_addr1": "5060 Santa Fe Street",
        "ship_addr2": "",
        "ship_city": "San Diego",
        "ship_state": "CA",
        "ship_zip": "92109",
        "ship_cntry": "US",
        "bill_id": 1,
        "bill_fname": "Maynard",
        "bill_lname": "Batalla",
        "bill_email": "noreply@miva.com",
        "bill_comp": "MivaCorp",
        "bill_phone": "555-555-5555",
        "bill_fax": "555-555-1212",
        "bill_addr1": "5060 Santa Fe Street",
        "

bill_addr2": "",
        "bill_city": "San Diego",
        "bill_state": "CA",
        "bill_zip": "92109",
        "bill_cntry": "US",
        "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": 2,
        "dt_created": 1623693375,
        "dt_login": 0,
        "dt_pwchg": 1623693375,
        "credit": 0.0,
        "formatted_credit": "$0.00",
        "business_title": "TestBusiness1",
        "assigned": false
      },
      {
        "id": 2,
        "account_id": 4,
        "login": "realm",
        "pw_email": "noreply@miva.com",
        "ship_id": 3,
        "ship_res": true,
        "ship_fname": "Victor",
        "ship_lname": "Lamay",
        "ship_email": "noreply@miva.com",
        "ship_comp": "Fellowship of the sword",
        "ship_phone": "555-555-5555",
        "ship_fax": "",
        "ship_addr1": "Bear and Ogre",
        "ship_addr2": "",
        "ship_city": "Sidsilver",
        "ship_state": "NV",
        "ship_zip": "89701",
        "ship_cntry": "US",
        "bill_id": 3,
        "bill_fname": "Victor",
        "bill_lname": "Lamay",
        "bill_email": "noreply@miva.com",
        "bill_comp": "Fellowship of the sword",
        "bill_phone": "555-555-5555",
        "bill_fax": "",
        "bill_addr1": "Bear and Ogre",
        "bill_addr2": "",
        "bill_city": "Sidsilver",
        "bill_state": "NV",
        "bill_zip": "89701",
        "bill_cntry": "US",
        "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,
        "dt_created": 1623693375,
        "dt_login": 0,
        "dt_pwchg": 1623693375,
        "credit": 0.0,
        "formatted_credit": "$0.00",
        "business_title": "Test_Biz_B",
        "assigned": true
      }
    ]
  }
}

Error Responses#

Error Code Error Message Error Description
MER-PGR-JSN-00015 Coupon not found Coupon not found.