API for browsing, adding, editing and deleting accounts.
GET /accounts/{LookupValue}
?LookupType={LookupType}
Returns Account object for the specified LookupValue
and LookupType
.
See the Account Object.
If LookupType
is not specified, then LookupValue
is assumed be an account number (if quoted) and an Account ID if not quoted.
Valid values for LookupType
:
GET /accounts
Return a list of accounts in tabular format.
GET /accounts/{Account or Id}/exists
Returns 200 OK if the specified account exists, otherwise returns 404 NOT FOUND.
GET /accounts/{Id}/billinghistory?StartDate={StartDate}
&EndDate={EndDate}
Returns billing history CDRs in tabular format for the specified date range.
For date range formats, see Date & Time Values in URL Parameters.
GET /accounts/{Id}/callsessionlog
Returns call session log in tabular format for the specified date range.
For date range formats, see Date & Time Values in URL Parameters.
POST /accounts
Adds a new, single account.
See the Account Object.
POST /accounts/generate
Generate a batch of accounts.
Please see Batch Management for more information.
PUT /accounts
Update an existing account.
See the Account Object.
POST /accounts/{Account}/applycredit
Updates the specified account's balance, available credit and/or packaged balances.
See Account Balance Updates (Top Ups).
DELETE /accounts/{Id}
Delete the specified account.
When creating an account, following criteria are required:
The Account
field must must contain a unique account that you wish to create.
If you specify an AccountGroupId
of zero (0) and populate the AccountGroup
field, then the system will add a new Account Group with this name, otherwise it will validate that an existing Account Group with this ID exists.
If you specify a ClassOfService.COSId
of zero (0) and populate the rest of the values in the ClassOfService
object, then the system will add a ‘local’ or ‘private’ Class of Service specific to this account, otherwise it will validate that an existing Class of Service with this ID exists.
If you specify a Customer.CustomerId
of zero (0) and populate the rest of the values in the Customer
object, then the system will add a local (private) Customer specific to this account, otherwise it will validate that an existing Customer with this ID exists.
The Id of the newly created account will be returned in the AccountId
field (see Creating A Resource).
Account Balance Updates (Top Ups)
Account Groups API
Class of Service API
Customers API
Looking up a Resource (single objects, lists and tabular data)
Creating a Resource
Updating a Resource
Deleting a Resource
{
"Account": "1234567890",
"AccountGroupId": 3,
"AccountStatusType": "astProvisioned",
"AccountType": "atStandard",
"Balance": 10,
"BillingType": "btDebit",
"ClassOfService": {
"CosId": 4,
"PublicCos": true
},
"StartingBalance": 10,
"WriteCdr": true
}
{
"Account": "1234567890",
"AccountGroupId": 3,
"AccountStatusType": "astProvisioned",
"AccountType": "atMLMChild",
"Balance": 10,
"BillingType": "btDebit",
"ClassOfService": {
"CosId": 4,
"PublicCos": true
},
"ParentAccount": "MLMParentAccount",
"StartingBalance": 10,
"WriteCdr": true
}
{
"status": "success",
"message": "",
"data": {
"Account": "500",
"AccountGroup": "",
"AccountGroupId": 1,
"AccountId": 1,
"AccountStatusType": "astActive",
"AccountType": "atMLMParent",
"ActivationDateTime": "",
"Balance": 316.8,
"Batch": "",
"BatchId": 0,
"BillingType": "btDebit",
"CallbackNumber": "",
"CallsToDate": 0,
"ClassOfService": {
"CosId": 1,
"Cos": "500",
"Options": "",
"OptionsArray":
[
"MENU",
"ALIAS",
"RECHARGE",
"STATS_PACKAGED_INCLUDED",
"NB"
],
"ExpireDate": "2011-10-28",
"GmtOffset": 0,
"CurrencyId": 0,
"Currency": "",
"LanguageId": 0,
"Language": "",
"RateScheduleId": 1,
"RateSchedule": "",
"SalesGroupId": 1,
"SalesGroup": "",
"TaxGroupId": 0,
"TaxGroup": "",
"PublicCos": false
},
"CreationDateTime": "2010-10-28T05:00:59",
"CreditLimit": 0,
"Customer": {
"CustomerId": 40034,
"Customer": "500",
"FirstName": "First 2",
"LastName": "",
"Company": "",
"Address1": "",
"Address2": "",
"City": "",
"StateRegion": "",
"PostalCode": "",
"Country": "",
"LocalPhone": "",
"Fax": "",
"EMail": "",
"DateOfBirth": "",
"SignupDate": "",
"LoginName": "",
"LoginPassword": "",
"CCNumber": "",
"CCExpireDate": "",
"CCVCode": "",
"CCName": "",
"CCAddress1": "",
"CCAddress2": "",
"CCCity": "",
"CCStateRegion": "",
"CCCountry": "",
"CCPostalCode": "",
"Notes": "",
"User1": "1",
"User2": "",
"User3": "",
"User4": "",
"User5": "",
"User6": "",
"User7": "",
"User8": "",
"User9": "",
"User10": "",
"PublicCustomer": false
},
"FirstAuthenticatedDateTime": "2011-10-22T02:09:12",
"LastAuthenticatedDateTime": "2011-10-25T15:02:17",
"LastCallDateTime": "",
"LastCalledParty": "",
"LastCaller": "13107771000",
"LastCreditDateTime": "2016-08-31T17:16:33",
"LastDebitDateTime": "",
"LastRechargeDateTime": "",
"LastStatusUpdateDateTime": "",
"LastTransferDateTime": "",
"MinutesToDateActual": 0,
"MinutesToDateBilled": 0,
"PackagedBalances":
[
75,
143,
215,
286,
358
],
"ParentAccountId": 0,
"ParentAccount": "",
"PeriodCallsToDate": 0,
"PeriodLastResetDateTime": "",
"PeriodMinutesToDateActual": 0,
"PeriodMinutesToDateBilled": 0,
"Pin": "",
"Reference": "",
"SequenceNumber": 0,
"ServiceChargeDate": "",
"StartingBalance": 100,
"StartingPackagedBalances":
[
0,
0,
0,
0,
0
],
"WriteCdr": true
}
This table stores account information for subscribers, whether they are individual or parent accounts (billing accounts for a group of individual accounts). Account settings for this table are set and stored on a global or local basis in the ‘Class of Service’ table. Account credit and current balances are stored in this table. Customer detail information such as names and addresses are stored in the ‘Customer’ table and can permit a one-to-many relationship between customer information and account details.
Field Name | Type | Size | Description |
---|---|---|---|
ACCOUNT_ID | bigint | 8 | Primary key. |
ACCOUNT | varchar | 40 | The primary means of identifying a subscriber for authentication and billing purposes. This field is equivalent to the “User Name” requested by various authentication mechanisms. This is the value the subscriber is required to enter when making calls. |
PIN | varchar | 20 | Personal Identification Number. A secondary means of identifying a subscriber for authentication purposes. The subscriber may be required to enter this value in addition to the Account value. |
CUSTOMER_ID | bigint | 8 | Foreign key into CUSTOMERS table that references customer information associated with this account. |
PARENT_ACCOUNT_ID | bigint | 8 | Foreign key into this table (ACCOUNTS) that references the Parent account associated with this child account. |
BATCH_ID | smallint | 2 | Foreign key into BATCHES table that references the Batch associated with this account. |
SEQUENCE_NUMBER | int | 4 | Sequence number created during batch account generation. Not modifiable. |
ACCOUNT_GROUP_ID | smallint | 2 | Foreign key into ACCOUNT_GROUPS table that references the account group to which this account belongs. |
ACCOUNT_TYPE | tinyint | 1 | Account Type Id to denote type of Account from ACCOUNT_TYPES table (i.e. “Standard”, “Parent (MLM)”, “Child (MLM)”, etc.). |
CALLBACK_NUMBER | varchar | 40 | Callback number for International Callback. |
ACCOUNT_STATUS_TYPE | tinyint | 1 | Status of the account (See ACCOUNT_STATUS_TYPES table) |
BILLING_TYPE | tinyint | 1 | Billing type Id to denote billing model from BILLING_TYPES table (i.e. “Debit”, “Limited Credit”, “Unlimited Credit”) |
CREATION_DATE_TIME | datetime | 8 | UTC date and time this account was generated/created in the database. |
FIRST_AUTHENTICATED_DATE_TIME | datetime | 8 | UTC date and time account was first authenticated. |
ACTIVATION_DATE_TIME | datetime | 8 | UTC date and time account was first activated for use. NULL if account hasn’t been used yet. |
STARTING_BALANCE | decimal | (15,4) | Balance the account started with when first created. |
CREDIT_LIMIT | decimal | (15,4) | Credit limit. Only applies to post-paid accounts (i.e. BILLING_TYPE of 1 (Limited Credit) or 2 (Unlimited Credit). |
BALANCE | decimal | (15,4) | Current balance of user’s account. For pre-paid accounts the balance will be positive. For post-paid accounts, it will typically be negative (unless the user has a positive balance). |
PACKAGED_BALANCE1 | int | 4 | Current packaged balance 1 (in seconds). |
PACKAGED_BALANCE2 | int | 4 | Current packaged balance 2 (in seconds). |
PACKAGED_BALANCE3 | int | 4 | Current packaged balance 3 (in seconds). |
PACKAGED_BALANCE4 | int | 4 | Current packaged balance 4 (in seconds). |
PACKAGED_BALANCE5 | int | 4 | Current packaged balance 5 (in seconds). |
STARTING_PACKAGED_BALANCE1 | int | 4 | Packaged balance 1 of the account (in seconds) when first created. |
STARTING_PACKAGED_BALANCE2 | int | 4 | Packaged balance 2 of the account (in seconds) when first created. |
STARTING_PACKAGED_BALANCE3 | int | 4 | Packaged balance 3 of the account (in seconds) when first created. |
STARTING_PACKAGED_BALANCE4 | int | 4 | Packaged balance 4 of the account (in seconds) when first created. |
STARTING_PACKAGED_BALANCE5 | int | 4 | Packaged balance 5 of the account (in seconds) when first created. |
SERVICE_CHARGE_DATE | smalldatetime | 4 | Date and time account was last updated by the Service Charge Agent. |
COS_ID | bigint | 4 | Foreign key into CLASS_OF_SERVICE table, which contains the rate plan, expiration date, account options, and other information associated with this account. |
WRITE_CDR | bit | 4 | This field determines whether the system will write billing records for this account when Parent/Child billing is being used. Enabled = 1. |
SERVICE_CHARGE_STATUS | bit | 4 | Used by the Service Charge Agent after running to determine whether this account was updated. This lets the Service Charge Agent know which accounts need their SERVICE_CHARGE_DATE updated. |
CALLS_TO_DATE | int | 4 | Number of calls placed on this account to date. |
LAST_CALL_DATE_TIME | datetime | 4 | UTC date/time of the last successful call |
MINUTES_TO_DATE_BILLED | decimal | (15,4) | Number of minutes billed to this account to date. |
MINUTES_TO_DATE_ACTUAL | decimal | (15,4) | Number of actual minutes used by this account to date. |
LAST_CALLER | varchar | 40 | ANI of last caller that accessed this account to place a successful call. |
LAST_CALLED_PARTY | varchar | 40 | Number of last party called. |
LAST_CREDIT_DATE_TIME | datetime | 8 | UTC date/time of last credit applied to this account. |
LAST_DEBIT_DATE_TIME | datetime | 8 | UTC date/time of last debit/charge applied to this account. |
LAST_RECHARGE_DATE_TIME | datetime | 8 | UTC date/time of last credit card recharge applied to this account. |
LAST_TRANSFER_DATE_TIME | datetime | 8 | UTC date/time of last balance transfer (e.g. via the Voucher Module) applied to this account. |
LAST_STATUS_UPDATE_DATE_TIME | datetime | 8 | UTC date/time when this ACCOUNT_STATUS_TYPE column had last been updated. |
LAST_AUTHENTICATED_DATE_TIME | datetime | 8 | UTC date/time when this account had last been successfully authenticated. |
PERIOD_CALLS_TO_DATE | int | 8 | Used to track the number of calls this account has made since the last time the period statistics were reset. |
PERIOD_MINUTES_TO_DATE_BILLED | decimal | (15,4) | Used to track the number of billed minutes this account has made since the last time the period statistics were reset. |
PERIOD_MINUTES_TO_DATE_ACTUAL | decimal | (15,4) | Used to track the number of actual minutes this account has made since the last time the period statistics were reset. |
PERIOD_LAST_RESET_DATE_TIME | datetime | 8 | UTC date/time when this account had its period statistics last reset. |