Skip to content

CouponList_Load_Query

Here is the completed description column for the CouponList_Load_Query function:


Description#

This function allows you to load one or more coupons from Miva.

Search Filter Columns#

Column
Description
id The unique identifier of the coupon.
code The code associated with the coupon, used for applying discounts during checkout.
descrip The name of the coupon.
custscope Specifies the customer scope for the price group: C = Coupon Only, X = Specific Customers, L = All Logged-in Customers, A = All Shoppers.
dt_start The UNIX timestamp start date and time when the coupon becomes valid.
dt_end The UNIX timestamp end date and time when the coupon expires.
max_use The maximum number of times the coupon can be used across all customers.
max_per The maximum number of times the coupon can be used per customer.
active Indicates whether the coupon is active (true or false).
use_count The current number of times the coupon has been used.

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.

Column
Description
id The unique identifier of the coupon.
code The code associated with the coupon, used for applying discounts during checkout.
descrip The description of the coupon, providing details about the discount or offer.
custscope Specifies the customer scope for the price group: C = Coupon Only, X = Specific Customers, L = All Logged-in Customers, A = All Shoppers.
dt_start The UNIX timestamp start date and time when the coupon becomes valid.
dt_end The UNIX timestamp end date and time when the coupon expires.
max_use The maximum number of times the coupon can be used across all customers.
max_per The maximum number of times the coupon can be used per customer.
active Indicates whether the coupon is active (true or false).
use_count The current number of times the coupon has been used.

Request Body Parameters#

Parameter
Type Description
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 Product Count - total_count is the total number of records that match your search criteria. Note: this is not always the total coupons returned. Based on the Count and Offset parameters passed, the number of records returned could be different than the total_count.
start_offset Number Start Offset - Number number of the starting offset number of coupons to return. Used in conjunction with the Count parameter for paginating results of large datasets.
id Number Coupon Id
code String Coupon Code
descrip String Coupon Description
custscope String Customer Scope - One of “A” (all shoppers), “X” (specific customers), or “L” (all logged-in shoppers)
dt_start Unix Timestamp DateTime Start - 0 if no start time
dt_end Unix Timestamp Date Time End - 0 if no end time
max_use Number Max Use - 0 = unlimited
max_per Number Max use per customer - 0 = unlimited
active Boolean Active
use_count Number Usage Count - Coupon Usage Count

Example Request#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "CouponList_Load_Query",
    "Count": 3,
    "Offset": 0,
    "Filter": [
        {
            "name": "search",
            "value": [
                {
                    "field": "active",
                    "operator": "EQ",
                    "value": true
                }
            ]
        }
    ]
}

Example Response#

{
    "success": 1,
    "data": {
        "total_count": 17,
        "start_offset": 0,
        "data": [
            {
                "id": 4,
                "code": "test0CLSBP9Q",
                "descrip": "Test",
                "custscope": "A",
                "dt_start": 0,
                "dt_end": 0,
                "max_use": 1,
                "max_per": 1,
                "active": true,
                "use_count": 0
            },
            {
                "id": 5,
                "code": "test290S0J97",
                "descrip": "Test",
                "custscope": "A",
                "dt_start": 0,
                "dt_end": 0,
                "max_use": 1,
                "max_per": 1,
                "active": true,
                "use_count": 0
            },
            {
                "id": 6,
                "code": "testD53RFPV4",
                "descrip": "Test",
                "custscope": "A",
                "dt_start": 0,
                "dt_end": 0,
                "max_use": 1,
                "max_per": 1,
                "active": true,
                "use_count": 0
            }
        ]
    }
}