CouponList_Load_Query
#
Description#
This function allows you to load one or more coupons from Miva.
Search Filter Columns#
Column |
Description |
---|---|
id |
|
code |
|
descrip |
|
custscope |
|
dt_start |
|
dt_end |
|
max_use |
|
max_per |
|
active |
|
use_count |
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 |
|
code |
|
descrip |
|
custscope |
|
dt_start |
|
dt_end |
|
max_use |
|
max_per |
|
active |
|
use_count |
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": "beta",
"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
}
]
}
}