Cornerstone API Database / App - Reference

Modified on Tue, 17 Nov at 5:12 PM

Overview

This guide is a complete reference for the Cornerstone Database API — a REST-based service that allows direct interaction with the Cornerstone data tables. It is intended for developers and integration partners who need to import or retrieve customer, billing, and recurring revenue data, add correspondence and support entries, or read the validated lookup lists that imports depend on. For a full PDF copy of the API Reference please scroll to the bottom of the article.

The service (service name database) offers 38 methods across the following functional groups:

  • Getting Started — base URL, authentication, test mode, account matching, response conventions, and the full method index
  • Data Import — customers, recurring charges, contracts, contacts, invoices, and credits
  • Customers and Contacts — list and retrieve customer records, contacts, zones, and AlarmPayments sessions
  • Recurring Charges and Contracts — list, discontinue, and update recurring charges and contracts
  • Invoices, Correspondence and Support — list invoices, CorrLog, and support records; add new entries
  • Validated Lists — lookup lists that supply accepted values for import fields
  • Utilities — encryption/decryption, GUID generation, and Clarion date/time conversion
  • Data Objects — complete field lists for Customer, InvoiceList, and RechargeList records

All requests go to https://devapi.cfibilling.com and require a signed-in session unless otherwise noted. A Postman collection with working examples is available at https://devapi.cfibilling.com/docs/CornerstoneAPI.postman_collection.json. A formal WSDL definition is available at https://devapi.cfibilling.com/database?WSDL.

Base URL and Endpoints

ItemValue
Servicedatabase
Base URLhttps://devapi.cfibilling.com
Endpoint patternhttps://devapi.cfibilling.com/{MethodName}
Examplehttps://devapi.cfibilling.com/dbCustomerList

Authentication

Start a session with the login method, which uses Basic Authentication and returns a token and status. Every other method requires you to be signed in. The examples send credentials with each request as an HTTP Basic Authorization header (the Base64 encoding of username:password); with cURL, use --user Username:Password.

⚠️ IMPORTANT

Always call the API over HTTPS and keep credentials on your server, never in code that end users can view.

login — Signs in and returns a session token

Accepts POST or GET. No sign-in required.

MethodEndpoint
POSThttps://devapi.cfibilling.com/login
GEThttps://devapi.cfibilling.com/login?parameters

Request Parameters

ParameterTypeRequiredDescription
ccString (2)RequiredCompany Code
userString (255)RequiredUser ID
passwordString (255)RequiredPassword

Response

The response is wrapped in a login_response object. Every response can include the standard ErrorQueue list; most also include ServiceResults.

ElementType
tokenString (255)
statusInteger

Example request (JSON POST)

POST https://devapi.cfibilling.com/login
Content-Type: application/json
Accept: application/json

{
  "cc" : "value",
  "user" : "value",
  "password" : "value"
}

Example request (HTTP GET)

GET https://devapi.cfibilling.com/login?cc=value&user=value&password=value
Accept: application/json

Example response

{
  "login_response" : {
    "token" : "value",
    "status" : "value"
  }
}

Replace each value placeholder with real data.

Request Formats

Each method accepts a JSON POST (parameters in the JSON body, with Content-Type: application/json) or an HTTP GET (parameters in the query string). Both return JSON. Import methods send lists of records, so they must use JSON POST.

JSON POST example

POST https://devapi.cfibilling.com/dbCustomerList
Content-Type: application/json
Accept: application/json
Authorization: Basic {base64 of username:password}

{
  "FilterAccount" : "value",
  "FilterAccountExternal" : "value",
  "ModifiedSinceDate" : "value"
}

Test Mode

The import methods and dbRechargeDiscontinue accept a TestMode parameter. With TestMode = T the request is fully processed and validated, but the data is not written. Use it to check a batch before you import it for real with TestMode = F.

Identifying Customers

ParameterUse
FilterAccountThe Cornerstone customer account number.
FilterAccountExternalYour own (external) account number for the customer. FilterAccount and FilterAccountExternal are mutually exclusive; send one or the other.
AutoAssignAccountOn dbCustomerImport: T lets Cornerstone assign account numbers, F uses the account numbers you send.
ModifiedSinceDateOn dbCustomerList and dbRechargeList: return only records modified on or after this date (mm/dd/yyyy).

Validated Lists

Several import fields only accept values that already exist in Cornerstone. Read the matching list method first; new values must be added in Cornerstone before they can be used in an import.

Import fieldAccepted values from
countydbTaxTableList
salesrepdbTechsList
servicecompdbCentralList
multicomp_iddbMultiComList
servicetype (recurring charges)dbServiceList
type / category (contracts)dbConTypeList / dbContCatList
userfield17 to userfield20dbUser17List to dbUser20List

Recommended Import Workflow

  1. Sign in with login.
  2. Read the validated lists you need and map your values to them.
  3. Import customers with dbCustomerImport using TestMode = T. Fix any errors reported in ErrorQueue.
  4. Repeat with TestMode = F to write the customers.
  5. Import related records (recurring charges, contracts, contacts, invoices, credits) the same way: test first, then write.
  6. Confirm results using dbCustomerList, dbRechargeList, and dbRechargeRMR.

Response Structure and Errors

Every response is a JSON object with a single wrapper named after the method plus _response. Responses include skippedrecords and resultcomplete, any requested data, and the standard lists below.

ErrorQueue — validation and processing errors

Check ErrorQueue on every response; for imports it identifies the record and the problem.

FieldType
ErrorNumberInteger
ErrorPositionString (255)
ErrorRecordIdString (255)
ErrorDescriptionString (255)
ErrorRecommendationString (255)

ServiceResults — the actions performed

FieldType
ResultActionString (255)
ResultTableString (255)
ResultRecordIdString (255)
ResultDescriptionString (255)

Data Types, Dates, and Yes/No Values

Type shownMeaning
String (n)Text up to n characters.
Integer / Byte integerWhole number.
DecimalNumber with decimals, for example amounts.
ObjectA nested JSON object containing fields.
List of objectsA JSON array of objects (one per record).
  • Dates in filters and invoice imports use mm/dd/yyyy.
  • Parameters marked T/F take T (true) or F (false). Flags marked 0/1 take 1 (yes) or 0 (no).
  • Some Cornerstone fields store dates and times in Clarion internal format. Use utDateTime to convert them.

Method Index

Large records returned by several methods are documented in the Data Objects section of this article. All 38 methods are listed below.

MethodDescriptionSection
loginSigns in with a company code, user ID and password (Basic Authentication) and returns a session token.Getting Started
dbCustomerImportCustomer - ImportData Import
dbRechargeImportCustomer - Recurring Charges ImportData Import
dbContractImportCustomer - Contracts ImportData Import
dbContactsImportCustomer - Contacts ImportData Import
dbInvoiceImportCustomer - Invoice ImportData Import
dbCredHeadImportCustomer - Credit ImportData Import
dbCustomerListCustomer - List customers Changed Since DateCustomers and Contacts
dbCustomerFetchCustomer - Record AccessCustomers and Contacts
dbContactsListList of ContactsCustomers and Contacts
dbRelationContactsListContact RelationshipsCustomers and Contacts
dbZonesListList of ZonesCustomers and Contacts
dbAlarmPaymentsAlarmPayments AccessCustomers and Contacts
dbRechargeListList of RechargeRecurring Charges and Contracts
dbRechargeRMRCustomer - Return RMRsRecurring Charges and Contracts
dbRechargeDiscontinueSet Recurring EndDate and stop any AutopaysRecurring Charges and Contracts
dbContractListList of Contracts by Date RangeRecurring Charges andContracts
dbContractUpdateContract UpdateRecurring Charges and Contracts
dbInvoiceListList of Invoices by Date RangeInvoices, Correspondence and Support
dbCorrLogListList of CorrLogs by Date RangeInvoices, Correspondence and Support
dbCorrLogUpdateCorrLog UpdateInvoices, Correspondence and Support
dbSupportListList of Support by Date RangeInvoices, Correspondence and Support
dbSupportUpdateSupport UpdateInvoices, Correspondence and Support
dbTaxTableListCustomer - Tax County ListValidated Lists
dbTechsListTechs / Sales Rep ListValidated Lists
dbCentralListCustomer - Central ListValidated Lists
dbServiceListRecurring - Service ListValidated Lists
dbMultiComListMultiCom ListValidated Lists
dbConTypeListContract - Type ListValidated Lists
dbContCatListContract - Category ListValidated Lists
dbPhoneTypesListPhone Types ListValidated Lists
dbUser17ListCustomer - User17 ListValidated Lists
dbUser18ListCustomer - User18 ListValidated Lists
dbUser19ListCustomer - User19 ListValidated Lists
dbUser20ListCustomer - User20 ListValidated Lists
utEncryptDecryptAllows you to use our version of encryption and decryptionUtilities
utCreateGUIDReturns a 32 character GUIDUtilities
utDateTimeConvert Date and Time values To and From Clarion internal formatUtilities

Data Import

The import methods accept lists of records as JSON POST. Each method supports a TestMode parameter — always run with TestMode = T first to validate without writing data.

⚠️ IMPORTANT

Send each import with TestMode = T first. Test mode validates the data without writing it. When the response has no errors, send the same request with TestMode = F.

dbCustomerImport — Customer Import

Accepts POST or GET. Sign-in required. Endpoint: https://devapi.cfibilling.com/dbCustomerImport

Top-level parameters

ParameterTypeRequiredDescription
TestModeString (1)OptionalT/F - Test Mode Data Not Written
AutoAssignAccountString (1)RequiredT/F - Automatically Assign Account Numbers
customerList of objectsRequiredList of Customers. Contains 60 fields.

Key rules

  • AutoAssignAccount = T: Cornerstone assigns the next available account number and stores the account number you sent as the previous account number, so related imports can still link to it.
  • AutoAssignAccount = F: Cornerstone uses the account number you send. If it already exists, the customer is updated; otherwise a new customer is added.
  • Required fields: lastname, address1, town, state, zip, county, equipment, rescomm, activesince, chargelate, account_status, monitored.
  • multicomp_id is required only if your company uses multi-company.
  • rescomm: RES, COMM or OTHR. account_status: Client, Prospect or In Progress. chargelate: Y or N. monitored: 1 for a monitored account.
  • Yes/No fields accept Y, Yes, YES or 1 for true and N, No, NO or 0 for false.
  • Phone numbers: 10 digits without symbols is preferred. town must be the primary town for the ZIP code, with no hyphens or abbreviations. Do not use double quotes or ampersands in address fields.
  • email_address is strongly recommended and is required for credit card autopay.
  • billtouse should be 1 when bill-to address data is sent, and billtoworksite must match it. allowapay should be imported as 1.
  • Validated fields: county → dbTaxTableList; salesrep → dbTechsList; servicecomp → dbCentralList; multicomp_id → dbMultiComList; userfield17–userfield20 → dbUser17List–dbUser20List.

Example request (JSON POST)

POST https://devapi.cfibilling.com/dbCustomerImport
Content-Type: application/json
Accept: application/json
Authorization: Basic {base64 of username:password}

{
  "TestMode" : "value",
  "AutoAssignAccount" : "value",
  "customer" : [
    {
      "account" : "value",
      "externalaccount" : "value",
      "lastname" : "value",
      "firstname" : "value",
      "address1" : "value",
      "address2" : "value",
      "town" : "value",
      "state" : "value",
      ... 52 more fields (see the field list)
    }
  ]
}

dbRechargeImport — Recurring Charges Import

Accepts POST or GET. Sign-in required. Endpoint: https://devapi.cfibilling.com/dbRechargeImport

Key rules

  • Each recurring charge links to a customer by account number. A customer can have more than one recurring charge.
  • servicetype must be a recurring charge code that already exists in Cornerstone (see dbServiceList). New codes must be added in Cornerstone first.
  • Required fields: account (or externalaccount), servicetype, billperiod, nextdate (leave blank when pending), charge, chargetax, prorate_startdate, paymethod, autopay.
  • billperiod: for example M, Q, A or S. chargetax and prorate: Y or N. charge is the pre-tax amount.
  • paymethod: Printer, Visa, Master Card, Amex, Discover, Checking, Savings or Email. autopay: YES for any pay method.
  • emailcopy: 0 = None, 1 = Primary, 2 = Secondary, 3 = Both, 4 = Mail hard copy. poston15th: 1 to process on the 15th of the month. pending: 1 marks the charge as pending. note: leave blank unless overriding the service code description.
  • Credit cards: cardbankaccount is the card number (15 or 16 digits, no spaces or hyphens); cardexpirebankaba is the expiration date.
  • Checking/Savings: cardbankaccount is the bank account number and cardexpirebankaba is the 9-digit ABA routing number. Cornerstone encrypts card and bank account numbers on import.

dbContractImport — Contracts Import

Accepts POST or GET. Sign-in required. Endpoint: https://devapi.cfibilling.com/dbContractImport

Key rules

  • Each contract links to a customer by account number. A customer can have more than one contract.
  • Required: account, type and category.
  • type must match a value from dbConTypeList and category must match a value from dbContCatList.

dbInvoiceImport — Invoice Import

Accepts POST or GET. Sign-in required. Endpoint: https://devapi.cfibilling.com/dbInvoiceImport. Send Invoices and their Details in the same request. Detail lines link to their invoice through externalinvoiceid.

  • Invoice required fields: externalaccount or account, externalinvoiceid, invoicedate, duedate, service_desc, printed, categoryof, county.
  • Detail required fields: externalinvoiceid, partid, part, quantity, unit_charge, taxable, gl_code, printinvoice, printtextoninvoice.
  • Dates use mm/dd/yyyy. printed, printinvoice and printtextoninvoice: 1 = Yes, 0 = No. taxable: Y or N.
  • quantity must be positive. For a deduction, send a negative unit_charge (and extended).
  • If sent, taxrate must match the rate for the county and taxamount, totaldue and tax_amount must match Cornerstone's calculated values.
  • When payments are sent, amountpaid must equal the total of amtpaid1 to amtpaid4.
  • If omitted, billto_account and multicomp_id default to the values on the customer record.

dbCredHeadImport — Credit Import

Accepts POST or GET. Sign-in required. Endpoint: https://devapi.cfibilling.com/dbCredHeadImport

  • Required: CreditDate, CreditAmount and CreditType.
  • CreditType: PREPAID, *PREPAID or DISCOUNT.
  • DiscountCategory is validated against your credit codes when CreditType is DISCOUNT.
  • OkForRecurring and OkForProduct default to 1. DescriptionInvoice prints on the invoice.

Validated Lists — Reference

Call these methods before importing to retrieve the accepted values for validated import fields. All accept POST or GET and require a signed-in session. New values must be added in Cornerstone first — they cannot be created through the API.

⚠️ IMPORTANT

Many import fields only accept values that already exist in Cornerstone. Call these methods to get the accepted values before you import. New values must be added in Cornerstone first.

dbTaxTableList — Customer - Tax County List

Endpoint: https://devapi.cfibilling.com/dbTaxTableList — takes no parameters. Returns the counties (taxing authorities) accepted in the county field of customer and invoice imports. The county attaches the correct sales tax rate. Response list: TaxTable_List with fields county (String 20), multicomp_id (String 5), taxrate (Decimal), gl_code (String 20).

dbTechsList — Techs / Sales Rep List

Endpoint: https://devapi.cfibilling.com/dbTechsList — takes no parameters. Response list: Techs_List with fields tech (String 15), lastname (String 40), firstname (String 20), issalesrep (Byte integer), istechnician (Byte integer).

dbCentralList — Customer - Central List

Endpoint: https://devapi.cfibilling.com/dbCentralList — takes no parameters. Response list: Central_List with fields central_name (String 25), multicomp_id (String 5).

dbServiceList — Recurring - Service List

Endpoint: https://devapi.cfibilling.com/dbServiceList — takes no parameters. Returns the recurring charge codes accepted by dbRechargeImport. The invoice description for a code is limited to 26 characters. Response list: Service_List with fields servicetype (String 8), servicedesc (String 65), multicomp_id (String 5), default_cycle (String 1), default_monthly (Decimal), default_tax (String 1).

dbMultiComList — MultiCom List

Endpoint: https://devapi.cfibilling.com/dbMultiComList — takes no parameters. Response list: MultiCom_List with 15 fields including multicomp_id, companyname, companyadd1, companyadd2, companytown, companystate, companyzip, companyzip2, companytele1, companytele2, contact, title, email_address, license_number, license_number2.

dbConTypeList — Contract - Type List

Endpoint: https://devapi.cfibilling.com/dbConTypeList — takes no parameters. Response list: ConType_List with field type (String 15).

dbContCatList — Contract - Category List

Endpoint: https://devapi.cfibilling.com/dbContCatList — takes no parameters. Response list: ContCat_List with field category (String 15).

dbPhoneTypesList — Phone Types List

Endpoint: https://devapi.cfibilling.com/dbPhoneTypesList — takes no parameters. Response list: PhoneTypes_List with fields codeinternal (String 25), codeexternal (String 25), codedisplay (String 25).

dbUser17List through dbUser20List — Customer User Field Lists

These four methods follow the same pattern and each take no parameters.

MethodDescriptionResponse list
dbUser17ListCustomer - User17 ListUser17_List
dbUser18ListCustomer - User18 ListUser18_List
dbUser19ListCustomer - User19 ListUser19_List
dbUser20ListCustomer - User20 ListUser20_List

Each response list contains three fields: codeinternal (String 25), codeexternal (String 25), and codedisplay (String 25).

Utilities

These methods provide encryption/decryption, GUID generation, and Clarion date and time conversion. All accept POST or GET and require a signed-in session.

utEncryptDecrypt — Encrypt or Decrypt a value

Allows you to use Cornerstone's version of encryption and decryption. Endpoint: https://devapi.cfibilling.com/utEncryptDecrypt

ParameterTypeRequired
RequestString (1)Optional
InputIntegerRequired

Response is wrapped in a utEncryptDecrypt_response object and includes skippedrecords, resultcomplete, and Output (Integer).

utCreateGUID — Generate a GUID

Returns a 32 character GUID. Endpoint: https://devapi.cfibilling.com/utCreateGUID — takes no parameters. Response is wrapped in a utCreateGUID_response object and includes skippedrecords, resultcomplete, and Output (String 32).

utDateTime — Convert Clarion Date and Time

Converts date and time values to and from Clarion internal format. Endpoint: https://devapi.cfibilling.com/utDateTime

ParameterTypeRequiredDescription
RequestString (1)RequiredF = From Clarion format; T = To Clarion format
InputDateString (15)Optional 
InputTimeString (15)Optional 

Response is wrapped in a utDateTime_response object and includes skippedrecords, resultcomplete, OutputDate (String 15), and OutputTime (String 15).

Data Objects

The following large records are returned by multiple methods. Each contains a complete set of fields with data types and, where applicable, date formats.

Customer — 245 fields

Returned by: dbCustomerFetch. Contains the full customer record including identity, address, billing, contact, recurring billing settings, user-defined fields (userfield01–userfield25), API fields (apifield01–apifield10), bill-to address, at-risk tracking, GPS coordinates, and long-text fields such as site_directions (String 1501), service_instructions (String 1501), and comments (String 5001). Date fields such as activesince and closed are Integer · mm/dd/yyyy. The dbCustomerFetch response also returns balanceduecnt (Integer), balancedueamt (Decimal), and totalmonthlyrmr (Decimal) alongside the Customer object.

InvoiceList — 115 fields

Returned by: dbInvoiceList. Contains invoice header and payment data including guid, account, invoicetype, inv_number, invoicedate, duedate, totaldue, taxrate, taxamount, up to four payment slots (amtpaid1–amtpaid4 with associated datepaid and datepost fields), surcharge fields, worksite address fields, and reserved unused fields.

RechargeList — 80 fields

Returned by: dbRechargeList. Contains the full recurring charge record including guid, account, servicetype, billperiod, nextdate, end_date, charge, monthly, autopay and payment card/bank fields, rate increase tracking fields (nextincrease, lastincrease, lastincrease2–5, prevmonthly–prevmonthly5), invoice pause fields, and audit fields such as datecreated, usercreated, changedate, changetime (Integer · hh:mm am), and changeuserid.

Need Additional Help?

Our Customer Success team is here to assist you.

Phone: 847-405-9517
Email: customer.success@alarmbills.com

Copyright © 1999–2026 Cornerstone Billing Solutions. All rights reserved.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article