Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

QubitOn API — ServiceNow Connector

Native Script Include for integrating the QubitOn API with ServiceNow. 41 methods covering address validation, tax ID verification, bank account validation, sanctions screening, ESG scoring, risk assessment, corporate hierarchy, and more.

Open source: github.com/qubitonhq/qubiton-servicenow (MIT License)

How It Works

ServiceNow Instance                          QubitOn API
──────────────────                           ───────────
core_company (Vendor/Customer)               70+ validation &
    │                                        enrichment endpoints
    ├─ Business Rule (insert/update)
    ├─ Flow Designer Action                  Address, Tax ID,
    ├─ Client Script (GlideAjax)             Bank, Email, Phone,
    └─ Scheduled Job (batch)                 Sanctions, PEP, ESG,
        │                                    Risk, DUNS, etc.
        └──► QubitOnAPI Script Include ──►
              (sn_ws.RESTMessageV2)

Features

Feature Details
41 API methods Validation, enrichment, risk, compliance, financial, and utility endpoints
ServiceNow native Script Include using sn_ws.RESTMessageV2 — no external dependencies
Field mapping helpers mapVendorAddress(), mapVendorTax(), mapVendorSanctions() for core_company records
Client-callable GlideAjax wrappers for real-time form validation (address, tax, email, phone, sanctions, bank)
Flow Designer ready Use any method in Script Steps within Flow Designer actions
Error handling Structured error objects with HTTP status, server-side logging via gs.error()
Rate limit aware Detects HTTP 429 responses and logs warnings
Store ready Designed for ServiceNow Store certification as a Scoped Application

Getting an API Key

  1. Sign up at www.qubiton.com
  2. Navigate to API Keys in the portal dashboard
  3. Click Create API Key, name it (e.g. "ServiceNow Production"), and copy it
  4. Store it securely — it won't be displayed again

Setup

1. Create the System Property

  1. Navigate to System Properties → All Properties
  2. Click New:
    • Name: x_qubiton.api_key
    • Type: string
    • Value: Your QubitOn API key
    • Description: API key for the QubitOn API
  3. Click Submit

2. Register the Script Include

  1. Navigate to System Definition → Script Includes
  2. Click New:
    • Name: QubitOnAPI
    • API Name: global.QubitOnAPI (or your scoped app namespace)
    • Client callable: Check if you need GlideAjax access
    • Accessible from: All application scopes (or restrict as needed)
    • Script: Paste the contents of QubitOnAPI.js
  3. Click Submit

Available Methods (41)

Validation (14)

Method Endpoint Required Fields
validateAddress POST /api/address/validate addressLine1, city, country
validateTax POST /api/tax/validate identityNumber, country
validateTaxFormat POST /api/tax/format-validate identityNumber, countryIso2, identityNumberType
validateBankAccount POST /api/bankaccount/validate country
validateBankAccountPro POST /api/bankaccount/pro/validate country
validateIBAN POST /api/iban/validate iban, country
validateEmail POST /api/email/validate emailAddress
validatePhone POST /api/phone/validate phoneNumber, country
validateNPI POST /api/nationalprovideridentifier/validate npi
validatePeppol POST /api/peppol/validate participantId
validateMedpass POST /api/Medpass/validate id, businessEntityType
validateCertification POST /api/certification/validate country
validateAribaSupplier POST /api/aribasupplierprofile/validate anid
validateIndiaIdentity POST /api/inidentity/validate identityNumber, identityNumberType

Enrichment & Lookup (12)

Method Endpoint Required Fields
lookupBusinessRegistration POST /api/businessregistration/lookup entityName, country
lookupBusinessClassification POST /api/businessclassification/lookup companyName, country, city, state
lookupCorporateHierarchy POST /api/corporatehierarchy/lookup companyName, addressLine1, city, state, zipCode
lookupBeneficialOwnership POST /api/beneficialownership/lookup companyName, countryIso2
lookupDUNS POST /api/duns-number-lookup dunsNumber
lookupCreditAnalysis POST /api/creditanalysis/lookup companyName, addressLine1, city, state, country
lookupCertification POST /api/certification/lookup country
lookupAribaSupplier POST /api/aribasupplierprofile/lookup anid
lookupDOTMotorCarrier POST /api/dot/fmcsa/lookup dotNumber
lookupESGScores POST /api/esg/Scores companyName or esgId
searchESGCompany GET /api/esg/CompanySearch companyName
lookupHierarchy POST /api/company/hierarchy/lookup identifier, identifierType

Risk & Compliance (8)

Method Endpoint Required Fields
screenSanctions POST /api/prohibited/lookup companyName
screenPEP POST /api/pep/lookup name, country
checkDisqualifiedDirectors POST /api/disqualifieddirectors/validate country
assessEntityRisk POST /api/entity/fraud/lookup companyName
checkProviderExclusion POST /api/providerexclusion/validate (at least one name field)
lookupProviderExclusion POST /api/providerexclusion/lookup (at least one name field)
checkEPAProsecution POST /api/criminalprosecution/validate name
lookupEPAProsecution POST /api/criminalprosecution/lookup name

Financial & Analysis (3)

Method Endpoint Required Fields
analyzePaymentTerms POST /api/paymentterms/validate (optional params)
lookupExchangeRates POST /api/currency/exchange-rates/{base} baseCurrency
checkIPQuality POST /api/ipquality/validate ipAddress

Utility (4)

Method Endpoint Required Fields
identifyGender POST /api/genderize/identifygender name
lookupDomainSecurity POST /api/itsecurity/domainreport domain
getSupportedTaxFormats GET /api/tax/format-validate/countries (none)
getPeppolSchemes GET /api/peppol/schemes (none)

ServiceNow Field Mapping

core_company → QubitOn API

ServiceNow Field Column QubitOn Parameter Method
Name name companyName / entityName Sanctions, Registration, Risk
Street street addressLine1 Address Validation
City city city Address Validation
State/Province state state Address Validation
Zip/Postal zip postalCode Address Validation
Country country country All methods
Phone phone_number phoneNumber Phone Validation
Website website domain Domain Security
Tax ID (custom) u_tax_id identityNumber Tax Validation
Tax ID Type (custom) u_tax_id_type identityNumberType Tax Validation
DUNS (custom) u_duns_number dunsNumber DUNS Lookup

sys_user (Contact) → QubitOn API

ServiceNow Field Column QubitOn Parameter Method
Email email emailAddress Email Validation
Phone phone phoneNumber Phone Validation
First name first_name firstName Directors, PEP
Last name last_name lastName Directors, PEP

cmn_location → QubitOn API

ServiceNow Field Column QubitOn Parameter Method
Street street addressLine1 Address Validation
City city city Address Validation
State state state Address Validation
Zip zip postalCode Address Validation
Country country country Address Validation

Usage Examples

Business Rule — Auto-Validate Vendors

Configuration:

  • Table: core_company
  • When: after insert, after update (async)
  • Filter: vendor == true
(function executeRule(current, previous) {

    var api = new QubitOnAPI();

    // --- Address Validation ---
    var addrResult = api.validateAddress(api.mapVendorAddress(current));
    if (!addrResult.error) {
        current.u_address_validated = true;
        current.u_address_validation_details = JSON.stringify(addrResult);
    }

    // --- Tax ID Validation (uses correct API field names) ---
    if (current.u_tax_id) {
        var taxResult = api.validateTax(api.mapVendorTax(current));
        if (!taxResult.error) {
            current.u_tax_validated = true;
        }
    }

    // --- Sanctions Screening ---
    var sanctionsResult = api.screenSanctions(api.mapVendorSanctions(current));
    if (!sanctionsResult.error) {
        current.u_sanctions_screened = true;
        current.u_sanctions_clear = !sanctionsResult.hasMatches;
        current.u_sanctions_result = JSON.stringify(sanctionsResult);
    }

    // --- Email Validation ---
    var contactGR = new GlideRecord('sys_user');
    contactGR.addQuery('company', current.sys_id);
    contactGR.setLimit(1);
    contactGR.query();
    if (contactGR.next() && contactGR.email) {
        var emailResult = api.validateEmail({
            emailAddress: contactGR.getValue('email')
        });
        if (!emailResult.error) {
            current.u_email_validated = true;
        }
    }

    current.update();

})(current, previous);

Flow Designer — Validate Bank Account

  1. Create a new Action in Flow Designer
  2. Add Inputs: account_number (string), bank_code (string), country (string), iban (string)
  3. Add a Script Step:
(function execute(inputs, outputs) {

    var api = new QubitOnAPI();

    var result = api.validateBankAccount({
        accountNumber: inputs.account_number,
        bankCode: inputs.bank_code,
        country: inputs.country,
        iban: inputs.iban
    });

    outputs.is_valid = !result.error;
    outputs.raw_result = JSON.stringify(result);

})(inputs, outputs);
  1. Add Outputs: is_valid (boolean), raw_result (string)

Flow Designer — ESG Risk Assessment

(function execute(inputs, outputs) {

    var api = new QubitOnAPI();

    // Step 1: Find the ESG company ID
    var search = api.searchESGCompany({
        companyName: inputs.company_name,
        country: inputs.country
    });

    if (search.error || !search.length) {
        outputs.esg_found = false;
        return;
    }

    // Step 2: Get full ESG scores
    var scores = api.lookupESGScores({
        esgId: search[0].esgId
    });

    outputs.esg_found = !scores.error;
    outputs.environmental_score = scores.environmentalScore || 0;
    outputs.social_score = scores.socialScore || 0;
    outputs.governance_score = scores.governanceScore || 0;
    outputs.overall_score = scores.overallESGScore || 0;

})(inputs, outputs);

Client Script — Real-Time Address Validation (GlideAjax)

// Trigger on address field change
var ga = new GlideAjax('QubitOnAPI');
ga.addParam('sysparm_name', 'ajaxValidateAddress');
ga.addParam('sysparm_params', JSON.stringify({
    addressLine1: g_form.getValue('street'),
    city:         g_form.getValue('city'),
    state:        g_form.getValue('state'),
    postalCode:   g_form.getValue('zip'),
    country:      g_form.getValue('country')
}));
ga.getXMLAnswer(function(answer) {
    var result = JSON.parse(answer);
    if (!result.error) {
        g_form.showFieldMsg('street', 'Address validated.', 'info');
    } else {
        g_form.showFieldMsg('street', 'Address validation failed.', 'error');
    }
});

Scheduled Job — Batch Sanctions Screening

// Re-screen all active vendors nightly
var gr = new GlideRecord('core_company');
gr.addQuery('vendor', true);
gr.addQuery('active', true);
gr.query();

var api = new QubitOnAPI();
var screened = 0;
var flagged = 0;

while (gr.next()) {
    var result = api.screenSanctions(api.mapVendorSanctions(gr));
    if (!result.error) {
        gr.u_sanctions_screened = true;
        gr.u_sanctions_clear = !result.hasMatches;
        gr.u_last_sanctions_check = new GlideDateTime();
        if (result.hasMatches) {
            flagged++;
            // Create incident for compliance review
            var inc = new GlideRecord('incident');
            inc.initialize();
            inc.short_description = 'Sanctions match: ' + gr.name;
            inc.description = 'Vendor ' + gr.name + ' matched sanctioned entity list.';
            inc.category = 'compliance';
            inc.urgency = 1;
            inc.insert();
        }
        gr.update();
        screened++;
    }
}

gs.info('QubitOn sanctions screening complete: ' + screened +
    ' vendors screened, ' + flagged + ' flagged.');

Error Handling

All methods return a JavaScript object. On failure:

{
    "error": true,
    "statusCode": 400,
    "message": "Detailed error message from the API"
}

On success, the response contains the API result fields (varies per endpoint). Check result.error before accessing data fields.

Errors are also logged server-side via gs.error() — check System Logs → All for troubleshooting.

Rate Limits

Rate limits depend on your subscription tier. If you receive HTTP 429 responses:

  • Reduce Business Rule trigger frequency (e.g. only on insert, not every update)
  • Use async Business Rules instead of synchronous
  • Batch validations via Scheduled Jobs during off-peak hours
  • Upgrade your plan at www.qubiton.com/pricing

ServiceNow Store Certification

This connector is designed for ServiceNow Store listing as a Scoped Application (x_qubiton_connector). Certification requirements:

Requirement Status
Scoped Application packaging Ready
No hardcoded credentials API key via system property
Connection & Credential Alias support Supported
Automated Test Framework (ATF) tests Included
Compatible with Washington DC+ Tested
Security review compliance No eval(), no cross-scope violations

Other Integrations

Platform Type Link
SAP Native ABAP connector (41 methods + BAdI) qubiton-sap
Oracle PL/SQL package for E-Business Suite & Cloud qubiton-oracle
NetSuite SuiteScript 2.1 RESTlet qubiton-netsuite
QuickBooks OAuth 2.0 + webhook connector qubiton-quickbooks
Go SDK Native Go client qubiton-go
Node.js SDK TypeScript client npm install @qubiton/sdk
Python SDK Python client pip install qubiton

License

MIT — see LICENSE.

About

QubitOn API — ServiceNow Script Include with 41 API methods for vendor validation, sanctions screening, ESG scoring, and risk assessment

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages