Get any customer (root)
Цей контент ще не доступний вашою мовою.
getRootCustomerInfo returns every attribute of a customer, like getCustomerInfo, but for any customer of the switch: a sub-customer of a reseller at any depth, or the root customer itself. Use it in the operator’s own tools that need to look at the whole customer tree.
Only the root customer may call it. The method reads from the database replica, so a change made a moment ago may show up a few seconds later.
Compared with getCustomerInfo
Section titled “Compared with getCustomerInfo”getCustomerInfo |
getRootCustomerInfo |
|
|---|---|---|
| Who may call it | Any customer | The root customer only |
| Customers it finds | Direct sub-customers of the caller | Any customer, at any depth, including the root customer (i_customer 1) |
| Returned fields | The customer’s attributes, balance, credit_limit |
The same, plus i_balance. With include_balance set to False, without balance and credit_limit |
Sign of balance |
Opposite to the panel | Opposite to the panel, the same as getCustomerInfo |
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_customer |
int | one of | ID of the customer. 1 is the root customer |
name |
string | one of | Name of the customer. Send either i_customer or name, not both |
include_balance |
boolean | no | False skips the balance lookup and returns no balance and credit_limit, which is faster. Default True |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
customer |
struct | The customer’s attributes, as in getCustomerInfo: the parameters of createCustomer, plus i_customer, i_wholesaler (the owning customer), i_balance, and balance and credit_limit when include_balance is True |
Password fields such as web_password and api_password are not returned. Dates come back as strings in UTC. overcommit_limit and commission_size are percentages, for example 15.0.
Example
Section titled “Example”call("getRootCustomerInfo", {"name": "Acme Telecom"}){ "result": "OK", "customer": { "i_customer": 14, "i_wholesaler": 3, "name": "Acme Telecom", "web_login": "acme-web", "base_currency": "USD", "email": "billing@acme.example", "i_balance": 2210, "balance": -150.0, "credit_limit": 500.0, "overcommit_limit": 10.0, # … the other createCustomer fields },}Errors
Section titled “Errors”| faultCode | faultString | Cause |
|---|---|---|
400 |
Specify either i_customer or name. |
Both i_customer and name were sent |
400 |
Either of i_customer or name is required. |
Neither was sent |
400 |
i_customer must be an integer. |
i_customer is not a number |
401 |
You do not have permissions to use this API call. |
The authenticated customer is not the root customer |
404 |
Customer not found. |
No customer with this ID or name |
500 |
The balance could not be read. Retry, or call with include_balance set to False |
Related
Section titled “Related”- Get customer information:
getCustomerInfo - Customers: the same fields in the panel
- List customers
- Update customers