Skip to content

ProductAndSubscriptionTermList_Load_Query#


Description#

This function loads a list of product subscription terms for a specific product.

Request 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
success Boolean Boolean value indicating if the api request was successful
total_count Number the number of subscription terms returned for the product
start_offset Number the offset starting point for pagination of return data
id Number Product id of the item
code String Product code of the item
sku String Product sku of the item
name String Product name of the item
thumbnail String filepath name of the product thumbnail image
image String filepath name of the product image
price Number Subscription total price
formatted_price String Currency formatted subscription price
cost Number Product cost of the item
formatted_cost String Currency formatted product cost
weight Number Product weight of the item
taxable Boolean Boolean value indicating if the item is taxable
active Boolean Boolean value indicating if the product is active
page_title String The title of the product page
dt_created Number Unix timestamp for the product creation date
dt_Updated Number Unix timestamp for the product update date
term_id Number subscription term id for the subscription terms
term_frequency String The frequency of the subscription fulfillment
term_term Number Number of subscription terms for the specific term
term_descrip String description of the term subscription frequency
term_n Number Number of days or Months between each fulfillment. Only set if using Subscription Terms
term_fixed_dow Number Number indicating a fixed day of the week for term weekly subscription fulfillment
term_fixed_dom Number Number indicating a fixed day of the month for term monthly subscription fulfillment
term_sub_count Number Term subscription count

Example Request#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "ProductAndSubscriptionTermList_Load_Query",
    "Filter": [
        {
            "name": "search",
            "value": [
                {
                    "field": "code",
                    "operator": "CO",
                    "value": "coffee"
                }
            ]
        }
    ],
    "Sort": "disp_order",
    "Offset": 0,
    "Count": 18
}

Example Response#

{
    "success": 1,
    "data": {
        "total_count": 3,
        "start_offset": 0,
        "data": [
            {
                "id": 9,
                "code": "coffee",
                "sku": "coffee_100",
                "name": "Coffee",
                "thumbnail": "graphics/00000001/coffee.jpg",
                "image": "",
                "price": 20.0,
                "formatted_price": "$20.00",
                "cost": 10.0,
                "formatted_cost": "$10.00",
                "weight": 1.0,
                "taxable": true,
                "active": true,
                "page_title": "",
                "dt_created": 1647039826,
                "dt_Updated": 1647049804,
                "term_id": 1,
                "term_frequency": "biweekly",
                "term_term": 0,
                "term_descrip": "Reorder bi-weekly",
                "term_n": 0,
                "term_fixed_dow": 0,
                "term_fixed_dom": 0,
                "term_sub_count": 4
            },
            {
                "id": 9,
                "code": "coffee",
                "sku": "coffee_100",
                "name": "Coffee",
                "thumbnail": "graphics/00000001/coffee.jpg",
                "image": "",
                "price": 20.0,
                "formatted_price": "$20.00",
                "cost": 10.0,
                "formatted_cost": "$10.00",
                "weight": 1.0,
                "taxable": true,
                "active": true,
                "page_title": "",
                "dt_created": 1647039826,
                "dt_Updated": 1647049804,
                "term_id": 2,
                "term_frequency": "monthly",
                "term_term": 0,
                "term_descrip": "Reorder every month",
                "term_n": 0,
                "term_fixed_dow": 0,
                "term_fixed_dom": 0,
                "term_sub_count": 1
            },
            {
                "id": 9,
                "code": "coffee",
                "sku": "coffee_100",
                "name": "Coffee",
                "thumbnail": "graphics/00000001/coffee.jpg",
                "image": "",
                "price": 20.0,
                "formatted_price": "$20.00",
                "cost": 10.0,
                "formatted_cost": "$10.00",
                "weight": 1.0,
                "taxable": true,
                "active": true,
                "page_title": "",
                "dt_created": 1647039826,
                "dt_Updated": 1647049804,
                "term_id": 3,
                "term_frequency": "n",
                "term_term": 0,
                "term_descrip": "Reorder every 60 days",
                "term_n": 60,
                "term_fixed_dow": 0,
                "term_fixed_dom": 0,
                "term_sub_count": 0
            }
        ]
    }
}