Create a customer
Это содержимое пока не доступно на вашем языке.
createCustomer creates a customer that belongs to the authenticated customer, the same as Add Reseller in the panel. The parameters below are also the fields that getCustomerInfo returns and updateCustomer changes.
The method supports trusted mode with i_wholesaler, the ID of the customer that will own the new one.
To call it, the authenticated customer needs the right to add customers (bit 1 of its customers_mgmt) and a Max. Resellers Depth above 0.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Reseller Name. Unique on the switch |
web_password |
string | yes | Web Password of the customer’s default web user. Must satisfy the password policy (i_password_policy) |
i_tariff |
int | yes | Tariff: an outgoing tariff you own. Its currency becomes the customer’s base currency, which never changes. None assigns your own tariff (- MY TARIFF -) and your base currency; allowed only when your use_own_tariff is on |
web_login |
string | no | Web Login of the default web user. Unique on the switch. Default: name |
i_time_zone |
int | no | Time Zone of the web user. Default: yours. See Time zones |
i_lang |
string | no | Language of the panel, a two-letter code. Default en |
i_export_type |
int | no | Download Format for CDR downloads, from the export_types dictionary. Default 2 |
start_page |
int | no | Start Page: 1 My CDRs, 3 Call Records (CDRs), 4 My Preferences (default) |
description |
string | no | Description, shown under the name in the list |
balance |
double | no | Opening Balance, 0 or more. A positive value is recorded as a payment with the note Initial balance and is checked against overcommit protection |
credit_limit |
double | no | Credit Limit, 0 or more. Default 0 |
Limits and routing
Section titled “Limits and routing”| Name | Type | Required | Description |
|---|---|---|---|
i_routing_group |
int | no | Routing Group. The root customer can give any routing group and gets the first one by default. Other customers can give only one of their extended routing groups; by default the new customer inherits yours |
accounts_matching_rule |
string | no | Acct. Matching Rule: regular expressions, separated by ;, that the names of the customer’s accounts must match |
max_depth |
int | no | Max. Resellers Depth: how many levels of sub-customers the customer may create. Less than yours; default yours minus 1. Fixed after creation |
max_sessions |
int | no | Max Sessions, above 0. None (default) means unlimited |
max_calls_per_second |
double | no | Max Calls Per Second, above 0. None (default) means unlimited |
overcommit_protection |
boolean | no | Overcommit Protection. Default False |
overcommit_limit |
double | no | Overcommit Limit, %, in percent. Default 10 |
You cannot set overcommit_protection or overcommit_limit when a customer above you has overcommit protection on.
Rights
Section titled “Rights”accounts_mgmt, customers_mgmt, tariffs_mgmt and vouchers_mgmt are bitmasks: 1 add, 2 edit, 4 delete. 7 grants all three.
| Name | Type | Required | Description |
|---|---|---|---|
accounts_mgmt |
int | no | Rights on accounts. Default: yours |
customers_mgmt |
int | no | Rights on sub-customers. Default: yours |
tariffs_mgmt |
int | no | Rights on tariffs. Default: yours |
vouchers_mgmt |
int | no | Rights on vouchers. Default 0 |
system_mgmt |
int | no | System management rights. Default 0. Only when you have system management rights yourself |
use_own_tariff |
int | no | 1 lets the customer assign its own tariff to its sub-customers. Default 0 |
api_access |
int | no | 1 turns on Allow API Calls. Default 0. Only when you have API management rights |
api_password |
string | no | API Password. Only when you have API management rights. Must satisfy the password policy |
api_mgmt |
int | no | 1 lets the customer manage the API access of its own sub-customers. Default 0 |
i_password_policy |
int | no | Password Policy: a system policy or one of yours. Default 1 |
Features
Section titled “Features”Each flag can be set only when you have the feature yourself; otherwise the call fails.
| Name | Type | Required | Description |
|---|---|---|---|
callshop_enabled |
boolean | no | Callshop Enabled. Default False |
did_pool_enabled |
boolean | no | DID pool. Default False |
ivr_apps_enabled |
boolean | no | IVR applications. Default False |
asr_acd_enabled |
boolean | no | ASR/ACD reports. Default False |
debit_credit_cards_enabled |
boolean | no | Saving debit and credit cards. Default True |
conferencing_enabled |
boolean | no | Conferencing. Default True |
share_payment_processors |
boolean | no | Lets the customer share its payment processors. Default False |
dncl_enabled |
boolean | no | DNCL enabled: check calls against the Do-Not-Call list. Default True |
dns_alias |
string | no | DNS Alias of the customer’s branded panel (Reseller Mods). Unique on the switch |
css |
string | no | CSS of the branded panel |
Commission and payments
Section titled “Commission and payments”| Name | Type | Required | Description |
|---|---|---|---|
i_commission_agent |
int | no | Commission Agent: i_customer of another customer with the same base currency. None for none |
commission_size |
double | no | Commission Size, %, in percent, 0 or more |
payment_currency |
string | no | Payment Currency, ISO 4217. Default: the base currency |
payment_method |
int | no | Preferred Method: ID of a card type. Default 1 |
min_payment_amount |
double | no | Min. Amount of an online payment, 0 or more. Default 0 |
mail_from |
string | no | Mail “From” Header of e-mails sent to the customer |
Address and contact
Section titled “Address and contact”All strings, all optional, empty by default.
| Name | Type | Required | Description |
|---|---|---|---|
company_name |
string | no | Company Name |
salutation |
string | no | Mr./Ms… |
first_name |
string | no | First Name |
mid_init |
string | no | M.I. |
last_name |
string | no | Last Name |
street_addr |
string | no | Address |
city |
string | no | City |
state |
string | no | Province/State |
postal_code |
string | no | Postal Code |
country |
string | no | Country/Region |
contact |
string | no | Contact |
phone |
string | no | Phone |
fax |
string | no | Fax |
alt_phone |
string | no | Alt. Phone |
alt_contact |
string | no | Alt. Contact |
email |
string | no | E-Mail. Must be a valid address |
cc |
string | no | CC: a list of e-mail addresses |
bcc |
string | no | BCC: a list of e-mail addresses |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
i_customer |
int | ID of the new customer |
Example
Section titled “Example”call("createCustomer", { "name": "Acme Telecom", "web_login": "acme-web", "web_password": "Lp7-vQ2-xR9", "i_tariff": 12, "credit_limit": 500.0, "max_sessions": 30, "email": "billing@acme.example",}){"result": "OK", "i_customer": 3}Errors
Section titled “Errors”| faultCode | faultString | Cause |
|---|---|---|
401 |
You do not have permissions to use this API call. |
You have no right to add customers, or your Max. Resellers Depth is 0 |
410 |
Parameter name is required |
name, web_password or i_tariff is missing; the message names the parameter |
400 |
Wrong i_tariff parameter. |
The tariff is not an outgoing tariff of yours, or None without use_own_tariff |
400 |
Another customer with conflicting name already exists. |
The name is taken. The same message names web_login or dns_alias when those are taken |
400 |
You do not have permissions to set api_password parameter. |
You set a parameter your own rights do not allow; the message names it |
400 |
Wrong max_depth parameter. |
A value is out of range; the message names the parameter |
410 |
Overcommit limit exceeded |
The opening balance exceeds what overcommit protection allows |
Related
Section titled “Related”- Customers: the same fields in the panel
- Get customer information
- Update a customer
- Delete a customer
- Refund a customer: change the balance later