This guide adds e-invoicing to ServiceNow with server-side JavaScript and one REST API. The core is one call. You send the invoice as JSON, and the API returns a validated ZUGFeRD PDF. ServiceNow attaches the file to your record:
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://api.invoicexml.com/v1/create/zugferd');
request.setHttpMethod('post');
request.setRequestHeader('Authorization', 'Bearer ' + apiKey);
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestBody(JSON.stringify({ invoice: invoice }));
// The response body is the PDF. ServiceNow saves it as an attachment on the record.
request.saveResponseBodyAsAttachment(record.getTableName(), record.getUniqueValue(), 'invoice.pdf');
var response = request.execute(); // status 200: a validated ZUGFeRD invoice
The rest of the guide turns this call into one Script Include for both directions. Outgoing: a scheduled job creates the e-invoice for every approved record. Incoming: supplier invoices are checked, invalid ones go back with a report, and valid ones are read as JSON, ready for Accounts Payable Operations. It runs in a scoped application and needs no IntegrationHub and no Store app.
Why now. Every German business has had to accept structured e-invoices since January 2025. Businesses with more than EUR 800,000 turnover in the previous year must issue them from January 2027. All other businesses follow in January 2028. Other European countries have their own dates. The mandate map lists them by country.
What you need
- A ServiceNow instance and the admin role. Start on a personal developer instance or a sub-production instance.
- A scoped application. Create it in ServiceNow Studio. This guide uses the scope
x_acme_einv. Your scope has your own vendor prefix. - Your invoice records. Outgoing invoices usually live in a custom table. The examples use a table
x_acme_einv_invoicewith a line tablex_acme_einv_invoice_line. Replace the table and field names with your own. - Three custom fields on the Company table
core_company:u_vat_id,u_country_code(ISO code, for example DE) andu_leitweg_idfor German public buyers. - An inbox table
x_acme_einv_inboxfor supplier invoices, with the fieldssender,state,message,invoice_number,supplier,totalandpayload. - An InvoiceXML account. Start a free trial, no credit card needed, and copy the API key from the dashboard.
How the integration works
All logic lives in one Script Include named InvoiceXml. Small entry scripts call it: two scheduled jobs and an inbound email action. ServiceNow holds the records and the files. The API holds the format rules. It builds the XML, embeds it in a PDF/A-3 file, validates the result and returns it.
| Task | Endpoint | Result |
|---|---|---|
| Invoice to a German business | /v1/create/zugferd | Hybrid PDF/A-3 |
| Invoice to a French business | /v1/create/facturx | Hybrid PDF/A-3 |
| Invoice to a German public buyer | /v1/create/xrechnung | XML with Leitweg-ID |
| Create and deliver in one call | /v1/create/zugferd/email | Email with the PDF attached |
| Check a supplier invoice | /v1/validate/zugferd/report | PDF report and a valid flag |
| Read a supplier invoice | /v1/extract/json | Invoice JSON |
All create endpoints take the same JSON body. For Peppol networks, post the same body to /v1/create/ubl and add the electronic addresses of both parties. The Peppol UBL guide lists those fields.
Step 1: Store the API key as a credential
Do not put the API key into a script or a plain system property. ServiceNow has a credential store for this.
- Go to Connections & Credentials, then Credentials, and click New.
- Choose API Key Credentials.
- Enter the name
InvoiceXMLand paste the key into the API Key field. Save the record. - Copy the sys_id of the record. Step 2 uses it.
ServiceNow stores the key encrypted. The Script Include reads it with sn_cc.StandardCredentialsProvider only when it sends a request.
Step 2: Add the Script Include
Create a Script Include named InvoiceXml in your scope. This first part holds the settings and three helpers. Every later part of the guide adds functions to the same object.
// Script Include: InvoiceXml (part 1: settings and helpers)
var InvoiceXml = Class.create();
InvoiceXml.prototype = {
API: 'https://api.invoicexml.com',
CREDENTIAL_ID: 'PASTE_THE_SYS_ID_OF_THE_CREDENTIAL',
REPORT_NAME: 'validation-report.pdf',
// Your legal entity. Move these values to system properties if admins should edit them.
SELLER: {
name: 'Acme Services GmbH',
vatIdentifier: 'DE123456789',
postalAddress: { line1: 'Hauptstrasse 1', city: 'Berlin', postCode: '10115', country: 'DE' }
},
IBAN: 'DE89370400440532013000',
FROM_EMAIL: '[email protected]',
initialize: function () {
var credential = new sn_cc.StandardCredentialsProvider().getCredentialByID(this.CREDENTIAL_ID);
if (!credential) throw new Error('The InvoiceXML credential was not found or is not readable');
this.apiKey = credential.getAttribute('api_key');
this.attachments = new GlideSysAttachment();
},
// A POST request with the endpoint, the key and a timeout
_request: function (path) {
var request = new sn_ws.RESTMessageV2();
request.setEndpoint(this.API + path);
request.setHttpMethod('post');
request.setRequestHeader('Authorization', 'Bearer ' + this.apiKey);
request.setHttpTimeout(60000);
return request;
},
// Sends the request. With saveAs, the response body becomes an attachment on the record.
_send: function (request, record, saveAs) {
if (saveAs) {
request.saveResponseBodyAsAttachment(record.getTableName(), record.getUniqueValue(), saveAs);
}
var response = request.execute();
if (response.getStatusCode() == 200) return response;
throw new Error('InvoiceXML ' + response.getStatusCode() + ': ' + this._errorText(response, saveAs));
},
// An error answer is JSON. It lists every rule the invoice broke.
_errorText: function (response, saved) {
if (!saved) return response.getBody() || response.getErrorMessage();
var id = response.getResponseAttachmentSysid();
if (!id) return response.getErrorMessage();
var file = new GlideRecord('sys_attachment');
file.get(id);
var text = this.attachments.getContent(file);
this.attachments.deleteAttachment(id); // the error is not the invoice file
return text;
},
// Parts 2 to 6 of this guide go here
type: 'InvoiceXml'
};
Why _errorText exists. After saveResponseBodyAsAttachment, ServiceNow does not let the script read the body with getBody(). So the helper reads the saved file, removes it and returns the text. The calling script gets one Error with the status code and the list of broken rules.
Step 3: Map your records to JSON
The API takes an EN 16931 invoice as JSON. The buyer comes from the Company record of the customer. The seller is your own legal entity. This is the mapping for the example tables:
| ServiceNow field | JSON path | Note |
|---|---|---|
number | invoice.invoiceNumber | The invoice number |
issue_date, due_date | invoice.issueDate, dueDate | Date fields. getValue returns yyyy-MM-dd |
currency | invoice.currency | ISO code, for example EUR |
po_number | invoice.purchaseOrderReference | The buyer's order number |
customer (reference to core_company): name | invoice.buyer.name | Standard field |
street, city, zip | invoice.buyer.postalAddress | Standard fields |
u_country_code | invoice.buyer.postalAddress.country | Custom field with the ISO code |
u_vat_id | invoice.buyer.vatIdentifier | Custom field |
u_leitweg_id | invoice.buyerReference | Custom field, XRechnung only |
Line: description, quantity, unit_price | lines[].item.name, quantity, priceDetails.netPrice | Net price per unit |
Line: unit_code | lines[].unitCode | UN/ECE code: H87 for pieces, HUR for hours |
Line: vat_rate | lines[].vatInformation.rate | For example 19 |
The body has no totals and no VAT amounts. The API calculates both from the lines. When the numbers do not add up, the API answers with an error and does not create a file.
// InvoiceXml (part 2: read the record and build the JSON)
buildInvoice: function (inv) {
var customer = inv.customer.getRefRecord(); // core_company
var lines = [];
var line = new GlideRecord('x_acme_einv_invoice_line');
line.addQuery('invoice', inv.getUniqueValue());
line.orderBy('position');
line.query();
while (line.next()) {
lines.push({
quantity: parseFloat(line.getValue('quantity')),
unitCode: line.getValue('unit_code') || 'C62', // C62 is the generic unit
item: { name: line.getValue('description') },
priceDetails: { netPrice: parseFloat(line.getValue('unit_price')) },
vatInformation: { rate: parseFloat(line.getValue('vat_rate')) }
});
}
return {
invoiceNumber: inv.getValue('number'),
issueDate: inv.getValue('issue_date'),
dueDate: inv.getValue('due_date'),
currency: inv.getValue('currency'),
purchaseOrderReference: inv.getValue('po_number'),
buyerReference: customer.getValue('u_leitweg_id'), // XRechnung only
seller: JSON.parse(JSON.stringify(this.SELLER)), // a copy for this invoice
buyer: {
name: customer.getValue('name'),
vatIdentifier: customer.getValue('u_vat_id'),
postalAddress: {
line1: customer.getValue('street'),
city: customer.getValue('city'),
postCode: customer.getValue('zip'),
country: customer.getValue('u_country_code')
}
},
paymentDetails: { paymentAccountIdentifier: this.IBAN },
lines: lines
};
},
getValue returns null for an empty field. The API ignores fields with null, so buyerReference stays out of invoices to businesses.
Step 4: Create the e-invoice in a scheduled job
One function posts the JSON and attaches the file. A second function picks the format by the customer.
// InvoiceXml (part 3: create the file and attach it to the record)
_postJson: function (path, body, record, saveAs) {
var request = this._request(path);
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestBody(JSON.stringify(body));
return this._send(request, record, saveAs);
},
formatFor: function (invoice) {
if (invoice.buyerReference) return 'xrechnung'; // German public buyer
return invoice.buyer.postalAddress.country == 'FR' ? 'facturx' : 'zugferd';
},
// Returns the sys_id of the new attachment
create: function (record) {
var invoice = this.buildInvoice(record);
var format = this.formatFor(invoice);
var name = invoice.invoiceNumber + '-' + format + (format == 'xrechnung' ? '.xml' : '.pdf');
return this._postJson('/v1/create/' + format, { invoice: invoice }, record, name)
.getResponseAttachmentSysid();
},
Now create a Scheduled Script Execution that runs every five minutes. It picks up every invoice in the state Approved. The job runs in the background, so no user waits for the API. It runs as the system, so it can read the credential whoever approved the invoice.
// Scheduled Script Execution: every 5 minutes
var api = new InvoiceXml();
var invoice = new GlideRecord('x_acme_einv_invoice');
invoice.addQuery('state', 'approved');
invoice.setLimit(50);
invoice.query();
while (invoice.next()) {
try {
api.create(invoice);
invoice.setValue('state', 'issued');
} catch (e) {
// The message names every rule the invoice broke
invoice.setValue('state', 'failed');
invoice.setValue('message', e.message);
}
invoice.update();
}
Open a record after the job ran. The e-invoice is in the attachment list. A ZUGFeRD or Factur-X file opens as a normal invoice in any PDF viewer. Every file the API returns already passed validation, so a status 200 means a compliant invoice. You do not need a second call to check your own files.
Send the invoice by email from the API
ServiceNow does not have to send the invoice. One call lets the API create the invoice, validate it and email it to the customer. In Germany this is a complete delivery. There is no central platform for invoices between businesses, and an email with a ZUGFeRD PDF fulfils the mandate.
Verify your sending domain once in the dashboard. After that, any address on the domain can be the sender. The customer sees your address, and a reply lands in your mailbox. The request body is the invoice JSON plus an email object:
// InvoiceXml (part 4: let the API send the invoice)
email: function (record, to) {
var invoice = this.buildInvoice(record);
var response = this._postJson('/v1/create/' + this.formatFor(invoice) + '/email', {
invoice: invoice,
email: {
from: this.FROM_EMAIL, // an address on your verified sending domain
fromName: this.SELLER.name,
to: to,
subject: 'Invoice ' + invoice.invoiceNumber,
message: 'Hello,\n\nplease find our invoice ' + invoice.invoiceNumber +
' attached.\n\nKind regards\n' + this.SELLER.name
}
});
// 200 means: created, validated and handed to delivery
return JSON.parse(response.getBody()).messageId;
},
To switch, call api.email(invoice, address) instead of api.create(invoice) in the job. Store the message ID on the record if you want a delivery reference.
XRechnung for German public buyers
A German public buyer needs XRechnung, not ZUGFeRD. XRechnung is XML only. The buyer assigns a routing ID, the Leitweg-ID, when you register as a supplier. Store it in u_leitweg_id on the Company record. The mapping copies it into buyerReference, and formatFor then picks xrechnung.
The German rules also ask for a seller contact and for electronic addresses of both parties. Add them at the end of buildInvoice:
// In buildInvoice, write "var invoice = {" instead of "return {", then add before the end:
if (invoice.buyerReference) {
invoice.seller.contact = { name: 'Billing', phone: '+49 30 1234567', email: this.FROM_EMAIL };
invoice.seller.electronicAddress = { identifier: this.SELLER.vatIdentifier, schemeId: '9930' };
invoice.buyer.electronicAddress = invoice.buyer.vatIdentifier
? { identifier: invoice.buyer.vatIdentifier, schemeId: '9930' }
: { identifier: invoice.buyerReference, schemeId: '0204' };
}
return invoice;
Scheme 9930 stands for a German VAT ID. A buyer without a VAT ID gets the Leitweg-ID with scheme 0204. The API answers with XML that already passed the German rule set. Deliver it the way the buyer asks for: a portal upload, Peppol, or email. The XRechnung integration guide explains the format in depth.
Check incoming supplier invoices
Supplier invoices now arrive as ZUGFeRD or Factur-X PDFs and as XML files. The intake has three steps, and they are the same on every platform. The incoming e-invoice guide covers them in detail.
- Validate. Upload the file to a
/v1/validate/.../reportendpoint. The body of the response is a PDF validation report. The headerX-Invoice-Validistrueorfalse. - Send the report back. For an invalid invoice, email the report to the sender and stop. The report lists every broken rule with the field and a message.
- Extract. For a valid invoice, upload the file to
/v1/extract/json. The API returns the invoice as JSON, in the same shape as the create request.
Receive the email. Forward your invoice mailbox to the email address of the instance. An inbound email action with the target table x_acme_einv_inbox and the type New creates one inbox record per email. ServiceNow copies the attachments of the email to that record.
// Inbound email action: target table x_acme_einv_inbox, type New
(function runAction(current, event, email, logger, classifier) {
current.setValue('sender', email.origemail); // the report goes back to this address
current.setValue('state', 'new');
current.insert();
})(current, event, email, logger, classifier);
The action only creates the record. A scheduled job does the work a few minutes later. It reads one PDF or XML file per record, so ask suppliers to send one invoice per email.
Upload an attachment to the API
The upload endpoints take multipart/form-data with one part named file. RESTMessageV2 has no multipart helper, and a script string cannot hold the bytes of a PDF. The solution is to build the body in base64. The script writes it to a temporary attachment and sends that attachment as the request body. This runs in a scoped application and works for PDF and XML files.
// InvoiceXml (part 5: send an attachment as multipart/form-data)
_upload: function (path, file, record, saveAs) {
var isPdf = /\.pdf$/i.test(file.getValue('file_name'));
var boundary = 'ixml' + gs.generateGUID();
var head = '--' + boundary + '\r\n' +
'Content-Disposition: form-data; name="file"; filename="' + (isPdf ? 'invoice.pdf' : 'invoice.xml') + '"\r\n' +
'Content-Type: ' + (isPdf ? 'application/pdf' : 'application/xml');
// Base64 pieces join cleanly only at a multiple of 3 bytes, so pad the header line
while ((head.length + 4) % 3 !== 0) head += ' ';
head += '\r\n\r\n';
var content = String(this.attachments.getContentBase64(file)).replace(/\s/g, '');
var tail = '\r\n--' + boundary + '--\r\n';
// A padded ending moves the first bytes of the tail into the last base64 group
if (/==$/.test(content)) {
content = content.slice(0, -2) + '0K'; // adds \r\n
tail = tail.substring(2);
} else if (/=$/.test(content)) {
content = content.slice(0, -1) + 'N'; // adds \r
tail = tail.substring(1);
}
var bodyId = this.attachments.writeBase64(record, 'ixml-upload.tmp', 'application/octet-stream',
gs.base64Encode(head) + content + gs.base64Encode(tail));
try {
var request = this._request(path);
request.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary);
request.setRequestBodyFromAttachment(bodyId);
return this._send(request, record, saveAs);
} finally {
this.attachments.deleteAttachment(bodyId);
}
},
The file name inside the body is fixed, so the header stays plain ASCII. The API decides between PDF and XML by this name and the content type. The temporary attachment exists only for the duration of the call.
Validate, send the report back, extract
The function receive runs the three steps for one inbox record. It saves the validation report on the record in both cases. For a valid invoice, the report is your proof that the file was checked.
// InvoiceXml (part 6: validate, send the report back or extract)
_invoiceFile: function (inbox) {
var file = this.attachments.getAttachments(inbox.getTableName(), inbox.getUniqueValue());
while (file.next()) {
var name = file.getValue('file_name');
if (/\.(pdf|xml)$/i.test(name) && name != this.REPORT_NAME) return file;
}
throw new Error('No PDF or XML attachment');
},
// PDF files hold ZUGFeRD or Factur-X. XML files are XRechnung, CII or UBL.
_formatOf: function (file) {
if (/\.pdf$/i.test(file.getValue('file_name'))) return 'zugferd';
var xml = this.attachments.getContent(file);
if (xml.indexOf('xrechnung') !== -1) return 'xrechnung';
return xml.indexOf('CrossIndustryInvoice') !== -1 ? 'cii' : 'ubl';
},
receive: function (inbox) {
var file = this._invoiceFile(inbox);
// 1. Validate. The PDF report is saved on the inbox record.
var check = this._upload('/v1/validate/' + this._formatOf(file) + '/report', file, inbox, this.REPORT_NAME);
// 2. Invalid: a notification sends the report to the supplier
if (check.getHeader('X-Invoice-Valid') != 'true') {
inbox.setValue('state', 'rejected');
inbox.update();
gs.eventQueue('x_acme_einv.invoice_rejected', inbox, inbox.getValue('sender'));
return null;
}
// 3. Valid: read the data
var body = this._upload('/v1/extract/json', file, inbox).getBody();
var invoice = JSON.parse(body).invoice;
inbox.setValue('invoice_number', invoice.invoiceNumber);
inbox.setValue('supplier', invoice.seller.name);
inbox.setValue('total', invoice.totals.grandTotalAmount);
inbox.setValue('payload', body);
inbox.setValue('state', 'valid');
inbox.update();
return invoice;
},
The scheduled job calls receive for every new inbox record. Create a Scheduled Script Execution that runs every five minutes:
// Scheduled Script Execution: every 5 minutes
var api = new InvoiceXml();
var inbox = new GlideRecord('x_acme_einv_inbox');
inbox.addQuery('state', 'new');
inbox.setLimit(50);
inbox.query();
while (inbox.next()) {
try {
api.receive(inbox);
} catch (e) {
inbox.setValue('state', 'error');
inbox.setValue('message', e.message);
inbox.update();
}
}
The notification. Register the event x_acme_einv.invoice_rejected in the Event Registry. Then create a notification on the inbox table that is sent when this event is fired. Tick Event parm 1 contains recipient and Include attachments. The supplier receives the validation report together with the original file, corrects the invoice and sends it again.
Which rules apply. The ubl and cii endpoints check each file against the rule set it declares, for example Peppol BIS or a national rule set. So one inbox handles suppliers from several countries. For a German or French report, add a second part named validationLanguage with the value de or fr to the multipart body.
Plain PDFs. A PDF without XML inside is not an e-invoice. It fails the check, and the report tells the supplier why. If you still accept plain PDFs from some suppliers, send those files to POST /v1/parse/json instead. The API reads the PDF with AI and returns the same JSON. Give these records their own state, so a person compares the values with the PDF before the invoice moves on.
A quick reminder: a person checks every AI result. The AI reads the PDF well, but it can make mistakes. Before you book, store or forward a parsed invoice, compare its values with the PDF: the parties and their tax IDs, the invoice number and dates, the lines, the tax amounts and totals, and the payment details.
Pass the invoice to Accounts Payable Operations
If your instance runs ServiceNow Accounts Payable Operations, the checked invoice can go into it. Accounts Payable Operations has an AP Invoice API that takes invoices as JSON. It creates the invoice, the invoice lines and the invoice case. The JSON from /v1/extract/json maps to the keys of that API like this:
| InvoiceXML JSON | AP Invoice API key |
|---|---|
invoice.invoiceNumber | supplier_invoice_number, external_invoice_number |
invoice.issueDate | invoice_date |
invoice.seller.vatIdentifier | supplier_tax_id |
invoice.seller.postalAddress.line1 | remit_address |
invoice.seller.postalAddress.city | remit_to_city |
invoice.seller.postalAddress.postCode | remit_to_zip_or_postal_code |
invoice.seller.postalAddress.countrySubdivision | remit_to_state_or_province |
invoice.seller.postalAddress.country | remit_to_country |
invoice.purchaseOrderReference | purchase_order |
invoice.currency | currency |
invoice.totals.sumOfLineNetAmounts | subtotal |
invoice.totals.sumOfCharges | shipping_amount |
invoice.totals.grandTotalAmount | amount_invoiced |
invoice.paymentDetails.paymentTerms | payment_terms |
lines[].item.name | invoice_lines[].line_description |
lines[].quantity | invoice_lines[].line_quantity |
lines[].priceDetails.netPrice | invoice_lines[].line_unit_price |
lines[].lineNetAmount | invoice_lines[].subtotal, line_amount_invoiced |
lines[].unitCode | invoice_lines[].uom |
lines[].item.sellerIdentifier | invoice_lines[].supplier_part_number |
lines[].buyerOrderLineReference | invoice_lines[].purchase_order_line |
lines[].vatInformation.rate | invoice_lines[].tax_details[].tax_rate |
Three keys need more than a copy. The key supplier is the identifier of the supplier in your instance. Find the supplier record by the VAT ID of the seller. Every line also carries external_invoice_number, the same value as on the invoice. The amounts subtotal and line_amount_invoiced are without tax, and amount_invoiced is the total with tax and shipping.
The call. Post the mapped invoices to /api/sn_spend_intg/v1/ap_invoice/json on your instance. The body is an object with one array named invoices. Send the headers Content-Type: application/json and Source-System, which names the sending system. The calling user needs the role sn_spend_intg.procurement_integrator. The API belongs to the Store applications Accounts Payable Invoice Processing and Source-to-Pay Integration Framework.
One request per job run. The invoices array takes many invoices. Collect the valid invoices of one job run and send them together. The API answers with status 202 and a batch ID, and Accounts Payable Operations processes the batch in the background. The Invoice integration log shows the result for each batch.
The AP Invoice API reference from ServiceNow lists every key and marks the required ones. It also covers the tax details and the attachments, so the original e-invoice can travel with the invoice record.
Without Accounts Payable Operations, the inbox record already holds the data. The fields carry the invoice number, the supplier and the total, and payload holds the full JSON. Build your approval flow on that table, or post the JSON to your ERP.
Scopes, flows and instances
Other scopes. Set Accessible from on the Script Include to All application scopes. Scripts in other applications then call it as new x_acme_einv.InvoiceXml().
Flows. A custom action with a Script step can call the same functions. This puts "Create e-invoice" and "Check e-invoice" into your flows without a second implementation.
Why scheduled jobs. A scheduled job runs in the background and as the system. No user waits for the API, and the job can always read the credential. A business rule runs as the user who saved the record, and that user may not be allowed to read credentials.
Timeouts and retries. setHttpTimeout takes milliseconds. If a call times out, the record gets the state failed or error. Set it back to approved or new and the next job run tries again.
Instances. Create the credential record on every instance. Use a separate InvoiceXML API key for development, test and production, so test invoices never mix with real ones.
Format updates. ZUGFeRD, XRechnung and the EN 16931 rules get new versions regularly. The API switches to each new version on its effective date. Your scripts send the same JSON before and after. No update set, no new deployment.
Endpoint reference
| Purpose | Endpoint | Input | Output |
|---|---|---|---|
| Create ZUGFeRD | POST /v1/create/zugferd | Invoice JSON | Hybrid PDF/A-3 |
| Create Factur-X | POST /v1/create/facturx | Invoice JSON | Hybrid PDF/A-3 |
| Create XRechnung | POST /v1/create/xrechnung | Invoice JSON with Leitweg-ID | XRechnung XML |
| Create Peppol UBL | POST /v1/create/ubl | Invoice JSON | UBL XML |
| Create and email | POST /v1/create/{format}/email | Invoice JSON + email object | Email sent from your domain |
| Validate with PDF report | POST /v1/validate/{format}/report | PDF or XML file | PDF report, X-Invoice-Valid header |
| Validate as JSON | POST /v1/validate/{format} | PDF or XML file | Findings per rule |
| Extract structured data | POST /v1/extract/json | Hybrid PDF or XML file | Invoice JSON |
| Parse plain PDF | POST /v1/parse/json | PDF without XML | Invoice JSON |
The validate endpoints for zugferd and facturx take a PDF. The ones for xrechnung, cii and ubl take XML.
Get started
The whole integration is one Script Include and three small entry scripts. Store the key, map your records, create and attach or email, check what comes in. No format logic in ServiceNow. Nothing to redeploy when the formats change. This guide is part of the integrations hub, which also covers SAP, Salesforce, Dynamics and other platforms. Plans are on the pricing page.
Related guides:
- Automating incoming e-invoices: the receiving pipeline in plain API calls.
- Salesforce e-invoicing: the same integration from Flow and Apex.
- NetSuite ZUGFeRD and XRechnung: SuiteScript, vendor bills and email delivery.
- E-invoicing on SAP BTP: a CAP service for S/4HANA billing documents.
- ZUGFeRD integration guide: the format, the profiles and every endpoint.