Automate Vendor Invoice Validation in Qntrl Using Outbound REST API Integration | Qntrl Online Help | Web Services Online Help

Business Case: Automating Vendor Invoice Validation with External ERP

Scenario  

A company is looking to simplify and automate its vendor invoice processing. The finance team receives invoices from various vendors daily.  Each time a new invoice is submitted in Qntrl, the system needs to validate invoice must be validated against the company's ERP system to ensure:
  • The vendor is registered and active.
  • The invoice amount matches the purchase order.
  • No duplicate invoice has been submitted.
 

How it works 

With Outbound REST Web Services, Qntrl can automatically validate vendor invoices by connecting to the company’s ERP system via REST APIs.
When an invoice is submitted through a form in Qntrl:
  1. A custom script (Codex) is triggered to send invoice data to the ERP.
  2. The ERP checks the data against existing records.
  3. A response is returned indicating whether the invoice is valid, duplicate, or needs review.

Business Impact  

  • Reduced Errors: Automated validation eliminates manual entry mistakes.
  • Faster Processing: Invoices are validated in real-time.
  • Improved Compliance: Ensures all invoices meet internal and external audit requirements.
  • Scalability: Handles high volumes of invoices without additional manpower.

 

Steps to Configure Outbound REST API in Qntrl   

Create a new API

  • Login to Qntrl.
  • Navigate to (settings) >> WEB SERVICES >> Outbound >> Click REST.
  • Create a new API:

{
   "vendor_id": "{{vendorId}}",
   "invoice_number": "{{invoiceNumber}}",
   "amount": "{{amount}}"
}


    Create Pre Script (Optional)  

    Add a Pre Script to auto-generate a tracking ID or transform any input before sending.

    function beforeSend() {
        webservice.outboundREST.addHeader("x-tracking-id", "validate-" + Date.now());
    }


    Response Parser Setup  

    • Use JSON path to extract:
      • status
      • reason
      • validated_amount These can be reused in workflows or decision logic.

    Execute in Codex

    Trigger the API from a blueprint transition or business rule:

    let requestData = {
       vendorId: "V123",
       invoiceNumber: "INV56789",
       amount: "1200"
    };
    let result = OutboundREST.executeByName("ValidateVendorInvoice", requestData);
    console.log(result);