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:
A custom script (Codex) is triggered to send invoice data to the ERP.
The ERP checks the data against existing records.
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.
Create a new API
Navigate to
(settings) >> WEB SERVICES >> Outbound >> Click REST.
Create a new API:
Name: ValidateVendorInvoice
Method: POST
Add headers for authentication (e.g., Authorization: Bearer {{token}})
In the Body, add placeholders:
{
"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
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);