API GetProductInfo
Request parameters (JSON):
- tenant - (mandatory) - business tenant, e.g. "zegoal"
- product_id - (optional; default "") - Product ID (ID of Product in configuration)
- product_name - (optional; default "") - Product Name (name of Product in configuration); or can be used as part of name (see parameter search_exact_name)
- product_type - (optional; default "") - Product Type (dictionary: primary tariff)
- product_category - (optional; default "") - Product Category (dictionary: prepaid, postpaid, combined)
- search_exact_name - (optional; default true) - if set to true and product_name is provided, then search will use Product Name as is, as a full product name; if set to false and product_name is provided, then search will use provided Product Name as a sub-pattern of a name (e.g. product_name=art, search_exact_name=false - result will return products with names: start, fine_art, marten etc. where art is a part of the name)
- case_sensitive_name - (optional; default true) - if set to true and product_name is provided, then search will use Product Name as is, exactly with small/big letters as provided; if set to false and product_name is provided, then search will ignore small/big letters in Product Name and find all matches (e.g. product_name=art, case_sensitive_name=false and search_exact_name=false - result will return products with names: START, FineArt, MarTen etc. where art is found in all small/big letters combinations)
- return_prices - (optional; default false) - if set to true, also Product Prices will be returned; by default only Product Info (without Prices) is returned
Response parameters (JSON):
- GetProductInfo
- request
- "input" (request parameters) as is; only those parameters that were sent in input
- response
- <all request parameters> (filled with default values if were missing in input)
- products - list of found products
- [0..n]
- product_id - Product ID
- product_name - Product Name
- product_type - Product Type
- product_category - Product Category
- product_description- Product Description
- (if requested) prices - list of prices that correspond to thi particular product
- [0..m]
- ...
- [0..m]
- [0..n]
- request
Request example
{
"tenant": "zegoal",
"return_prices": true,
"product_id": 4
}
CODE
Response example
{
"processing_result": {
"text": "success",
"status": "ok",
"code": 0
},
"processing_date": "2019-09-03 18:27:49",
"GetProductInfo": {
"response": {
"tenant": "zegoal",
"search_exact_name": true,
"return_simplified_prices": true,
"return_prices": true,
"return_params": true,
"products": [ {
"product_type": "primary tariff",
"product_name": "PRO",
"product_id": 4,
"product_description": "Услуга ПРО",
"product_category": "combined",
"prices": [
{
"type": "RECURRING",
"subtype": "",
"size": 100,
"rate_mode": "CHARGING",
"override_allowed": true,
"multiplier_allowed": true,
"cost": -40,
"business_name": "PRO",
"balance": "Money_BYN"
},
{
"type": "RECURRING",
"subtype": "",
"size": 100,
"rate_mode": "CREDITING",
"override_allowed": true,
"multiplier_allowed": false,
"cost": 0,
"business_name": "PRO",
"balance": "TASKS"
},
{
"type": "CHARGE_ONETIMEFEE",
"subtype": "",
"size": 1,
"rate_mode": "CHARGING",
"override_allowed": false,
"multiplier_allowed": false,
"cost": 0,
"business_name": "DEDUCT_TASK",
"balance": "TASKS"
},
{
"type": "CHARGE_ONETIMEFEE",
"subtype": "",
"size": 1,
"rate_mode": "CHARGING",
"override_allowed": false,
"multiplier_allowed": false,
"cost": -1,
"business_name": "DEDUCT_USER_ADMIN",
"balance": "USERS"
},
{
"type": "CHARGE_ONETIMEFEE",
"subtype": "",
"size": 1,
"rate_mode": "CREDITING",
"override_allowed": false,
"multiplier_allowed": false,
"cost": 1,
"business_name": "ADD_USER_ADMIN",
"balance": "USERS"
},
{
"type": "CHARGE_ONETIMEFEE",
"subtype": "",
"size": 1,
"rate_mode": "CREDITING",
"override_allowed": false,
"multiplier_allowed": true,
"cost": 1,
"business_name": "GRANT_USER_ADMIN",
"balance": "USERS_LIMITS"
}
],
"params": [
{
"type": "number",
"name": "number_of_users_admin",
"default": 1
},
{
"type": "number",
"name": "price_of_user_admin",
"default": 40
},
{
"type": "number",
"name": "number_of_tasks",
"default": 0
},
{
"type": "boolean",
"name": "gps_tracking",
"default": true
},
{
"type": "number",
"name": "custom_forms",
"default": 10000
},
{
"type": "number",
"name": "data_storage",
"default": 500
},
{
"type": "boolean",
"name": "api_access",
"default": true
},
{
"type": "boolean",
"name": "order_access",
"default": true
}
]
}],
"product_type": "",
"product_name": "",
"product_id": 4,
"product_category": "",
"case_sensitive_name": true
},
"request": {
"tenant": "zegoal",
"return_prices": true,
"product_id": 4
}
}
}
CODE