ACCOUNTS


API for browsing, adding, editing and deleting accounts.

URLs

Notes

When creating an account, following criteria are required:

References

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

Creation Example Using Minimum Required Fields (standard account)

{
  "Account": "1234567890",
  "AccountGroupId": 3,
  "AccountStatusType": "astProvisioned",
  "AccountType": "atStandard",
  "Balance": 10,
  "BillingType": "btDebit",
  "ClassOfService": {
    "CosId": 4,
    "PublicCos": true
  },
  "StartingBalance": 10,
  "WriteCdr": true
}

Creation Example Using Minimum Required Fields (MLM parent account)

{
  "Account": "1234567890",
  "AccountGroupId": 3,
  "AccountStatusType": "astProvisioned",
  "AccountType": "atMLMChild",
  "Balance": 10,
  "BillingType": "btDebit",
  "ClassOfService": {
    "CosId": 4,
    "PublicCos": true
  },
  "ParentAccount": "MLMParentAccount",
  "StartingBalance": 10,
  "WriteCdr": true
}

Account Object

{
  "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
  }

Table Definition

ACCOUNTS

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.