API CreateAccount
Request parameters
- tenant - (mandatory) - to which tenant/system to connect, e.g. "zegoal"
- basic
- account_code - (mandatory) - Account External Code, e.g. Account ID in external system
- account_name - (mandatory) - Account Name
- account_type - (optional; default "Prepaid") - Account Type (e.g. Prepaid, Postpaid)
- account_category_code - (optional; default "regular") - Account Category code
- description - (optional; default "") - Description
- vip_code - (optional; default "") - VIP code
- lc_state - (optional; default "Trial") - Account LC state
- lc_from - (optional; default now()) - LC state valid from date
- payment_responsible - (optional; default 1) - if Account is payment responsible or not
- parent_id - (optional; default 0) - parent Account in hierarchy
- is_billed - (optional; default true) - if Invoices should be generated for this Account
- dealer_code - (optional; default "") - Dealer code
- noti_channel - (optional; default "tech_noti") - Notification Channel (e.g. tech_noti, e-mail, Viber, SMS)
- noti_user_id - (optional; default "") - User ID in case notification channel requires it
- billing
- bill_cycle_id - (optional; default 1) - Bill Cycle ID
- bill_distribution_code - (optional; default "e-mail") - Bill Distribution code
- bill_format_code - (optional; default "PDF") - Bill Format code (e.g. PDF, CSV, XML)
- curr_code - (optional; default "BYN") - Currency code (e.g. USD, UAH, RUB)
- lang_code - (optional; default "ru") - Language code (e.g. en, ua, ru)
- invoice_template_code - (optional; default "CUST") - Invoice Template code (e.g. CUST, ENT)
- tax_number - (optional; default "") - personal Tax Payer Number
- valid_from - (optional; default now()) - validity of Account Billing Profile
- valid_to - (optional; default "2050-01-01 00:00:00") - validity of Account Billing Profile
- contract
- contract_number - (optional; default "") - Contract Number
- contract_status - (optional; default "Signed") - Contract Status (e.g. Signed, Unsigned)
- signing_date - (optional; default now()) - Contract signing date
- contract_valid_from - (optional; default now()) - validity of the Contract
- contract_valid_to - (optional; default "2050-01-01 00:00:00") - validity of the Contract
- contract_description - (optional; default "")
- contact
- contact_name - (optional; default "") - Company Title
- contact_dept - (optional; default "") - Company Dept
- contact_email - (optional; default "") - contact e-mail
- contact_num - (optional; default "") - Mobile Phone number
- contact_desc - (optional; default "") - Fixed Line number
- address
- company_name - (optional; default "") - Company Name
- country_code - (optional; default "") - Country Code
- country - (optional; default "") - Country
- postal_code - (optional; default "") - Postal Code
- state - (optional; default "") - State
- region - (optional; default "") - Region
- city - (optional; default "") - City
- street - (optional; default "") - Street
- house - (optional; default "") - House
- extra_address_line - (optional; default "") - extra details, if required
Responce parameters
Example of Request
{
"tenant": "zegoal",
"basic": {
"account_code": "10001",
"account_name": "New Account",
"account_type": "Postpaid",
"description": "Account created from API (test)"
}
}
CODE
Example of Response:
{
"processing_result": {
"text": "Account created successfully",
"status": "ok",
"code": 0
},
"processing_date": "2019-03-27 23:52:06 +03:00",
"CreateAccount": {
"response": {
"tenant": "zegoal",
"contract": {
"signing_date": "2019-03-27 23:52:06",
"contract_valid_to": "2050-01-01 00:00:00",
"contract_valid_from": "2019-03-27 23:52:06",
"contract_status": "Signed",
"contract_number": "",
"contract_id": 3
},
"contact": {
"work_phone": "",
"noti_user_id": "",
"noti_channel": "tech_noti",
"mobile_phone": "",
"email": "",
"company_title": "",
"company_dept": ""
},
"billing": {
"valid_to": "2050-01-01 00:00:00",
"valid_from": "2019-03-27 23:52:06",
"tax_number": "",
"lang_code": "ru",
"invoice_template_code": "CUST",
"curr_code": "BYN",
"billing_profile_id": 4,
"bill_format_code": "PDF",
"bill_distribution_code": "e-mail",
"bill_cycle_id": 1
},
"basic": {
"vip_code": "",
"payment_responsible": 1,
"parent_id": 0,
"lc_state": "Trial",
"lc_from": "2019-03-27 23:52:06",
"is_billed": true,
"description": "Account created from API (test)",
"dealer_code": "",
"account_type": "Postpaid",
"account_name": "New Account test3",
"account_id": 4,
"account_code": "10003",
"account_category_code": "regular"
},
"address": {
"street": "",
"state": "",
"region": "",
"postal_code": "",
"house": "",
"extra_address_line": "",
"country_code": "",
"country": "",
"company_name": "",
"city": "",
"address_id": 4
}
},
"request": {
"tenant": "zegoal",
"basic": {
"description": "Account created from API (test)",
"account_type": "Postpaid",
"account_name": "New Account test3",
"account_code": "10003"
}
}
}
}
CODE
Example of Response with error
{
"processing_result": {
"text": "Account with code [10003] and name [New Account test3] already exists.",
"status": "error",
"code": 1
},
"processing_date": "2019-03-27 23:53:31 +03:00",
"CreateAccount": {
"response": false,
"request": {
"tenant": "zegoal",
"basic": {
"description": "Account created from API (test)",
"account_type": "Postpaid",
"account_name": "New Account test3",
"account_code": "10003"
}
}
}
}
CODE