API GetAccountInfo
Request parameters:
- tenant - (mandatory) - business tenant
- account_id - (conditional) - Account ID
- account_code - (conditional) - Account Code
- account_name - (conditional) - Account Name
- skip_lookup_account - (optional; default false) - is used only when account_id is provided; skips extra call to DB for Account verification
- return_address - (optional; default false) - whether to return Address(es) related to this Account, or not
- return_billing - (optional; default false) - whether to return Billing Profile details related to this Account, or not
- return_contacts - (optional; default false) - whether to return Contact(s) related to this Account, or not
- return_contracts - (optional; default false) - whether to return Contract(s) related to this Account, or not
- return_balances - (optional; default false) - whether to return Balance(s) that this Account has, or not
- return_lc - (optional; default false) - whether to return LC Progression list of this Account, or not
- return_products - (optional; default false) - whether to return Product(s) sold to this Account, or not
- return_payments - (optional; default false) - whether to return Payment(s) made by this Account, or not
- return_bank_info - (optional; default false) - whether to return Bank Info of this Account, or not
- return_triggers - (optional; default false) - whether to return Triggers of this Account, or not
- return_references - (optional; default false) - whether to return references of this Account, or not
- force_lookup - (optional, default false) - need to be used in case account is in Terminated state, otherwise "Account is not found" error will be thrown. Valid values are true and false
One of conditional parameters: account_id, or account_code, or account_name - is mandatory to be provided.
Response parameters:
All information about Account, Balances, Sold Products, Billing information.
Example of Request:
{
"tenant": "zegoal",
"account_id": "3",
"return_address": true,
"return_products": true,
"return_balances": true,
"return_contacts": true,
"return_contracts": true,
"return_bank_info": true,
"return_triggers": true,
"return_payments": true,
"return_lc": true,
"return_billing": true,
"return_address": true
}
CODE
Example of Response:
{
"processing_result": {
"text": "success",
"status": "ok",
"code": 0
},
"processing_date": "2019-11-19 12:59:10",
"GetAccountInfo": {
"response": {
"triggers": [ {
"sold_product_id": 411,
"product_id": 7,
"period": "yearly_1st_to_1st",
"initial_day": "2019-11-15 09:24:43",
"business_name": "LIGHT_YEAR",
"NTD": "2020-10-31 21:00:00"
}],
"tenant": "zegoal",
"sold_products": [ {
"sold_product_id": 411,
"rules": [
{
"sold_product_id": 411,
"rule": {
"type": "RECURRING",
"subtype": "",
"service": "LIGHT_YEAR",
"refund_on_product_deactivation": true,
"recurrent_obj": {
"periodic_operation": true,
"period": "yearly_1st_to_1st",
"affect_next_trigger": true
},
"rate_mode": "CHARGING",
"prorate": true,
"priority": 0,
"price_obj": [ {
"trigger_action": ["LIGHT_YEAR_yearly_tasks"],
"size": 100,
"priority": 0,
"overriden_cost": -15,
"original_cost": -192,
"multiplier": 7,
"init_size": 0,
"init_cost": 0,
"id": 1,
"cost": -105
}],
"price_id": 62,
"pocket_obj": {"use_pockets": "time_valid"},
"override": {
"depends_on_param": "price_of_user_admin",
"allowed": true
},
"offering_code": "LIGHT_YEAR",
"name": 62,
"multiplier": {
"depends_on_param": "number_of_users_admin",
"default": 1,
"allowed": true
},
"dependency": "",
"coverage": {"partial": false},
"consider_during_refund": true,
"code": "LIGHT_YEAR_yearly_payment_user_admin",
"business_name": "LIGHT_YEAR",
"balance_type": "Money_BYN",
"balance": ["Money_BYN"],
"auto_trigger_on_product_activation": true,
"allow_refund": true
},
"product_id": 7,
"price_id": 62,
"pd_offering_id": 7,
"overriden_value": -15,
"multiplier": 7,
"account": 3
},
{
"sold_product_id": 411,
"rule": {
"type": "RECURRING",
"subtype": "",
"service": "LIGHT_YEAR",
"recurrent_obj": {},
"rate_mode": "CREDITING",
"prorate": true,
"priority": 0,
"price_obj": [ {
"trigger_action": [],
"size": 100,
"priority": 0,
"overriden_cost": 1000,
"original_cost": 72000,
"multiplier": 1,
"init_size": 0,
"init_cost": 0,
"id": 1,
"cost": 1000
}],
"price_id": 63,
"pocket_obj": {
"use_pockets": "exact_datetime",
"spontaneous_pocket": true,
"pocket_validity": "yearly_1st_to_1st",
"pocket_label": "LIGHT_YEAR"
},
"override": {
"depends_on_param": "number_of_tasks",
"allowed": true
},
"offering_code": "LIGHT_YEAR",
"name": 63,
"multiplier": {"allowed": false},
"dependency": "LIGHT_YEAR_yearly_payment_user_admin",
"coverage": {"partial": false},
"code": "LIGHT_YEAR_yearly_tasks",
"business_name": "LIGHT_YEAR",
"balance_type": "TASKS",
"balance": ["TASKS"],
"amount_to_process": "full"
},
"product_id": 7,
"price_id": 63,
"pd_offering_id": 7,
"overriden_value": 1000,
"account": 3
},
{
"sold_product_id": 411,
"rule": {
"type": "CHARGE_ONETIMEFEE",
"subtype": "",
"service": "LIGHT_YEAR",
"refund_on_product_deactivation": true,
"rate_mode": "CREDITING",
"prorate": false,
"priority": 0,
"price_obj": [ {
"trigger_action": [],
"size": 1,
"priority": 0,
"overriden_cost": 1,
"original_cost": 1,
"multiplier": 7,
"init_size": 0,
"init_cost": 0,
"id": 1,
"cost": 7
}],
"price_id": 67,
"pocket_obj": {
"use_pockets": "exact_datetime",
"spontaneous_pocket": true,
"pocket_validity": "unlimited",
"pocket_label": "admin"
},
"override": {"allowed": false},
"offering_code": "LIGHT_YEAR",
"name": 67,
"multiplier": {
"depends_on_param": "number_of_users_admin",
"default": 1,
"allowed": true
},
"dependency": "",
"coverage": {"partial": false},
"consider_during_refund": true,
"code": "LIGHT_YEAR_GRANT_USER_ADMIN_LIMIT",
"business_name": "GRANT_USER_ADMIN",
"balance_type": "USERS_LIMITS",
"balance": ["USERS_LIMITS"],
"auto_trigger_on_product_activation": true,
"allow_refund": true
},
"product_id": 7,
"price_id": 67,
"pd_offering_id": 7,
"multiplier": 7,
"account": 3
}
],
"product_type": "primary tariff",
"product_name": "LIGHT_YEAR",
"product_id": 7,
"product_description": "Услуга Лайт (на год)",
"product_category": "combined",
"params": {
"price_of_user_admin": 192,
"number_of_users_admin": 1,
"number_of_tasks": 72000,
"gps_tracking": true,
"data_storage": 20,
"custom_forms": 5,
"api_access": true
},
"lc": [ {
"lc_to": "",
"lc_status": "ACT",
"lc_from": "2019-11-15 12:24:38"
}],
"id": 411,
"current_lc_status": "ACT",
"contract_num": "",
"contract_id": 0,
"account_id": 3
}],
"skip_lookup_account": false,
"return_triggers": true,
"return_products": true,
"return_payments": true,
"return_lc": true,
"return_devices": false,
"return_contracts": true,
"return_contacts": true,
"return_billing": true,
"return_bank_info": true,
"return_balances": true,
"return_address": true,
"processing_errors": {
"GetAccountTrigger": false,
"GetAccountProducts": false,
"GetAccountPayments": false,
"GetAccountLC": false,
"GetAccountContracts": false,
"GetAccountContacts": false,
"GetAccountBillingProfile": false,
"GetAccountBankInfo": false,
"GetAccountBalances": false,
"GetAccountAddress": false
},
"payments": [ {
"paym_target_id": "",
"paym_source_id": "cash",
"paym_ext_id": "123",
"paym_amt": "2000",
"effective_date": "2019-11-19 12:57:52",
"balance_name": "Money_BYN"
}],
"lc": [ {
"lc_to": "2019-11-25 16:16:39",
"lc_status": "Trial",
"lc_from": "2019-11-11 16:16:33",
"is_current": true
}],
"contracts": [ {
"signing_date": "2019-11-11 16:16:33",
"contract_valid_to": "2050-01-01 00:00:00",
"contract_valid_from": "2019-11-11 16:16:33",
"contract_status": "Signed",
"contract_number": "",
"contract_id": 3,
"contract_description": ""
}],
"contacts": [ {
"contact_type": "main_contact",
"contact_name": "a",
"contact_mobile_num": "1",
"contact_id": 3,
"contact_email": "",
"contact_desc": ""
}],
"billing": {
"valid_to": "2050-01-01 00:00:00",
"valid_from": "2019-11-11 16:16:33",
"tax_number": "",
"lang_code": "ru",
"invoice_template_code": "CUST",
"curr_code": "BYN",
"billing_profile_id": 3,
"bill_format_code": "PDF",
"bill_distribution_code": "e-mail",
"bill_cycle_id": 1
},
"basic": {
"vip_code": "",
"type_of_business": "undefined",
"subscriber_type": "undefined",
"subscriber_group": "undefined",
"payment_responsible": 1,
"parent_id": 0,
"ownership": "undefined",
"noti_user_id": "https://org1.zegoal.com/api/billing_notification/",
"noti_channel": "tech_noti",
"is_billed": true,
"description": "",
"dealer_code": "",
"current_lc_status": "Trial",
"account_type": "Postpaid",
"account_name": "ACC_Zegoal_1573478192261",
"account_id": 3,
"account_code": "1573478192261",
"account_category_code": "regular"
},
"bank_info": {
"company_tax_number": "",
"company_name": "",
"bank_name": "",
"bank_id": 3,
"bank_code": "",
"bank_account": "",
"account_id": 3
},
"balances": [
{
"pockets": [ {
"value": 1899.02,
"start": "",
"reserved": 0,
"label": "",
"end": ""
}],
"currently_available_total_value": 1899.02,
"conf": {
"view_precision": 2,
"use_pockets": "expires_first",
"use_as_dynamic_min": "",
"use_as_dynamic_max": "",
"priority": 0,
"pocket_grace_time": 0,
"name": "Money_BYN",
"min": 0,
"measure": "BYN",
"max": 999999999,
"is_paid": true,
"is_monetary": true,
"is_main": true,
"is_limit": false,
"id": 1,
"has_pockets": false,
"give_by_default": true,
"for_account_type": "",
"can_go_to_negative": true,
"calc_precision": 2,
"balance_type": "BYN",
"balance": "Money_BYN",
"auto_create": true
},
"balance_total": {
"value": 1899.02,
"reserved": 0
},
"balance_name": "Money_BYN",
"balance_id": 1
},
{
"pockets": [
{
"value": 0,
"start": "",
"reserved": 0,
"label": "",
"end": ""
},
{
"value": 962,
"start": "2019-11-01 03:00:00",
"reserved": 0,
"label": "LIGHT_YEAR",
"end": "2020-11-01 03:00:00"
}
],
"currently_available_total_value": 962,
"conf": {
"view_precision": 0,
"use_pockets": "expires_first",
"use_as_dynamic_min": "",
"use_as_dynamic_max": "",
"priority": 0,
"pocket_grace_time": 0,
"name": "TASKS",
"min": 0,
"measure": "CNT",
"max": 999999999,
"is_paid": false,
"is_monetary": false,
"is_main": false,
"is_limit": false,
"id": 2,
"has_pockets": true,
"give_by_default": true,
"for_account_type": "",
"can_go_to_negative": false,
"calc_precision": 0,
"balance_type": "CNT",
"balance": "TASKS",
"auto_create": true
},
"balance_total": {
"value": 962,
"reserved": 0
},
"balance_name": "TASKS",
"balance_id": 2
},
{
"pockets": [ {
"value": 0,
"start": "",
"reserved": 0,
"label": "",
"end": ""
}],
"currently_available_total_value": 0,
"conf": {
"view_precision": 0,
"use_pockets": "expires_first",
"use_as_dynamic_min": "",
"use_as_dynamic_max": "USERS_LIMITS",
"priority": 0,
"pocket_grace_time": 0,
"name": "USERS",
"min": 0,
"measure": "CNT",
"max": 999999999,
"is_paid": false,
"is_monetary": false,
"is_main": false,
"is_limit": false,
"id": 3,
"has_pockets": true,
"give_by_default": true,
"for_account_type": "",
"can_go_to_negative": false,
"calc_precision": 0,
"balance_type": "CNT",
"balance": "USERS",
"auto_create": true
},
"balance_total": {
"value": 0,
"reserved": 0
},
"balance_name": "USERS",
"balance_id": 3
},
{
"pockets": [
{
"value": 0,
"start": "",
"reserved": 0,
"label": "",
"end": ""
},
{
"value": 7,
"start": "",
"reserved": 0,
"label": "admin",
"end": ""
}
],
"currently_available_total_value": 7,
"conf": {
"view_precision": 0,
"use_pockets": "expires_first",
"use_as_dynamic_min": "",
"use_as_dynamic_max": "",
"priority": 0,
"pocket_grace_time": 0,
"name": "USERS_LIMITS",
"min": 0,
"measure": "CNT",
"max": 999999999,
"is_paid": false,
"is_monetary": false,
"is_main": false,
"is_limit": true,
"id": 4,
"has_pockets": true,
"give_by_default": true,
"for_account_type": "",
"consider_pockets": true,
"can_go_to_negative": false,
"calc_precision": 0,
"balance_type": "CNT",
"balance": "USERS_LIMITS",
"auto_create": true
},
"balance_total": {
"value": 7,
"reserved": 0
},
"balance_name": "USERS_LIMITS",
"balance_id": 4
}
],
"address": [ {
"street": "",
"state": "",
"region": "",
"postal_code": "",
"house": "",
"extra_address_line": "",
"country_code": "",
"country": "",
"city": "",
"address_type": "main_address",
"address_id": 6
}],
"account_name": "ACC_Zegoal_1573478192261",
"account_id": 3,
"account_code": "1573478192261",
"TZ": "Europe/Minsk"
},
"request": {
"tenant": "zegoal",
"return_triggers": true,
"return_products": true,
"return_payments": true,
"return_lc": true,
"return_contracts": true,
"return_contacts": true,
"return_billing": true,
"return_bank_info": true,
"return_balances": true,
"return_address": true,
"account_id": "3"
}
}
}
CODE
Example of Response with error
{
"processing_result": {
"text": "Subscriber not found",
"status": "error",
"code": 1
},
"processing_date": "2019-02-13 11:36:43 +00:00",
"GetAccountInfo": {
"response": "false",
"request": {
"tenant": "taskvizor",
"acc_id": "554"
}
}
}
CODE